summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex <awhill19@icloud.com>2023-10-22 15:56:53 -0400
committerGitHub <noreply@github.com>2023-10-22 22:56:53 +0300
commit96981f37b1e3f450d9e63e571514217bf60f0a7f (patch)
tree2c09acb1219bcae7385ee9adb97a43989820d264
parent438c2ca83045a00ef244093d27e9ed41a8cb4ea9 (diff)
make : add optional CUDA_NATIVE_ARCH (#2482)
Use the environment variable `CUDA_NATIVE_ARCH` if present to set NVCC arch. Otherwise, use `native`.
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 80179631..705c4acb 100644
--- a/Makefile
+++ b/Makefile
@@ -391,9 +391,12 @@ else
endif #LLAMA_CUDA_NVCC
ifdef CUDA_DOCKER_ARCH
NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=$(CUDA_DOCKER_ARCH)
+endif # CUDA_DOCKER_ARCH
+ifdef CUDA_NATIVE_ARCH
+ NVCCFLAGS += -arch=$(CUDA_NATIVE_ARCH)
else
NVCCFLAGS += -arch=native
-endif # CUDA_DOCKER_ARCH
+endif # CUDA_NATIVE_ARCH
ifdef LLAMA_CUDA_FORCE_DMMV
NVCCFLAGS += -DGGML_CUDA_FORCE_DMMV
endif # LLAMA_CUDA_FORCE_DMMV