Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile bug: can't build with MSVC + Vulkan #11788

Closed
foldl opened this issue Feb 10, 2025 · 7 comments
Closed

Compile bug: can't build with MSVC + Vulkan #11788

foldl opened this issue Feb 10, 2025 · 7 comments

Comments

@foldl
Copy link
Contributor

foldl commented Feb 10, 2025

Git commit

git rev-parse HEAD
d7b31a9d84297b493a61c9a8ee3a458e7ccc64a7

Operating systems

Windows

GGML backends

Vulkan

Problem description & steps to reproduce

I'm trying to build with MSVC + Vulkan:

cmake -B build-vulkan -DGGML_VULKAN=1
cmake --build build-vulkan --config Release

CMake log about Vulkan:

-- Vulkan found
-- GL_KHR_cooperative_matrix supported by glslc
-- GL_NV_cooperative_matrix2 not supported by glslc
-- Including Vulkan backend

Lots of undefined identifiers when building:

llama.cpp\ggml-vulkan\ggml-vulkan.cpp(1732,13): error C2065: “matmul_iq2_xxs_f32_f16acc_coopmat_len”: ...
llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1732,13): error C2065: “matmul_iq2_xxs_f32_f16acc_coopmat_data”: ...
llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1732,13): error C2065: “matmul_iq2_xxs_f32_aligned_f16acc_coopmat_len”: ...

First Bad Commit

b685daf

Compile command

cmake -B build-vulkan -DGGML_VULKAN=1
cmake --build build-vulkan --config Release

Relevant log output

Lots of undefined identifiers when building commit b685daf3867c54e42a9db484d7b92619021d4510:


llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1923,90): error C2065: “rope_norm_f16_rte_len”: ...
@jeffbolznv
Copy link
Collaborator

Please try installing the latest vulkan sdk, and if it still fails attach a complete log for a clean build.

@foldl
Copy link
Contributor Author

foldl commented Feb 10, 2025

Updated to VulkanSDK-1.4.304.1, there are still lots of undefined identifiers:

ggml\src\ggml-vulkan\ggml-vulkan.cpp(1613,9): error C2065: “flash_attn_f32_f16_f16_f16acc_cm2_len”: ...
...

@jeffbolznv
Copy link
Collaborator

Please share a complete log for a clean build (like delete the whole build folder, to avoid any cmake caching).

@foldl
Copy link
Contributor Author

foldl commented Feb 15, 2025

@jeffbolznv full log (commit 89daa25).

cmake -B build-vulkan -DGGML_VULKAN=1

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.26100.
-- The C compiler identification is MSVC 19.41.34120.0
-- The CXX compiler identification is MSVC 19.41.34120.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: C:/Programs/Git/cmd/git.exe (found version "2.40.0.windows.1") 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE  
-- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF.
-- CMAKE_SYSTEM_PROCESSOR: AMD64
-- CMAKE_GENERATOR_PLATFORM: 
-- Including CPU backend
-- Found OpenMP_C: -openmp (found version "2.0") 
-- Found OpenMP_CXX: -openmp (found version "2.0") 
-- Found OpenMP: TRUE (found version "2.0")  
-- x86 detected
-- Performing Test HAS_AVX_1
-- Performing Test HAS_AVX_1 - Success
-- Performing Test HAS_AVX2_1
-- Performing Test HAS_AVX2_1 - Success
-- Performing Test HAS_FMA_1
-- Performing Test HAS_FMA_1 - Success
-- Performing Test HAS_AVX512_1
-- Performing Test HAS_AVX512_1 - Success
-- Adding CPU backend variant ggml-cpu: /arch:AVX512 GGML_AVX512
-- Found Vulkan: C:/VulkanSDK/1.4.304.1/Lib/vulkan-1.lib (found version "1.4.304") found components: glslc glslangValidator 
-- Vulkan found
-- GL_KHR_cooperative_matrix supported by glslc
-- GL_NV_cooperative_matrix2 supported by glslc
-- Including Vulkan backend
-- Configuring done (22.0s)
-- Generating done (0.6s)
-- Build files have been written to: C:/projects/llama.cpp/build-vulkan

cmake --build build-vulkan --config Release -j8

.NET Framework MSBuild Version 17.11.2+c078802d4

  Checking Build System
  Building Custom Rule C:/projects/llama.cpp/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt
  Building Custom Rule C:/projects/llama.cpp/ggml/src/CMakeLists.txt
  Building Custom Rule C:/projects/llama.cpp/examples/gguf-hash/CMakeLists.txt
  Generating build details from Git
  Building Custom Rule C:/projects/llama.cpp/examples/gguf-hash/CMakeLists.txt
  Building Custom Rule C:/projects/llama.cpp/examples/gguf-hash/CMakeLists.txt
  vulkan-shaders-gen.cpp
  -- Found Git: C:/Programs/Git/cmd/git.exe (found version "2.40.0.windows.1") 
  xxhash.c
  sha1.c
  ggml.c
  sha256.c
  Building Custom Rule C:/projects/llama.cpp/common/CMakeLists.txt
  ggml-alloc.c
  build-info.cpp
  ggml-quants.c
  sha1.vcxproj -> C:\projects\llama.cpp\build-vulkan\examples\gguf-hash\sha1.dir\Release\sha1.lib
  sha256.vcxproj -> C:\projects\llama.cpp\build-vulkan\examples\gguf-hash\sha256.dir\Release\sha256.lib
  Generating Code...
C:\projects\llama.cpp\ggml\src\ggml.c(1955,26): warning C4267: 'initializing': conversion from 'size_t' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(1955,31): warning C4267: 'initializing': conversion from 'size_t' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(1955,36): warning C4267: 'initializing': conversion from 'size_t' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(1955,41): warning C4267: 'initializing': conversion from 'size_t' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(2839,26): warning C4267: 'initializing': conversion from 'size_t' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(2839,31): warning C4267: 'initializing': conversion from 'size_t' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(2839,36): warning C4267: 'initializing': conversion from 'size_t' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(2839,41): warning C4267: 'initializing': conversion from 'size_t' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3227,22): warning C4244: '=': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3228,22): warning C4244: '=': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3229,22): warning C4244: '=': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3230,22): warning C4244: '=': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3232,22): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3233,22): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3234,22): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3235,22): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3874,48): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3906,52): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3980,41): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3980,51): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3989,51): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(3989,65): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(4050,35): warning C4244: 'return': conversion from 'float' to 'int64_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(4063,54): warning C4244: 'function': conversion from 'int' to 'float', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(4100,46): warning C4244: 'initializing': conversion from 'float' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]       
C:\projects\llama.cpp\ggml\src\ggml.c(4100,50): warning C4244: 'initializing': conversion from 'float' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]       
C:\projects\llama.cpp\ggml\src\ggml.c(4123,46): warning C4244: 'initializing': conversion from 'float' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]       
C:\projects\llama.cpp\ggml\src\ggml.c(4123,50): warning C4244: 'initializing': conversion from 'float' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]       
C:\projects\llama.cpp\ggml\src\ggml.c(4159,47): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(4159,72): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(4159,93): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(4159,103): warning C4244: 'function': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml.c(4530,36): warning C4244: 'initializing': conversion from 'int64_t' to 'const int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]   
C:\projects\llama.cpp\ggml\src\ggml.c(4531,36): warning C4244: 'initializing': conversion from 'int64_t' to 'const int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]   
C:\projects\llama.cpp\ggml\src\ggml.c(5667,108): warning C4244: 'function': conversion from 'const int32_t' to 'float', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]    
C:\projects\llama.cpp\ggml\src\ggml.c(5667,112): warning C4244: 'function': conversion from 'const int32_t' to 'float', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]    
C:\projects\llama.cpp\ggml\src\ggml.c(5945,29): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\assert.h(21,9): warning C4005: 'static_assert': macro redefinition [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
  (compiling source file '../../../ggml/src/ggml-quants.c')
      C:\projects\llama.cpp\ggml\src\ggml-common.h(79,9):
      see previous definition of 'static_assert'

  build_info.vcxproj -> C:\projects\llama.cpp\build-vulkan\common\build_info.dir\Release\build_info.lib
  xxhash.vcxproj -> C:\projects\llama.cpp\build-vulkan\examples\gguf-hash\xxhash.dir\Release\xxhash.lib
  ggml-backend.cpp
  ggml-opt.cpp
C:\projects\llama.cpp\ggml\src\ggml-opt.cpp(599,77): warning C4244: 'argument': conversion from 'int64_t' to 'float', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-opt.cpp(600,77): warning C4244: 'argument': conversion from 'int64_t' to 'float', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-opt.cpp(810,30): warning C4244: '=': conversion from 'const int64_t' to 'int32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]     
  ggml-threading.cpp
  gguf.cpp
C:\projects\llama.cpp\ggml\src\gguf.cpp(457,48): warning C4244: 'initializing': conversion from 'int64_t' to 'int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\gguf.cpp(457,33): warning C4244: 'initializing': conversion from 'int64_t' to 'const int', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
C:\projects\llama.cpp\ggml\src\gguf.cpp(592,21): warning C4267: 'argument': conversion from 'size_t' to 'long', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-base.vcxproj]
  vulkan-shaders-gen.vcxproj -> C:\projects\llama.cpp\build-vulkan\bin\vulkan-shaders-gen.exe
  Generating Code...
     Creating library C:/projects/llama.cpp/build-vulkan/ggml/src/Release/ggml-base.lib and object C:/projects/llama.cpp/build-vulkan/ggml/src/Release/ggml-base.exp
  ggml-base.vcxproj -> C:\projects\llama.cpp\build-vulkan\bin\Release\ggml-base.dll
  Building Custom Rule C:/projects/llama.cpp/ggml/src/CMakeLists.txt
  Generate vulkan shaders
  ggml_vulkan: Generating and compiling shaders to SPIR-V
  ggml-cpu.c
  ggml-cpu.cpp
  ggml-cpu-aarch64.cpp
  ggml-cpu-hbm.cpp
  ggml-cpu-traits.cpp
  amx.cpp
  mmq.cpp
  sgemm.cpp
  Generating Code...
  ggml-cpu-quants.c
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\assert.h(21,9): warning C4005: 'static_assert': macro redefinition [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-cpu.vcxproj]
  (compiling source file '../../../ggml/src/ggml-cpu/ggml-cpu-quants.c')
      C:\projects\llama.cpp\ggml\src\ggml-common.h(79,9):
      see previous definition of 'static_assert'

     Creating library C:/projects/llama.cpp/build-vulkan/ggml/src/Release/ggml-cpu.lib and object C:/projects/llama.cpp/build-vulkan/ggml/src/Release/ggml-cpu.exp
  ggml-cpu.vcxproj -> C:\projects\llama.cpp\build-vulkan\bin\Release\ggml-cpu.dll
  Building Custom Rule C:/projects/llama.cpp/ggml/src/ggml-vulkan/CMakeLists.txt
  ggml-vulkan.cpp
  ggml-vulkan-shaders.cpp
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(824,48): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\g
gml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(825,46): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\g
gml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(830,36): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-v 
ulkan\ggml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(932,27): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\gg 
ml-vulkan\ggml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(934,27): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\gg 
ml-vulkan\ggml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1075,52): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\g 
gml-vulkan\ggml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1075,27): warning C4267: 'initializing': conversion from 'size_t' to 'const uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml 
\src\ggml-vulkan\ggml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1087,20): warning C4267: 'return': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vu 
lkan\ggml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1094,20): warning C4267: 'return': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vu 
lkan\ggml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1101,20): warning C4267: 'return': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vu 
lkan\ggml-vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1614,9): error C2065: 'flash_attn_f32_f16_f16_f16acc_cm2_len': undeclared identifier [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\ggml-vu 
lkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1614,9): error C2065: 'flash_attn_f32_f16_f16_f16acc_cm2_data': undeclared identifier [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\ggml-v 
ulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1614,9): error C2065: 'flash_attn_f32_f16_f16_cm2_len': undeclared identifier [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\ggml-vulkan.vc 
xproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1614,9): error C2065: 'flash_attn_f32_f16_f16_cm2_data': undeclared identifier [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\ggml-vulkan.v 
cxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1615,9): error C2065: 'flash_attn_f32_f16_q4_0_f16acc_cm2_len': undeclared identifier [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\ggml-v 
ulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1615,9): error C2065: 'flash_attn_f32_f16_q4_0_f16acc_cm2_data': undeclared identifier [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\ggml- 
vulkan.vcxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1615,9): error C2065: 'flash_attn_f32_f16_q4_0_cm2_len': undeclared identifier [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\ggml-vulkan.v 
cxproj]
C:\projects\llama.cpp\ggml\src\ggml-vulkan\ggml-vulkan.cpp(1615,9): error C1003: error count exceeds 100; stopping compilation [C:\projects\llama.cpp\build-vulkan\ggml\src\ggml-vulkan\ggml-vulkan.vcxproj]     

@jeffbolznv
Copy link
Collaborator

I tried with a clean tree and same commit and build steps, and haven't been able to reproduce it. It seems like GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT is not getting set during the shader generation, but there's nothing in the log to indicate why that might happen.

@jeffbolznv
Copy link
Collaborator

It's a longshot, but please check if https://github.com/jeffbolznv/llama.cpp/tree/glslc_mismatch helps.

@foldl
Copy link
Contributor Author

foldl commented Feb 17, 2025

This is because the generated ggml-vulkan-shaders.cpp/hpp is moved from ggml/src/ggml-vulkan to CMAKE_DIR/ggml/src/ggml-vulkan. Unfortunately, in my case, after updating the repo, the elder version of ggml-vulkan-shaders.cpp/hpp are still there in ggml/src/ggml-vulkan, so, the newly generated .hpp is not use. A clean build would not help.

Just delete ggml-vulkan-shaders.cpp/hpp in ggml/src/ggml-vulkan. Case resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants