cuda
compatibility
ai_generated
true
CUDA error: no kernel image is available for execution on the device
ID: cuda/no-kernel-image-for-device
90%Fix Rate
92%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 12 | active | — | — | — |
Root Cause
The compiled CUDA binary doesn't include kernels for the GPU architecture (compute capability mismatch).
genericWorkarounds
-
93% success Rebuild with the correct CUDA architecture: set TORCH_CUDA_ARCH_LIST or pass -arch=sm_XX
For RTX 3090 use sm_86, RTX 4090 use sm_89, A100 use sm_80
-
90% success Install pre-built binaries that support your GPU: pip install torch --index-url https://download.pytorch.org/whl/cu121
PyTorch wheels include all common architectures
Dead Ends
Common approaches that don't work:
-
Installing a different CUDA toolkit version
70% fail
The toolkit version doesn't determine compiled architectures
-
Using CUDA_VISIBLE_DEVICES to select a different GPU
80% fail
All GPUs on the machine likely have the same architecture
Error Chain
Frequently confused with: