Skip to content

[FIX][CUDA] Select NVRTC architecture for output format - #20100

Merged
tlopex merged 1 commit into
apache:mainfrom
jinhongyii:fix/nvrtc-virtual-architecture
Aug 6, 2026
Merged

[FIX][CUDA] Select NVRTC architecture for output format#20100
tlopex merged 1 commit into
apache:mainfrom
jinhongyii:fix/nvrtc-virtual-architecture

Conversation

@jinhongyii

@jinhongyii jinhongyii commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

NVRTC uses --gpu-architecture together with the requested output format. A real sm_* target produces a cubin, while a virtual compute_* target produces PTX.

The previous revision normalized every target to compute_*. With CUDA 13.2, compilation reported success, but nvrtcGetCUBINSize returned zero bytes; loading that image then failed with CUDA_ERROR_INVALID_IMAGE.

This change preserves architecture suffixes such as 100a and 100f, while selecting the prefix from the requested output:

  • cubin: normalize to sm_*;
  • PTX: normalize to compute_*.

Validation:

  • python -m compileall -q python/tvm/support/nvcc.py
  • CUDA 13.2 / B200 empty-kernel check: compute_100a yielded a zero-byte cubin and failed to load; sm_100a yielded a 4,888-byte cubin and loaded successfully.
  • A TIRx NumSim/GPU float-atomic microtest failed with CUDA_ERROR_INVALID_IMAGE before this correction and passed through the default NVRTC path afterward.

@jinhongyii
jinhongyii force-pushed the fix/nvrtc-virtual-architecture branch from 05cfe64 to 4ae0b6f Compare August 6, 2026 03:31
@jinhongyii jinhongyii changed the title [FIX][CUDA] Use virtual architecture targets for NVRTC [FIX][CUDA] Select NVRTC architecture for output format Aug 6, 2026
@jinhongyii
jinhongyii force-pushed the fix/nvrtc-virtual-architecture branch from 4ae0b6f to d35b911 Compare August 6, 2026 18:47
@jinhongyii
jinhongyii force-pushed the fix/nvrtc-virtual-architecture branch from d35b911 to 2e27aae Compare August 6, 2026 18:58
@tlopex
tlopex merged commit e7a385a into apache:main Aug 6, 2026
5 checks passed
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.

3 participants