From cb6a46fdd677783eec470e3df09aa138891bfebf Mon Sep 17 00:00:00 2001 From: David Addison Date: Thu, 23 Jan 2025 12:57:51 -0800 Subject: [PATCH] Update CUDA gencodes Add support for Blackwell sm100 and sm120 from CUDA 12.8 Add support for Hopper sm90 from CUDA 12.0 --- src/Makefile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 393de8e41b..5737092a86 100644 --- a/src/Makefile +++ b/src/Makefile @@ -16,15 +16,30 @@ CUDARTLIB ?= cudart CUDA_VERSION = $(strip $(shell which $(NVCC) >/dev/null && $(NVCC) --version | grep release | sed 's/.*release //' | sed 's/\,.*//')) CUDA_MAJOR = $(shell echo $(CUDA_VERSION) | cut -d "." -f 1) +CUDA_MINOR = $(shell echo $(CUDA_VERSION) | cut -d "." -f 2) # Better define NVCC_GENCODE in your environment to the minimal set # of archs to reduce compile time. -ifeq ($(shell test "0$(CUDA_MAJOR)" -ge 11; echo $$?),0) +ifeq ($(shell test "0$(CUDA_MAJOR)" -eq 12 -a "0$(CUDA_MINOR)" -ge 8 -o "0$(CUDA_MAJOR)" -ge 13; echo $$?),0) +# Include Blackwell support if we're using CUDA12.8 or above +NVCC_GENCODE ?= -gencode=arch=compute_80,code=sm_80 \ + -gencode=arch=compute_90,code=sm_90 \ + -gencode=arch=compute_100,code=sm_100 \ + -gencode=arch=compute_120,code=sm_120 \ + -gencode=arch=compute_120,code=compute_120 +else ifeq ($(shell test "0$(CUDA_MAJOR)" -ge 12; echo $$?),0) NVCC_GENCODE ?= -gencode=arch=compute_60,code=sm_60 \ -gencode=arch=compute_61,code=sm_61 \ -gencode=arch=compute_70,code=sm_70 \ - -gencode=arch=compute_80,code=sm_80 \ - -gencode=arch=compute_80,code=compute_80 + -gencode=arch=compute_80,code=sm_80 \ + -gencode=arch=compute_90,code=sm_90 \ + -gencode=arch=compute_90,code=compute_90 +else ifeq ($(shell test "0$(CUDA_MAJOR)" -ge 11; echo $$?),0) +NVCC_GENCODE ?= -gencode=arch=compute_60,code=sm_60 \ + -gencode=arch=compute_61,code=sm_61 \ + -gencode=arch=compute_70,code=sm_70 \ + -gencode=arch=compute_80,code=sm_80 \ + -gencode=arch=compute_80,code=compute_80 else NVCC_GENCODE ?= -gencode=arch=compute_35,code=sm_35 \ -gencode=arch=compute_50,code=sm_50 \