Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
Add compute capability 5.0, 7.5, and 8.0
Daniel Hiltgena447a083f216
diff --git a/docs/development.md b/docs/development.mdindex 5369f5a8a..04599f6c9 100644--- a/docs/development.md+++ b/docs/development.md@@ -50,7 +50,8 @@ development and runtime packages.Typically the build scripts will auto-detect CUDA, however, if your Linux distroor installation approach uses unusual paths, you can specify the location byspecifying an environment variable `CUDA_LIB_DIR` to the location of the shared-libraries, and `CUDACXX` to the location of the nvcc compiler.+libraries, and `CUDACXX` to the location of the nvcc compiler. You can customize+set set of target CUDA architectues by setting `CMAKE_CUDA_ARCHITECTURES` (e.g. "50;60;70")Then generate dependencies:diff --git a/gpu/gpu.go b/gpu/gpu.goindex 06d022fe2..61821b5d6 100644--- a/gpu/gpu.go+++ b/gpu/gpu.go@@ -29,9 +29,8 @@ type handles struct {var gpuMutex sync.Mutexvar gpuHandles *handles = nil-// With our current CUDA compile flags, older than 5.2 will not work properly-// 5.0: CUDA error: no kernel image is available for execution on the device-var CudaComputeMin = [2]C.int{5, 2}+// With our current CUDA compile flags, older than 5.0 will not work properly+var CudaComputeMin = [2]C.int{5, 0}// Possible locations for the nvidia-ml libraryvar CudaLinuxGlobs = []string{diff --git a/llm/generate/gen_common.sh b/llm/generate/gen_common.shindex d1e64d7df..4762e1855 100644--- a/llm/generate/gen_common.sh+++ b/llm/generate/gen_common.sh@@ -39,6 +39,9 @@ init_vars() {*);;esac+ if [ -z "${CMAKE_CUDA_ARCHITECTURES}" ] ; then+ CMAKE_CUDA_ARCHITECTURES="50;52;61;70;75;80"+ fi}git_module_setup() {diff --git a/llm/generate/gen_linux.sh b/llm/generate/gen_linux.shindex f00d717cb..507c54c81 100755--- a/llm/generate/gen_linux.sh+++ b/llm/generate/gen_linux.sh@@ -125,7 +125,7 @@ if [ -d "${CUDA_LIB_DIR}" ]; thenif [ -n "${CUDA_MAJOR}" ]; thenCUDA_VARIANT=_v${CUDA_MAJOR}fi- CMAKE_DEFS="-DLLAMA_CUBLAS=on -DLLAMA_CUDA_FORCE_MMQ=on ${COMMON_CMAKE_DEFS} ${CMAKE_DEFS}"+ CMAKE_DEFS="-DLLAMA_CUBLAS=on -DLLAMA_CUDA_FORCE_MMQ=on -DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES} ${COMMON_CMAKE_DEFS} ${CMAKE_DEFS}"BUILD_DIR="${LLAMACPP_DIR}/build/linux/${ARCH}/cuda${CUDA_VARIANT}"EXTRA_LIBS="-L${CUDA_LIB_DIR} -lcudart -lcublas -lcublasLt -lcuda"builddiff --git a/llm/generate/gen_windows.ps1 b/llm/generate/gen_windows.ps1index 109b86029..e7fac03a9 100644--- a/llm/generate/gen_windows.ps1+++ b/llm/generate/gen_windows.ps1@@ -25,6 +25,11 @@ function init_vars {}$script:GZIP=(get-command -ea 'silentlycontinue' gzip).path$script:DUMPBIN=(get-command -ea 'silentlycontinue' dumpbin).path+ if ($null -eq $env:CMAKE_CUDA_ARCHITECTURES) {+ $script:CMAKE_CUDA_ARCHITECTURES="50;52;61;70;75;80"+ } else {+ $script:CMAKE_CUDA_ARCHITECTURES=$env:CMAKE_CUDA_ARCHITECTURES+ }}function git_module_setup {@@ -128,7 +133,7 @@ if ($null -ne $script:CUDA_LIB_DIR) {}init_vars$script:buildDir="${script:llamacppDir}/build/windows/${script:ARCH}/cuda$script:CUDA_VARIANT"- $script:cmakeDefs += @("-DLLAMA_CUBLAS=ON", "-DLLAMA_AVX=on")+ $script:cmakeDefs += @("-DLLAMA_CUBLAS=ON", "-DLLAMA_AVX=on", "-DCMAKE_CUDA_ARCHITECTURES=${script:CMAKE_CUDA_ARCHITECTURES}")buildinstallcp "${script:CUDA_LIB_DIR}/cudart64_*.dll" "${script:buildDir}/lib"