Skip to content

Commit

Permalink
ggml : do not define GGML_USE_CUDA when building with GGML_BACKEND_DL (
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
rgerganov authored Jan 13, 2025
1 parent 924518e commit 1244cdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ggml/src/ggml-hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 1244cdc

Please sign in to comment.