PyTorch: CUDA error: no kernel image is available for execution on the device
Cause
PyTorch was compiled for a set of CUDA compute capabilities (sm_70, sm_80, sm_86, sm_90, ...). Your GPU's capability isn't in that set. Common scenarios: a Blackwell GPU (sm_120) on a PyTorch built only up to sm_90; an older Pascal GPU (sm_61) on a PyTorch that dropped pre-sm_70 support.
Solution
1. Identify your GPU's compute capability:
nvidia-smi --query-gpu=name,compute_cap --format=csv
Common values: RTX 5090 = 12.0 (sm_120), RTX 40 = 8.9, RTX 30 = 8.6, A100 = 8.0, H100 = 9.0.
2. For new GPUs (Blackwell / RTX 50), use a PyTorch nightly with sm_120 support:
pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu128
3. For old GPUs (pre-sm_70: GTX 10xx, GP100, K80), downgrade to PyTorch ≤ 2.1, which still ships pre-Volta kernels:
pip install "torch<2.2" "torchvision<0.17" --index-url https://download.pytorch.org/whl/cu118
4. For some installs you can override the target architecture at install time (works only when building from source):
TORCH_CUDA_ARCH_LIST="12.0" pip install torch --no-binary :all:
5. Check the PyTorch version's supported arch list:
import torch
print(torch.cuda.get_arch_list())
# Should include your GPU's sm_XX
Related errors
Did this fix it?
If your case was different, email Contact support with what you saw and we'll update the page. If it worked but took different commands on your platform, we want to know that too.