cuda
runtime_error
ai_generated
true
RuntimeError: NVRTC compilation failed
ID: cuda/nvrtc-compilation-error
78%Fix Rate
82%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 12 | active | — | — | — |
Root Cause
CUDA JIT (runtime compilation) failed. Custom CUDA extensions or torch.compile emitted invalid PTX/CUDA code.
genericWorkarounds
-
85% success Check CUDA_HOME points to the correct toolkit version
echo $CUDA_HOME && nvcc --version # must match PyTorch's CUDA version
-
82% success Clear JIT cache and retry
rm -rf ~/.cache/torch_extensions/ && python -c 'import torch; torch.utils.cpp_extension.load(...)'
-
80% success For custom extensions, ensure NVCC flags match the GPU architecture
TORCH_CUDA_ARCH_LIST='8.0;8.9' python setup.py install
Dead Ends
Common approaches that don't work:
-
Reinstall CUDA toolkit
80% fail
NVRTC is a runtime compiler issue, not an installation issue; the generated code is invalid
-
Downgrade GPU driver
75% fail
NVRTC compiles for the installed toolkit version, not the driver version