From 0081032087d8f1153dbd5da49f4aaeffc610734f Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 1 Aug 2023 14:13:17 -0700 Subject: [PATCH] Update Makefile Use the environment variable `CUDA_NATIVE_ARCH` if present to set NVCC arch. Otherwise, use `native`. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 100614b4bb871..819e364979492 100644 --- a/Makefile +++ b/Makefile @@ -202,9 +202,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