Skip to content

Commit 96981f3

Browse files
authored
make : add optional CUDA_NATIVE_ARCH (#2482)
Use the environment variable `CUDA_NATIVE_ARCH` if present to set NVCC arch. Otherwise, use `native`.
1 parent 438c2ca commit 96981f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,12 @@ else
391391
endif #LLAMA_CUDA_NVCC
392392
ifdef CUDA_DOCKER_ARCH
393393
NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=$(CUDA_DOCKER_ARCH)
394+
endif # CUDA_DOCKER_ARCH
395+
ifdef CUDA_NATIVE_ARCH
396+
NVCCFLAGS += -arch=$(CUDA_NATIVE_ARCH)
394397
else
395398
NVCCFLAGS += -arch=native
396-
endif # CUDA_DOCKER_ARCH
399+
endif # CUDA_NATIVE_ARCH
397400
ifdef LLAMA_CUDA_FORCE_DMMV
398401
NVCCFLAGS += -DGGML_CUDA_FORCE_DMMV
399402
endif # LLAMA_CUDA_FORCE_DMMV

0 commit comments

Comments
 (0)