From 1a4f54dd116b4bec3ec2cfee6a878ce438c2aa22 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Fri, 26 Sep 2025 16:01:43 +0800 Subject: [PATCH] update for cu13 builds (no ci will be provided) --- CMakeLists.txt | 5 ++++- Makefile | 6 ++++++ koboldcpp.sh | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14260fed0..5f912a9de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,7 +130,10 @@ if (LLAMA_CUBLAS) # 75 == int8 tensor cores # 80 == Ampere, asynchronous data loading, faster tensor core instructions message("CUDA Toolkit Version: ${CUDAToolkit_VERSION}") - if(CUDAToolkit_VERSION VERSION_GREATER 12) + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 13) + add_compile_definitions(GGML_CUDA_USE_GRAPHS) #try enable cuda graphs on cu12 build + set(CMAKE_CUDA_ARCHITECTURES "75-virtual;80-virtual;86-virtual") # lowest CUDA 13 standard + elseif(CUDAToolkit_VERSION VERSION_GREATER 12) add_compile_definitions(GGML_CUDA_USE_GRAPHS) #try enable cuda graphs on cu12 build set(CMAKE_CUDA_ARCHITECTURES "50-virtual;61-virtual;70-virtual;75-virtual;80-virtual") # lowest CUDA 12 standard + lowest for integer intrinsics else() diff --git a/Makefile b/Makefile index 62f34aa5e..5589523a6 100644 --- a/Makefile +++ b/Makefile @@ -231,6 +231,12 @@ NVCCFLAGS += -Wno-deprecated-gpu-targets \ -gencode arch=compute_75,code=compute_75 \ -gencode arch=compute_80,code=compute_80 +else ifdef LLAMA_ARCHES_CU13 +NVCCFLAGS += -Wno-deprecated-gpu-targets \ + -gencode arch=compute_75,code=compute_75 \ + -gencode arch=compute_80,code=compute_80 \ + -gencode arch=compute_86,code=compute_86 + else NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=all endif diff --git a/koboldcpp.sh b/koboldcpp.sh index dea916ad9..c7af72169 100755 --- a/koboldcpp.sh +++ b/koboldcpp.sh @@ -39,6 +39,9 @@ fi if [ -n "$ARCHES_CU12" ]; then ARCHES_FLAG="LLAMA_ARCHES_CU12=1" fi +if [ -n "$ARCHES_CU13" ]; then + ARCHES_FLAG="LLAMA_ARCHES_CU13=1" +fi if [ -n "$NO_WMMA" ]; then NO_WMMA_FLAG="LLAMA_NO_WMMA=1" fi