summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBach Le <bach@bullno1.com>2023-12-17 18:57:33 +0800
committerGitHub <noreply@github.com>2023-12-17 11:57:33 +0100
commit5daa5f54fdcd2b5228add1a4c43a1897b2168f35 (patch)
treeefeb6c1b469ba6cfed3403097486dc349e622a4b
parentc6c4fc081c1df1c60a9bfe3e6a3fd086f1a29ec7 (diff)
Link to cublas dynamically on Windows even with LLAMA_STATIC (#4506)
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57b43c13..e3cd43ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -291,7 +291,12 @@ if (LLAMA_CUBLAS)
add_compile_definitions(GGML_CUDA_PEER_MAX_BATCH_SIZE=${LLAMA_CUDA_PEER_MAX_BATCH_SIZE})
if (LLAMA_STATIC)
- set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} CUDA::cudart_static CUDA::cublas_static CUDA::cublasLt_static)
+ if (WIN32)
+ # As of 12.3.1 CUDA Tookit for Windows does not offer a static cublas library
+ set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} CUDA::cudart_static CUDA::cublas CUDA::cublasLt)
+ else ()
+ set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} CUDA::cudart_static CUDA::cublas_static CUDA::cublasLt_static)
+ endif()
else()
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} CUDA::cudart CUDA::cublas CUDA::cublasLt)
endif()