]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
cuda: Add cublasLt_static linking when GGML_STATIC is enabled (llama/15622)
authormatiaslin <redacted>
Thu, 28 Aug 2025 00:32:36 +0000 (17:32 -0700)
committerGeorgi Gerganov <redacted>
Fri, 5 Sep 2025 09:54:06 +0000 (12:54 +0300)
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.

src/ggml-cuda/CMakeLists.txt

index ea824965aae2d17bd1faeb6b422b3e54dd7a6141..d3dfc7807de0e3351601ebd36d900042a664b7f3 100644 (file)
@@ -94,7 +94,11 @@ if (CUDAToolkit_FOUND)
             # As of 12.3.1 CUDA Toolkit for Windows does not offer a static cublas library
             target_link_libraries(ggml-cuda PRIVATE CUDA::cudart_static CUDA::cublas)
         else ()
-            target_link_libraries(ggml-cuda PRIVATE  CUDA::cudart_static CUDA::cublas_static)
+            if (CUDAToolkit_VERSION VERSION_GREATER_EQUAL "10.1")
+                target_link_libraries(ggml-cuda PRIVATE  CUDA::cudart_static CUDA::cublas_static CUDA::cublasLt_static)
+            else()
+                target_link_libraries(ggml-cuda PRIVATE  CUDA::cudart_static CUDA::cublas_static)
+            endif()
         endif()
     else()
         target_link_libraries(ggml-cuda PRIVATE CUDA::cudart CUDA::cublas)