[FFmpeg-trac] #6871(build system:new): problem cross-compiling ffmpeg with OpenCL

FFmpeg trac at avcodec.org
Sun Nov 26 08:08:56 EET 2017


#6871: problem cross-compiling ffmpeg with OpenCL
-------------------------------------+-------------------------------------
             Reporter:  hydra3333    |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  build        |                  Version:  git-
  system                             |  master
             Keywords:  build        |               Blocked By:
  OpenCL cross-compile               |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:

 With a homegrown cross-compile of ffmpeg - OpenCL used to work, now it
 doesn't.

 I last successfully cross-compiled ffmpeg with OpenCL to run under
 Windows, using a variation of rdp's build script on 2017.11.02.
 In that build, OpenCL worked, i.e. the "-opencl_bench" option was
 recognised.
 {{{
 "C:\itworks\ffmpeg.exe" -opencl_bench
 ffmpeg version N-89088-gce001bb8fc Copyright (c) 2000-2017 the FFmpeg
 developers
   built with gcc 7.2.0 (GCC)
   configuration: --arch=x86_64 --target-os=mingw32 --cross-
 prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-
 master/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32-
 --pkg-config=pkg-config --pkg-config-flags=--static --enable-gray
 --enable-version3 --disable-debug --disable-doc --disable-htmlpages
 --disable-manpages --disable-podpages --disable-txtpages --disable-
 w32threads --enable-nvenc --enable-cuda --enable-cuvid --enable-d3d11va
 --enable-libsoxr --enable-fontconfig --enable-libass --enable-libbluray
 --enable-iconv --enable-libtwolame --enable-libzvbi --enable-libcaca
 --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --extra-
 libs=-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib
 --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex
 --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype
 --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libvo-amrwbenc --enable-libvpx --enable-libilbc
 --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2
 --enable-gray --enable-libopenh264 --enable-libmysofa --enable-libflite
 --enable-lzma --enable-libsnappy --enable-libzimg --enable-libbs2b
 --enable-gmp --enable-libfribidi --enable-cross-compile --enable-pic
 --extra-libs=-lpsapi --extra-libs=-lspeexdsp --disable-schannel --extra-
 cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-
 cflags=-DCACA_STATIC --enable-gpl --enable-avisynth --enable-frei0r
 --enable-filter=frei0r --enable-librubberband --enable-libvidstab
 --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
 --enable-libmfx --enable-avresample --enable-libcdio --extra-
 cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-
 shared --prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-
 master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32
 --enable-nonfree --enable-decklink --enable-libfdk-aac --enable-opencl
 --enable-runtime-cpudetect --extra-libs=-lcrypt32 --extra-libs=-lshlwapi
 --extra-libs=-lstdc++ --extra-libs=-lass --extra-libs=-lfontconfig
 --extra-libs=-lexpat --extra-libs=-lfribidi --extra-libs=-lfreetype
 --extra-libs=-lharfbuzz --extra-libs=-lbz2 --extra-libs=-llzma --extra-
 libs=-liconv --extra-libs=-lcdio --extra-libs=-lcdio_paranoia --extra-
 libs=-lz --extra-libs=-lpsapi --extra-libs=-lspeexdsp --extra-libs=-lgdi32
 --extra-libs=-lwinmm
   libavutil      56.  0.100 / 56.  0.100
   libavcodec     58.  3.102 / 58.  3.102
   libavformat    58.  2.100 / 58.  2.100
   libavdevice    58.  0.100 / 58.  0.100
   libavfilter     7.  0.101 /  7.  0.101
   libavresample   4.  0.  0 /  4.  0.  0
   libswscale      5.  0.101 /  5.  0.101
   libswresample   3.  0.101 /  3.  0.101
   libpostproc    55.  0.100 / 55.  0.100
 1 warning generated.
 platform_idx    device_idx      device_name     runtime
 1       0       GeForce GTX 750 Ti      1801
 0       0               Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz 12411
 }}}

 Now, using the same build process on 2017.11.25, the "-opencl_bench"
 option is no longer recognised.
 {{{
 "C:\itisbroken\ffmpeg.exe" -opencl_bench
 ffmpeg version N-89231-g7d4fe0c5cb Copyright (c) 2000-2017 the FFmpeg
 developers
   built with gcc 7.2.0 (GCC)
   configuration: --arch=x86_64 --target-os=mingw32 --cross-
 prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-
 master/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32-
 --pkg-config=pkg-config --pkg-config-flags=--static --enable-gray
 --enable-version3 --disable-debug --disable-doc --disable-htmlpages
 --disable-manpages --disable-podpages --disable-txtpages --disable-
 w32threads --enable-nvenc --enable-cuda --enable-cuvid --enable-d3d11va
 --enable-libsoxr --enable-fontconfig --enable-libass --enable-libbluray
 --enable-iconv --enable-libtwolame --enable-libzvbi --enable-libcaca
 --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --extra-
 libs=-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib
 --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex
 --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype
 --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libvo-amrwbenc --enable-libvpx --enable-libilbc
 --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2
 --enable-gray --enable-libopenh264 --enable-libmysofa --enable-libflite
 --enable-lzma --enable-libsnappy --enable-libzimg --enable-libbs2b
 --enable-gmp --enable-libfribidi --enable-cross-compile --enable-pic
 --extra-libs=-lpsapi --extra-libs=-lspeexdsp --disable-schannel --extra-
 cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-
 cflags=-DCACA_STATIC --enable-gpl --enable-avisynth --enable-frei0r
 --enable-filter=frei0r --enable-librubberband --enable-libvidstab
 --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
 --enable-libmfx --enable-avresample --enable-libcdio --extra-
 cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-
 shared --prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-
 master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32
 --enable-nonfree --enable-decklink --enable-libfdk-aac --enable-opencl
 --enable-runtime-cpudetect --extra-libs=-lcrypt32 --extra-libs=-lshlwapi
 --extra-libs=-lstdc++ --extra-libs=-lass --extra-libs=-lfontconfig
 --extra-libs=-lexpat --extra-libs=-lfribidi --extra-libs=-lfreetype
 --extra-libs=-lharfbuzz --extra-libs=-lbz2 --extra-libs=-llzma --extra-
 libs=-liconv --extra-libs=-lcdio --extra-libs=-lcdio_paranoia --extra-
 libs=-lz --extra-libs=-lpsapi --extra-libs=-lspeexdsp --extra-libs=-lgdi32
 --extra-libs=-lwinmm
   libavutil      56.  2.100 / 56.  2.100
   libavcodec     58.  3.105 / 58.  3.105
   libavformat    58.  2.102 / 58.  2.102
   libavdevice    58.  0.100 / 58.  0.100
   libavfilter     7.  4.100 /  7.  4.100
   libavresample   4.  0.  0 /  4.  0.  0
   libswscale      5.  0.101 /  5.  0.101
   libswresample   3.  0.101 /  3.  0.101
   libpostproc    55.  0.100 / 55.  0.100
 Unrecognized option 'opencl_bench'.
 Error splitting the argument list: Option not found
 }}}

 In a similar vein, this fails :-
 {{{
 "C:\SOFTWARE\ffmpeg\0-homebuilt-x64\ffmpeg.exe" -opencl_options
 platform_idx=1:device_idx=0 -init_hw_device opencl -filter_hw_device
 opencl -i ".\thevideo.mpg" -an -map_metadata -1 -sws_flags
 lanczos+accurate_rnd+full_chroma_int+full_chroma_inp -filter:v
 yadif=0:0:0,unsharp_opencl=lx=3:ly=3:la=0.5:cx=3:cy=3:ca=0.5,setdar=dar=16/9
 -r 25 -c:v h264_nvenc -preset slow -bf 2 -g 50 -refs 3 -rc:v vbr_hq -rc-
 lookahead:v 32 -cq 22 -qmin 16 -qmax 25 -coder cabac -movflags +faststart
 -profile:v high -level 4.1 -pixel_format yuv420p -y
 ".\thevideo.newest.MP4"
 ffmpeg version N-89088-gce001bb8fc Copyright (c) 2000-2017 the FFmpeg
 developers
   built with gcc 7.2.0 (GCC)
   configuration: --arch=x86_64 --target-os=mingw32 --cross-
 prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-
 master/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32-
 --pkg-config=pkg-config --pkg-config-flags=--static --enable-gray
 --enable-version3 --disable-debug --disable-doc --disable-htmlpages
 --disable-manpages --disable-podpages --disable-txtpages --disable-
 w32threads --enable-nvenc --enable-cuda --enable-cuvid --enable-d3d11va
 --enable-libsoxr --enable-fontconfig --enable-libass --enable-libbluray
 --enable-iconv --enable-libtwolame --enable-libzvbi --enable-libcaca
 --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --extra-
 libs=-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib
 --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex
 --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype
 --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libvo-amrwbenc --enable-libvpx --enable-libilbc
 --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2
 --enable-gray --enable-libopenh264 --enable-libmysofa --enable-libflite
 --enable-lzma --enable-libsnappy --enable-libzimg --enable-libbs2b
 --enable-gmp --enable-libfribidi --enable-cross-compile --enable-pic
 --extra-libs=-lpsapi --extra-libs=-lspeexdsp --disable-schannel --extra-
 cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-
 cflags=-DCACA_STATIC --enable-gpl --enable-avisynth --enable-frei0r
 --enable-filter=frei0r --enable-librubberband --enable-libvidstab
 --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
 --enable-libmfx --enable-avresample --enable-libcdio --extra-
 cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-
 shared --prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-
 master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32
 --enable-nonfree --enable-decklink --enable-libfdk-aac --enable-opencl
 --enable-runtime-cpudetect --extra-libs=-lcrypt32 --extra-libs=-lshlwapi
 --extra-libs=-lstdc++ --extra-libs=-lass --extra-libs=-lfontconfig
 --extra-libs=-lexpat --extra-libs=-lfribidi --extra-libs=-lfreetype
 --extra-libs=-lharfbuzz --extra-libs=-lbz2 --extra-libs=-llzma --extra-
 libs=-liconv --extra-libs=-lcdio --extra-libs=-lcdio_paranoia --extra-
 libs=-lz --extra-libs=-lpsapi --extra-libs=-lspeexdsp --extra-libs=-lgdi32
 --extra-libs=-lwinmm
   libavutil      56.  0.100 / 56.  0.100
   libavcodec     58.  3.102 / 58.  3.102
   libavformat    58.  2.100 / 58.  2.100
   libavdevice    58.  0.100 / 58.  0.100
   libavfilter     7.  0.101 /  7.  0.101
   libavresample   4.  0.  0 /  4.  0.  0
   libswscale      5.  0.101 /  5.  0.101
   libswresample   3.  0.101 /  3.  0.101
   libpostproc    55.  0.100 / 55.  0.100
 Invalid device specification "opencl": unknown device type
 Failed to set value 'opencl' for option 'init_hw_device': Invalid argument
 Error parsing global options: Invalid argument
 }}}

 Is it a bug, or has something changed that I need to cater for in the
 cross-compile  process ?

 How to reproduce:
 {{{
 see build switches above
 cross-compiled under ubuntu17.10/mingw64 for the static target .exe to run
 under windows 10.
 built on 2017.11.25
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6871>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list