Skip to content

Compile bug: macOS Vulkan build fails #10923

@soerenkampschroer

Description

@soerenkampschroer

Git commit

eb5c3dc

Operating systems

Mac

GGML backends

Vulkan

Problem description & steps to reproduce

The build process fails with errors in ggml_vk_host_get.

First Bad Commit

No response

Relevant log output

❯ cmake -B build -DGGML_METAL=OFF -DGGML_VULKAN=1
-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - 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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/local/bin/git (found version "2.47.1")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- Including CPU backend
-- Accelerate framework found
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
CMake Warning at ggml/src/ggml-cpu/CMakeLists.txt:53 (message):
  OpenMP not found
Call Stack (most recent call first):
  ggml/src/CMakeLists.txt:298 (ggml_add_cpu_backend_variant_impl)


-- x86 detected
-- Adding CPU backend variant ggml-cpu: -march=native
-- Looking for dgemm_
-- Looking for dgemm_ - found
-- Found BLAS: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/Accelerate.framework
-- BLAS found, Libraries: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/Accelerate.framework
-- BLAS found, Includes:
-- Including BLAS backend
-- Found Vulkan: /usr/local/lib/libvulkan.dylib (found version "1.4.303") found components: glslc glslangValidator
-- Vulkan found
-- GL_NV_cooperative_matrix2 supported by glslc
-- Including Vulkan backend
-- Configuring done (2.4s)
-- Generating done (0.7s)
-- Build files have been written to: /Users/soeren/Documents/Projects/llama.cpp/build


❯ cmake --build build --config Release
[  1%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml.c.o
[  1%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-alloc.c.o
[  2%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-backend.cpp.o
[  2%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-opt.cpp.o
[  3%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-threading.cpp.o
[  3%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-quants.c.o
[  4%] Linking CXX shared library libggml-base.dylib
[  4%] Built target ggml-base
[  4%] Building CXX object ggml/src/ggml-vulkan/vulkan-shaders/CMakeFiles/vulkan-shaders-gen.dir/vulkan-shaders-gen.cpp.o
[  5%] Linking CXX executable ../../../../bin/vulkan-shaders-gen
[  5%] Built target vulkan-shaders-gen
[  6%] Generate vulkan shaders
ggml_vulkan: Generating and compiling shaders to SPIR-V
[  6%] Building CXX object ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/ggml-vulkan.cpp.o
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:1368:2: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-extra-semi]
 1368 | };
      |  ^
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:4777:9: error: no matching function for call to 'ggml_vk_host_get'
 4777 |         ggml_vk_host_get(ctx->device, q->data, d_Q, q_buf_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:4778:9: error: no matching function for call to 'ggml_vk_host_get'
 4778 |         ggml_vk_host_get(ctx->device, k->data, d_K, q_buf_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:4779:9: error: no matching function for call to 'ggml_vk_host_get'
 4779 |         ggml_vk_host_get(ctx->device, v->data, d_V, q_buf_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:4780:9: error: no matching function for call to 'ggml_vk_host_get'
 4780 |         ggml_vk_host_get(ctx->device, dst->data, d_D, q_buf_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:4786:13: error: no matching function for call to 'ggml_vk_host_get'
 4786 |             ggml_vk_host_get(ctx->device, mask->data, d_M, q_buf_offset);
      |             ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:5482:9: error: no matching function for call to 'ggml_vk_host_get'
 5482 |         ggml_vk_host_get(ctx->device, k->data, d_K, k_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:5483:9: error: no matching function for call to 'ggml_vk_host_get'
 5483 |         ggml_vk_host_get(ctx->device, v->data, d_V, v_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:5484:9: error: no matching function for call to 'ggml_vk_host_get'
 5484 |         ggml_vk_host_get(ctx->device, r->data, d_R, r_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:5485:9: error: no matching function for call to 'ggml_vk_host_get'
 5485 |         ggml_vk_host_get(ctx->device, tf->data, d_TF, tf_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:5486:9: error: no matching function for call to 'ggml_vk_host_get'
 5486 |         ggml_vk_host_get(ctx->device, td->data, d_TD, td_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:5487:9: error: no matching function for call to 'ggml_vk_host_get'
 5487 |         ggml_vk_host_get(ctx->device, state->data, d_State, state_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:5488:9: error: no matching function for call to 'ggml_vk_host_get'
 5488 |         ggml_vk_host_get(ctx->device, dst->data, d_D, dst_offset);
      |         ^~~~~~~~~~~~~~~~
/Users/soeren/Documents/Projects/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:3095:13: note: candidate function not viable: no known conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t &' (aka 'unsigned long &') for 4th argument
 3095 | static void ggml_vk_host_get(vk_device& device, const void * ptr, vk_buffer& buf, size_t& buf_offset) {
      |             ^                                                                     ~~~~~~~~~~~~~~~~~~
1 warning and 12 errors generated.
make[2]: *** [ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/ggml-vulkan.cpp.o] Error 1
make[1]: *** [ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/all] Error 2
make: *** [all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    VulkanIssues specific to the Vulkan backendbugSomething isn't workingbuildCompilation issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions