Skip to content

#4887 - Conditionally gate SM 100/120 on CUDA 12.8+ in default CMAKE_CUDA_ARCHITECTURES - #4888

Open
Deeven-Seru wants to merge 1 commit into
NVIDIA:mainfrom
Deeven-Seru:fix-blackwell-cuda-arch-gating
Open

Deeven-Seru wants to merge 1 commit into
NVIDIA:mainfrom
Deeven-Seru:fix-blackwell-cuda-arch-gating

Conversation

@Deeven-Seru

Copy link
Copy Markdown

Description

Fixes #4887.

In the TensorRT 11.4 OSS release (#4872), CMAKE_CUDA_ARCHITECTURES was defaulted to include SM 100 and SM 120 unconditionally before CUDAToolkit discovery:

if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
  set(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90 100 120)
  set(_TRT_CUDA_ARCHS_DEFAULTED TRUE)
endif()

While SM 110 (Thor) was conditionally appended only when CUDAToolkit_VERSION VERSION_GREATER_EQUAL "13.0", SM 100 and SM 120 (Blackwell) require CUDA 12.8+ to be supported by nvcc. When compiling on CUDA toolkits prior to 12.8 (e.g. CUDA 12.0 - 12.6), nvcc fatal errors with:

nvcc fatal : Value 'sm_100' is not defined for option 'gpu-architecture'

TensorRT's internal plugin headers already reflect this requirement via #if CUDA_VERSION >= 12080 in fused_multihead_attention_v2.h.

This PR:

  1. Defaults CMAKE_CUDA_ARCHITECTURES to 75 80 86 89 90 prior to toolkit discovery.
  2. Conditionally appends SM 100 and SM 120 once CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.8" is confirmed, matching the existing Thor (110) conditional logic.
  3. Fixes the NVRTC version check in samples/python/plugin_utils.py to check (nvrtc_major, nvrtc_minor) >= (11, 1), preventing CUDA 12.0 and 13.0 (nvrtc_minor == 0) from incorrectly disabling CUBIN output.

…CMAKE_CUDA_ARCHITECTURES

In TensorRT 11.4 OSS release (NVIDIA#4872), CMAKE_CUDA_ARCHITECTURES was defaulted
to include SM 100 and SM 120 unconditionally before CUDAToolkit was discovered.
However, SM 100 and SM 120 (Blackwell) require CUDA 12.8+ to be supported by nvcc.
Building on CUDA toolkits < 12.8 (such as CUDA 12.0 - 12.6) caused nvcc to
immediately fail with 'Value sm_100 is not defined for option gpu-architecture'.

This patch:
- Defaults CMAKE_CUDA_ARCHITECTURES to SM 75 80 86 89 90 prior to toolkit discovery.
- Conditionally appends SM 100 and SM 120 once CUDAToolkit_VERSION >= 12.8 is confirmed,
  matching the existing conditional logic for SM 110 (Thor, CUDA >= 13.0).
- Fixes NVRTC version check in plugin_utils.py to check (nvrtc_major, nvrtc_minor) >= (11, 1),
  preventing CUDA 12.0/13.0 from incorrectly disabling CUBIN generation.

Fixes NVIDIA#4887

Signed-off-by: Deeven Seru <deevenseru11@gmail.com>
@Deeven-Seru
Deeven-Seru requested a review from a team as a code owner October 19, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure on CUDA < 12.8 due to ungated default CMAKE_CUDA_ARCHITECTURES containing SM 100/120

1 participant