cmake: emit Pascal (61-real) only on CUDA 12.x toolkits
CUDA 13 removed offline compilation for pre-Turing architectures, so keeping 61-real in the default list makes nvcc fail with "Unsupported gpu architecture compute_61" on 13+ toolkits. Split the version check: 13+ drops 61-real, 12.8+ keeps it with Blackwell, older 12.x keeps it without.
This commit is contained in:
+6
-2
@@ -49,11 +49,15 @@ endif()
|
||||
# CUDA architectures: cover Pascal to Blackwell for distributed binaries.
|
||||
# Pascal (61-real) is SASS-only, no virtual/PTX entry: it's the oldest
|
||||
# supported card and doesn't need to seed forward JIT compat for anything
|
||||
# older, unlike the 75-virtual baseline which does that for 7.5+.
|
||||
# older, unlike the 75-virtual baseline which does that for 7.5+. CUDA 13
|
||||
# removed offline compilation for pre-Turing architectures, so 61-real is
|
||||
# only emitted on 12.x toolkits; Blackwell (120a/121a) needs 12.8+.
|
||||
# Users can override with -DCMAKE_CUDA_ARCHITECTURES=native for local builds.
|
||||
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
|
||||
find_package(CUDAToolkit QUIET)
|
||||
if(CUDAToolkit_FOUND AND CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.8")
|
||||
if(CUDAToolkit_FOUND AND CUDAToolkit_VERSION VERSION_GREATER_EQUAL "13.0")
|
||||
set(CMAKE_CUDA_ARCHITECTURES "75-virtual;80-virtual;86-real;89-real;120a-real;121a-real")
|
||||
elseif(CUDAToolkit_FOUND AND CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.8")
|
||||
set(CMAKE_CUDA_ARCHITECTURES "61-real;75-virtual;80-virtual;86-real;89-real;120a-real;121a-real")
|
||||
else()
|
||||
set(CMAKE_CUDA_ARCHITECTURES "61-real;75-virtual;80-virtual;86-real;89-real")
|
||||
|
||||
Reference in New Issue
Block a user