Skip to content

Commit ad014bb

Browse files
make: add error message for bad CUDA version (#5444)
* make: add error message for bad CUDA version * Update Makefile Co-authored-by: Jared Van Bortel <[email protected]> --------- Co-authored-by: Jared Van Bortel <[email protected]>
1 parent 49cc1f7 commit ad014bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,14 @@ $(info I CC: $(shell $(CC) --version | head -n 1))
569569
$(info I CXX: $(shell $(CXX) --version | head -n 1))
570570
ifdef LLAMA_CUBLAS
571571
$(info I NVCC: $(shell $(NVCC) --version | tail -n 1))
572+
CUDA_VERSION := $(shell nvcc --version | grep -oP 'release (\K[0-9]+\.[0-9])')
573+
ifeq ($(shell awk -v "v=$(CUDA_VERSION)" 'BEGIN { print (v < 11.7) }'),1)
574+
ifndef CUDA_DOCKER_ARCH
575+
ifndef CUDA_POWER_ARCH
576+
$(error I ERROR: For CUDA versions < 11.7 a target CUDA architecture must be explicitly provided via CUDA_DOCKER_ARCH)
577+
endif # CUDA_POWER_ARCH
578+
endif # CUDA_DOCKER_ARCH
579+
endif # eq ($(shell echo "$(CUDA_VERSION) < 11.7" | bc),1)
572580
endif # LLAMA_CUBLAS
573581
$(info )
574582

0 commit comments

Comments
 (0)