Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ set(CMAKE_LINK_LIBRARIES_ONLY_TARGETS ON)

# Set CMAKE_CUDA_ARCHITECTURES before project() so CMake's CMP0104 policy does not
# auto-detect and overwrite it with the host GPU's SM. CUDAToolkit_VERSION is not
# available yet; SM 110 is conditionally appended after find_package(CUDAToolkit) below.
# available yet; SM 100/120 (Blackwell) and SM 110 (Thor) are conditionally appended
# after find_package(CUDAToolkit) below based on the discovered toolkit version.
if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90 100 120)
set(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90)
set(_TRT_CUDA_ARCHS_DEFAULTED TRUE)
endif()

Expand Down Expand Up @@ -89,8 +90,13 @@ endif()
find_package(CUDAToolkit REQUIRED)
message(STATUS "CUDA version: ${CUDAToolkit_VERSION}")

# SM 110 (Thor) requires CUDA 13.0+.
# SM 100 and SM 120 (Blackwell) require CUDA 12.8+.
# CUDAToolkit_VERSION is only available once the toolkit is found.
if (_TRT_CUDA_ARCHS_DEFAULTED AND CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.8")
list(APPEND CMAKE_CUDA_ARCHITECTURES 100 120)
endif()

# SM 110 (Thor) requires CUDA 13.0+.
if (_TRT_CUDA_ARCHS_DEFAULTED AND CUDAToolkit_VERSION VERSION_GREATER_EQUAL "13.0")
list(APPEND CMAKE_CUDA_ARCHITECTURES 110)
endif()
Expand Down
4 changes: 2 additions & 2 deletions samples/python/plugin_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def __init__(self, code, devID):
cuda_call(cudart.cudaFree(0))

major, minor = getComputeCapacity(devID)
_, nvrtc_minor = cuda_call(nvrtc.nvrtcVersion())
use_cubin = nvrtc_minor >= 1
nvrtc_major, nvrtc_minor = cuda_call(nvrtc.nvrtcVersion())
use_cubin = (nvrtc_major, nvrtc_minor) >= (11, 1)
prefix = "sm" if use_cubin else "compute"
arch_arg = bytes(f"--gpu-architecture={prefix}_{major}{minor}", "ascii")

Expand Down