m-ab-s / media-autobuild_suite

This Windows Batchscript helps setup a Mingw-w64 compiler environment for building ffmpeg and other media tools under Windows.
GNU General Public License v3.0
1.51k stars 262 forks source link

vulkan-loader fails to build #2455

Closed Fishman0919 closed 1 year ago

Fishman0919 commented 1 year ago

21:56:46 ┌ vulkan-loader git ........................ [Recently updated] 21:56:46 ├ Running uninstall... 0001-loader-cross-compile-static-linking-hacks.patch Patch could not be applied with git am. Continuing without patching. 21:56:48 ├ Running dependencies... 21:57:00 ├ Installing Vulkan-Headers... 21:57:00 ├ Running uninstall... 21:57:00 ├ Running cmake... 21:57:00 ├ Running build... 21:57:01 ├ Running install... 21:57:02 ├ Building Vulkan-Loader... 21:57:02 ├ Running cmake... 21:57:04 ├ Running build... Likely error (tail of the failed operation logfile): ninja: fatal: GetOverlappedResult: The handle is invalid.

FAILED: loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj ml -IC:/MAS/build/vulkan-loader-git/build-64bit/loader -IC:/MAS/local64/include -c -Fo loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj C:/MAS/build/vulkan-loader-git/loader/unknown_ext_chain_masm.asm CreateProcess failed: The system cannot find the file specified. [1/21] Building ASM_MASM object loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj FAILED: loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj ml -IC:/MAS/build/vulkan-loader-git/build-64bit/loader -IC:/MAS/local64/include -c -Fo loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj C:/MAS/build/vulkan-loader-git/loader/unknown_ext_chain_masm.asm CreateProcess failed: The system cannot find the file specified. ninja: build stopped: subcommand failed. build failed. Check C:/MAS/build/vulkan-loader-git/build-64bit/ab-suite.build.log This is required for other packages, so this script will exit. 21:57:06 Creating diagnostics file... logs.zip

LigH-de commented 1 year ago

Confirming.

hydra3333 commented 1 year ago

me too.

always had a lot of trouble over time with khronos stuff breaking builds, so much so I gave up on opencl icd loader.

LigH-de commented 1 year ago

Embarrassing reason:

[1/24] Building C object loader/CMakeFiles/asm_offset.dir/asm_offset.c.obj
In file included from G:/MABS/build/vulkan-loader-git/loader/vk_loader_platform.h:34,
                 from G:/MABS/build/vulkan-loader-git/loader/loader_common.h:37,
                 from G:/MABS/build/vulkan-loader-git/loader/asm_offset.c:26:
G:/MABS/msys64/mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
   15 | #warning Please include winsock2.h before windows.h
      |  ^~~~~~~
FT129 commented 1 year ago

Had to bypass the error by setting vulkan loader to an older version SOURCE_REPO_VULKANLOADER=https://github.com/KhronosGroup/Vulkan-Loader.git#branch=sdk-1.3.250 in media-suite_deps.sh

LigH-de commented 1 year ago

We could test if the winsock2.h header is obsolete and could be removed from vk_loader_platform.h:

https://github.com/charles-lunarg/Vulkan-Loader/tree/remove_winsock2

I guess this means to try this in media-suite_deps.sh:

SOURCE_REPO_VULKANLOADER=https://github.com/charles-lunarg/Vulkan-Loader.git#branch=remove_winsock2

Correct?

LigH-de commented 1 year ago

That skips one error but still ends at another.

[4/24] Building ASM_MASM object loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj
ninja: fatal: GetOverlappedResult: Das Handle ist ungültig. {Invalid handle}

FAILED: loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj 
ml  -IG:/MABS/build/vulkan-loader-git/build-32bit/loader -IG:/MABS/local32/include  -c -Fo loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj G:/MABS/build/vulkan-loader-git/loader/unknown_ext_chain_masm.asm
CreateProcess failed: The system cannot find the file specified.
[1/21] Building ASM_MASM object loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj
FAILED: loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj 
ml  -IG:/MABS/build/vulkan-loader-git/build-32bit/loader -IG:/MABS/local32/include  -c -Fo loader/CMakeFiles/loader-unknown-chain.dir/unknown_ext_chain_masm.asm.obj G:/MABS/build/vulkan-loader-git/loader/unknown_ext_chain_masm.asm
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.
LigH-de commented 1 year ago

A new MinGW specific tools chain will be added.

LigH-de commented 1 year ago

... which should be compiled without assembler, if I understood correctly. There should be no performance bottlenecks, though. But at least we now see a direction.

diegocr commented 1 year ago

So.... where we do add -D USE_MASM=OFF ? :)

raddacle commented 1 year ago

I just had the same error. Whats the fix?

hydra3333 commented 1 year ago

temporarily ? see https://github.com/m-ab-s/media-autobuild_suite/issues/2455#issuecomment-1575386748 which LigH-de posted earlier.

raddacle commented 1 year ago

temporarily ? see #2455 (comment) which LigH-de posted earlier.

But they later say "That skips one error but still ends at another." It looks like it will succeed if I change it to an older version, per FT129's comment, right?

Fishman0919 commented 1 year ago

To fix it for me... I just re-downloaded the "media-autobuild_suite-master.zip" and replaced all the files back to original and success.

raddacle commented 1 year ago

I was building it for the first time yesterday from a fresh download, I'm not sure why that worked on your end...

LigH-de commented 1 year ago

So.... where we do add -D USE_MASM=OFF ? :)

I guess in line 1953 of build/media-suite_compile.sh:

     do_print_progress "Building Vulkan-Loader"
     CFLAGS+=" -DSTRSAFE_NO_DEPRECATE" do_cmakeinstall -DBUILD_TESTS=OFF -DUSE_CCACHE=OFF \
     -DUSE_UNSAFE_C_GEN=ON -DVULKAN_HEADERS_INSTALL_DIR="$LOCALDESTDIR" \
-    -DBUILD_STATIC_LOADER=ON -DUNIX=OFF -DENABLE_WERROR=OFF
+    -DBUILD_STATIC_LOADER=ON -DUNIX=OFF -DENABLE_WERROR=OFF -DUSE_MASM=OFF
     do_checkIfExist
     unset _DeadSix27 _mabs _shinchiro
 fi

Testing...


Yes, this way it builds the loader calls in C which is more compatible.

assy1204 commented 1 year ago

I added -DUSE_MASM=OFF and the vulkan-loader build completed, but the ffmpeg build gives an error.

┌ ffmpeg git ......................................... [Recently updated] ├ Changing options to comply to nonfree... ├ Compiling static FFmpeg... ├ Running configure... ├ Running make... Likely error (tail of the failed operation logfile): 79 | WINBASEAPI VOID WINAPI WakeConditionVariable (PCONDITION_VARIABLE ConditionVariable); | ~~~~^~~~~ D:/build_suite/build/ffmpeg-git/compat/w32pthreads.h: At top level: D:/build_suite/build/ffmpeg-git/compat/w32pthreads.h:186:19: error: static declaration of 'pthread_setcancelstate' follows non-static declaration 186 | static inline int pthread_setcancelstate(int state, int oldstate) | ^~~~~~ D:/build_suite/msys64/mingw64/include/pthread.h:302:26: note: previous declaration of 'pthread_setcancelstate' with type 'int(int, int )' 302 | int WINPTHREAD_API pthread_setcancelstate(int state, int *oldstate); | ^~~~~~ make: *** [/build/ffmpeg-git/ffbuild/common.mak:81: libavfilter/vulkan_glslang.o] Error 1

LigH-de commented 1 year ago

No issues here, and I built ffmpeg with vulkan support too. I will delete any vulkan and ffmpeg related libs and build directories and try again...


Everything built fine.

assy1204 commented 1 year ago

I have tried many times but it stops with the same error.

LigH-de commented 1 year ago

Let's try again with today's patch: https://github.com/m-ab-s/media-autobuild_suite/commit/7a0c93f89fbd938b67799887d9f3aa0704922f09


ffmpeg fails: ERROR: libplacebo >= 4.192.0 not found using pkg-config logs.zip

local32/lib/pkgconfig/libplacebo.pc

prefix=G:/MABS/local32
includedir=${prefix}/include
libdir=${prefix}/lib

pl_has_d3d11=1
pl_has_dovi=1
pl_has_gl_proc_addr=1
pl_has_glslang=0
pl_has_lcms=1
pl_has_libdovi=0
pl_has_opengl=1
pl_has_shaderc=1
pl_has_vk_proc_addr=1
pl_has_vulkan=1

Name: libplacebo
Description: Reusable library for GPU-accelerated video/image rendering
Version: 6.283.0
Requires: shaderc_combined >= 2019.1, spirv-cross >= 0.29.0, vulkan, lcms2 >= 2.9
Libs: -L${libdir} -lplacebo -lm -lshlwapi -lversion
Cflags: -I${includedir} -isystemG:/MABS/build/libplacebo-git/3rdparty/Vulkan-Headers/include -DPL_STATIC
assy1204 commented 1 year ago

me too ERROR: libplacebo >= 4.192.0 not found using pkg-config

porcino commented 1 year ago

^ Same error, is there a workaround?

Fishman0919 commented 1 year ago

^ Same error, is there a workaround?

yes... https://github.com/m-ab-s/media-autobuild_suite/issues/2455#issuecomment-1575353249

assy1204 commented 1 year ago

When will it be fixed?

LigH-de commented 1 year ago

Spare time developers have jobs and private lives, too... and sometimes way too demanding ones.

diegocr commented 1 year ago

@LigH-de

Let's try again with today's patch: https://github.com/m-ab-s/media-autobuild_suite/commit/7a0c93f89fbd938b67799887d9f3aa0704922f09
ffmpeg fails: ERROR: libplacebo >= 4.192.0 not found using pkg-config

Well, first of all let's thank the owners of repo (i.e. @1480c1) for fixing the former issue :-)

as per the new libplacebo issue... how was this fixed the last time it happened? I can still see this open: https://github.com/m-ab-s/media-autobuild_suite/issues/2399

Btw...

pl_has_libdovi=0

This libdovi support was added a couple of months ago to libplacebo, i think will be nice building with it:

https://packages.msys2.org/package/mingw-w64-x86_64-libdovi?repo=mingw64

diegocr commented 1 year ago

how was this fixed the last time it happened?

answering myself... https://github.com/m-ab-s/media-autobuild_suite/issues/2324#issuecomment-1317537372 👀

i.e. https://github.com/m-ab-s/mabs-patches/commit/f0384b3afe3c230f9389003c8823744f99dd7e67