VideoHelp Forum

+ Reply to Thread
Results 1 to 2 of 2
  1. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Search Comp PM
    Hello. I haven't been a real programmer for 35 years or more (think PDPs and VAXs and real core memory) . On a good day I can fiddle with simple bash scripts and a bit of simple python.

    I'm stuck and am seeking your advice on building ffmpeg with the latest OpenCL-ICD-Loader so that ffmpeg can use OpenCL and thus access nvidia's FAST GPU-accelerated filters such as "unsharp_opencl".

    For a while I've been cross-compiling ffmpeg.exe with OpenCL for use on Win10x64 (using a derivative of deadsix27's work on githib). Here

    Deadsix's cross-compile build system uses a Python3 script to read sets of parameters and manage the build processes for a range of (upstream source) dependencies and then builds ffmpeg.exe. It appears as if it may be similar "in outcome terms" to Zeranoe's thing.
    * runs in a VM under Ubuntu 18.04.3
    * installs mingw64, builds gcc for producing win10x64 binaries
    * downloads and cross-compiles dependencies
    * cross-compiles and links ffmpeg.exe

    However circa 2020.04.20 commits to upstream ICD loader source broke cross-compilation compatibility, and they as yet haven't any suggestions on how to address the issue ...

    The error is this file is a new dependency not found within mingw64 and I can't seem to find a source for it (if indeed that'd fix it).
    [14:17:54][DEBUG] Running 'ninja -j 4 ' in '/home/u/Desktop/_working/workdir/x86_64/OpenCL-ICD-Loader_git'
    [1/4] Building CXX object CMakeFiles/OpenCL.dir/loader/windows/icd_windows_apppackage.cpp.obj
    FAILED: CMakeFiles/OpenCL.dir/loader/windows/icd_windows_apppackage.cpp.obj 
    /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-g++ --sysroot=/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32  -DCL_TARGET_OPENCL_VERSION=220 -DOpenCL_EXPORTS -Iinc -I. -Iloader -O3  -fstack-protector-all  -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -MD -MT CMakeFiles/OpenCL.dir/loader/windows/icd_windows_apppackage.cpp.obj -MF CMakeFiles/OpenCL.dir/loader/windows/icd_windows_apppackage.cpp.obj.d -o CMakeFiles/OpenCL.dir/loader/windows/icd_windows_apppackage.cpp.obj -c loader/windows/icd_windows_apppackage.cpp
    loader/windows/icd_windows_apppackage.cpp:27:10: fatal error: No such file or directory
       27 | #include <>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    [2/4] Building C object CMakeFiles/OpenCL.dir/loader/windows/icd_windows_envvars.c.obj
    [3/4] Building C object CMakeFiles/OpenCL.dir/loader/windows/icd_windows_hkr.c.obj
    FAILED: CMakeFiles/OpenCL.dir/loader/windows/icd_windows_hkr.c.obj 
    /home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-gcc --sysroot=/home/u/Desktop/_working/workdir/toolchain/x86_64-w64-mingw32 -DCL_TARGET_OPENCL_VERSION=220 -DOpenCL_EXPORTS -Iinc -I. -Iloader -O3  -fstack-protector-all  -D_FORTIFY_SOURCE=2 -O3 -DNDEBUG -MD -MT CMakeFiles/OpenCL.dir/loader/windows/icd_windows_hkr.c.obj -MF CMakeFiles/OpenCL.dir/loader/windows/icd_windows_hkr.c.obj.d -o CMakeFiles/OpenCL.dir/loader/windows/icd_windows_hkr.c.obj   -c loader/windows/icd_windows_hkr.c
    loader/windows/icd_windows_hkr.c: In function 'khrIcdOsVendorsEnumerateHKR':
    loader/windows/icd_windows_hkr.c:217:21: error: 'CM_GETIDLIST_FILTER_CLASS' undeclared (first use in this function); did you mean 'CM_GETIDLIST_FILTER_BITS'?
      217 |     ULONG ulFlags = CM_GETIDLIST_FILTER_CLASS |
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
          |                     CM_GETIDLIST_FILTER_BITS
    loader/windows/icd_windows_hkr.c:217:21: note: each undeclared identifier is reported only once for each function it appears in
    loader/windows/icd_windows_hkr.c:218:21: error: 'CM_GETIDLIST_FILTER_PRESENT' undeclared (first use in this function); did you mean 'CM_GETIDLIST_FILTER_BITS'?
      218 |                     CM_GETIDLIST_FILTER_PRESENT;
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                     CM_GETIDLIST_FILTER_BITS
    loader/windows/icd_windows_hkr.c:343:22: error: 'DEVPKEY_Device_ClassGuid' undeclared (first use in this function)
      343 |                     &DEVPKEY_Device_ClassGuid,
          |                      ^~~~~~~~~~~~~~~~~~~~~~~~
    ninja: build stopped: subcommand failed.

    It builds with OpenCL capability using these parameters.
    	'repo_type' : 'git',
    	'url' : '',
    	'depth_git' : 0,
    	'branch' : '6d0b214b9cc303cdb0b05b3c0dc9afb0c39998c5', # 2020.04.20 icd_loader broke upstream
    	'needs_make_install' : False,
    	'conf_system' : 'cmake',
    	'configure_options': '. {cmake_prefix_options} -DCMAKE_INSTALL_PREFIX={target_prefix} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DOPENCL_ICD_LOADER_REQUIRE_WDK=OFF', # 2019.12.13
    	'run_post_build' : [
    		'cp -vf "libOpenCL.dll.a" "{target_prefix}/lib/libOpenCL.dll.a"',
    		'cp -vf "libOpenCL.dll.a" "{target_prefix}/lib/libOpenCL.a"',
    		'if [ ! -f "already_ran_make_install" ] ; then touch already_ran_make_install ; fi',
    	'patches' : [
    		('opencl/0001-OpenCL-git-prefix.patch', '-p1'),
    		('opencl/0002-OpenCL-git-header.patch', '-p1'),
    	'run_post_regexreplace' : [ 
    		'sed -i.bak \'s/Windows.h/windows.h/\' ./loader/windows/icd_windows_envvars.c',
    	'depends_on' : [ 'opencl_headers' ],	
    	'_info' : { 'version' : 'git (master)', 'fancy_name' : 'OpenCL-ICD-Loader' },
    Your kind suggestions and advice would be most appreciated.
    Last edited by hydra3333; 24th Apr 2020 at 09:16.
    Quote Quote  
  2. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Search Comp PM
    They've done something upstream with a new configure switch, which allows export of symbols only and thus bypasses the issue.
    Good oh.
    Quote Quote  

Similar Threads