Skip to content

Build errors with Vulkan on Mac #5304

Closed
@dokterbob

Description

@dokterbob

Trying to build with Vulkan on Intel Mac (to use AMD GPU), getting the following build errors on 52bb63c:

drbob@seahorse build % cmake .. -DLLAMA_VULKAN=1 -DLLAMA_METAL=OFF 
drbob@seahorse build % cmake --build . --config Release
[  1%] Building CXX object CMakeFiles/ggml-vulkan.dir/ggml-vulkan.cpp.o
[  1%] Built target ggml-vulkan
[  2%] Building C object CMakeFiles/ggml.dir/ggml.c.o
/Users/drbob/Development/llama.cpp/ggml.c:1273:5: warning: implicit conversion increases floating-point precision: 'float' to 'ggml_float' (aka 'double') [-Wdouble-promotion]
    GGML_F16_VEC_REDUCE(sumf, sum);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/drbob/Development/llama.cpp/ggml.c:905:37: note: expanded from macro 'GGML_F16_VEC_REDUCE'
#define GGML_F16_VEC_REDUCE         GGML_F32Cx8_REDUCE
                                    ^
/Users/drbob/Development/llama.cpp/ggml.c:895:33: note: expanded from macro 'GGML_F32Cx8_REDUCE'
#define GGML_F32Cx8_REDUCE      GGML_F32x8_REDUCE
                                ^
/Users/drbob/Development/llama.cpp/ggml.c:841:11: note: expanded from macro 'GGML_F32x8_REDUCE'
    res = _mm_cvtss_f32(_mm_hadd_ps(t1, t1));                     \
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/drbob/Development/llama.cpp/ggml.c:1321:9: warning: implicit conversion increases floating-point precision: 'float' to 'ggml_float' (aka 'double') [-Wdouble-promotion]
        GGML_F16_VEC_REDUCE(sumf[k], sum[k]);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/drbob/Development/llama.cpp/ggml.c:905:37: note: expanded from macro 'GGML_F16_VEC_REDUCE'
#define GGML_F16_VEC_REDUCE         GGML_F32Cx8_REDUCE
                                    ^
/Users/drbob/Development/llama.cpp/ggml.c:895:33: note: expanded from macro 'GGML_F32Cx8_REDUCE'
#define GGML_F32Cx8_REDUCE      GGML_F32x8_REDUCE
                                ^
/Users/drbob/Development/llama.cpp/ggml.c:841:11: note: expanded from macro 'GGML_F32x8_REDUCE'
    res = _mm_cvtss_f32(_mm_hadd_ps(t1, t1));                     \
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/drbob/Development/llama.cpp/ggml.c:2346:9: error: call to undeclared function 'ggml_vk_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        ggml_vk_init();
        ^
/Users/drbob/Development/llama.cpp/ggml.c:14850:27: error: call to undeclared function 'ggml_vk_compute_forward'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    const bool skip_cpu = ggml_vk_compute_forward(params, tensor);
                          ^
/Users/drbob/Development/llama.cpp/ggml.c:14850:27: note: did you mean 'ggml_compute_forward'?
/Users/drbob/Development/llama.cpp/ggml.c:14835:13: note: 'ggml_compute_forward' declared here
static void ggml_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor) {
            ^
/Users/drbob/Development/llama.cpp/ggml.c:17269:9: error: call to undeclared function 'ggml_vk_preallocate_buffers_graph'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        ggml_vk_preallocate_buffers_graph(cgraph->nodes[i]);
        ^
/Users/drbob/Development/llama.cpp/ggml.c:17271:5: error: call to undeclared function 'ggml_vk_preallocate_buffers'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    ggml_vk_preallocate_buffers();
    ^
/Users/drbob/Development/llama.cpp/ggml.c:17274:9: error: call to undeclared function 'ggml_vk_build_graph'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        ggml_vk_build_graph(cgraph->nodes[i], i == cgraph->n_nodes - 1);
        ^
/Users/drbob/Development/llama.cpp/ggml.c:17330:5: error: call to undeclared function 'ggml_vk_graph_cleanup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    ggml_vk_graph_cleanup();
    ^
/Users/drbob/Development/llama.cpp/ggml.c:17330:5: note: did you mean 'ggml_graph_clear'?
/Users/drbob/Development/llama.cpp/ggml.c:16511:6: note: 'ggml_graph_clear' declared here
void ggml_graph_clear(struct ggml_cgraph * cgraph) {
     ^
2 warnings and 6 errors generated.
make[2]: *** [CMakeFiles/ggml.dir/ggml.c.o] Error 1
make[1]: *** [CMakeFiles/ggml.dir/all] Error 2
make: *** [all] Error 2

Vulkan SDK version: 1.3.275

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions