Skip to content

Commit 5a0e3ef

Browse files
authored
cuda: Add cublasLt_static linking when GGML_STATIC is enabled (ggml-org#15622)
Prior to this change, we faced undefined cublasLt references when attempting to compile 'llama-cli' with GGML_STATIC=ON on Linux. We add linking with CUDA::cublasLt_static when CUDA version is greater than 10.1.
1 parent fbef0fa commit 5a0e3ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ggml/src/ggml-cuda/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ if (CUDAToolkit_FOUND)
9494
# As of 12.3.1 CUDA Toolkit for Windows does not offer a static cublas library
9595
target_link_libraries(ggml-cuda PRIVATE CUDA::cudart_static CUDA::cublas)
9696
else ()
97-
target_link_libraries(ggml-cuda PRIVATE CUDA::cudart_static CUDA::cublas_static)
97+
if (CUDAToolkit_VERSION VERSION_GREATER_EQUAL "10.1")
98+
target_link_libraries(ggml-cuda PRIVATE CUDA::cudart_static CUDA::cublas_static CUDA::cublasLt_static)
99+
else()
100+
target_link_libraries(ggml-cuda PRIVATE CUDA::cudart_static CUDA::cublas_static)
101+
endif()
98102
endif()
99103
else()
100104
target_link_libraries(ggml-cuda PRIVATE CUDA::cudart CUDA::cublas)

0 commit comments

Comments
 (0)