From: Radoslav Gerganov Date: Mon, 13 Jan 2025 11:31:41 +0000 (+0200) Subject: ggml : do not define GGML_USE_CUDA when building with GGML_BACKEND_DL (llama/11211) X-Git-Tag: upstream/0.0.1642~8 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ac76d16d0c6f07341a27a7ce2c81df85ef92e278;p=pkg%2Fggml%2Fsources%2Fggml ggml : do not define GGML_USE_CUDA when building with GGML_BACKEND_DL (llama/11211) Build fails when using HIP and GGML_BACKEND_DL: ``` /usr/bin/ld: ../ggml/src/libggml.so: undefined reference to `ggml_backend_cuda_reg' collect2: error: ld returned 1 exit status ``` This patch fixes this. --- diff --git a/src/ggml-hip/CMakeLists.txt b/src/ggml-hip/CMakeLists.txt index b15fbd24..d090ba9b 100644 --- a/src/ggml-hip/CMakeLists.txt +++ b/src/ggml-hip/CMakeLists.txt @@ -70,7 +70,9 @@ ggml_add_backend_library(ggml-hip ) # TODO: do not use CUDA definitions for HIP -target_compile_definitions(ggml PUBLIC GGML_USE_CUDA) +if (NOT GGML_BACKEND_DL) + target_compile_definitions(ggml PUBLIC GGML_USE_CUDA) +endif() add_compile_definitions(GGML_USE_HIP)