How do I fix "CUDA error: no kernel image is available" on an RTX 5090?
Install a PyTorch build made for CUDA 12.8 or newer (PyTorch 2.7 or later), because the RTX 5090 is compute capability 12.0 (sm_120) and older builds contain no GPU code for it; then check that sm_120 appears in torch.cuda.get_arch_list() and that your driver supports the CUDA version of the build.
Updated 2026-10-27
This guide follows NVIDIA’s compute capability table and CUDA Toolkit release notes, and PyTorch’s release blog and install page, all read on 2026-10-27. It applies to any card in NVIDIA’s compute capability 12.0 group, which includes the GeForce RTX 5090 and the RTX PRO 6000 Blackwell editions.
Why the error happens
Three versions have to agree before PyTorch can run on a GPU:
- The card’s compute capability. NVIDIA’s CUDA GPU Compute Capability table lists the GeForce RTX 5090 under compute capability 12.0 (source: NVIDIA, read 2026-10-27).
- The CUDA version PyTorch was built with. According to the official PyTorch 2.7 release post (2025-04-23), PyTorch 2.7 added “support for the NVIDIA Blackwell GPU architecture and pre-built wheels for CUDA 12.8”. A wheel built for an older CUDA, such as
cu126, has nosm_120code. - The NVIDIA driver on the machine. NVIDIA’s CUDA Toolkit release notes list driver 570.26 or newer on Linux for CUDA 12.8 GA, and driver 580 or newer for CUDA 13.x under minor-version compatibility (read 2026-10-27).
If item 2 is too old you see no kernel image is available for execution on the device, or a warning that sm_120 is not compatible with the current PyTorch installation. If item 3 is too old for the wheel you installed, you see a message that the driver is too old or insufficient.
Step 1: Check what you have
Run these in a terminal on the machine with the GPU:
nvidia-smi
nvcc --version
python3 -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"
python3 -c "import torch; print(torch.cuda.get_device_name(0), torch.cuda.get_device_capability(0)); print(torch.cuda.get_arch_list())"
How to read the output:
- The top line of
nvidia-smishows the driver version and a CUDA Version. That CUDA Version is the newest CUDA the driver supports, not the toolkit installed. nvcc --versionshows the CUDA toolkit installed on the system. PyTorch wheels from pip bring their own CUDA libraries, so this number can differ fromtorch.version.cuda.torch.version.cudais the CUDA version your PyTorch was built with.Nonemeans a CPU-only build.torch.cuda.get_device_capability(0)should print(12, 0)on an RTX 5090, andget_arch_list()must includesm_120.
On a CloudGPU Raw GPU instance, run the same commands to see the driver and the pre-installed PyTorch and CUDA versions; this guide does not list them because they can change.
Step 2: Install a PyTorch build that includes sm_120
Pick the build from the official PyTorch install page. On 2026-10-27 it lists Stable 2.14.1 with Linux pip options for CUDA 12.6 and CUDA 13.2. CUDA 12.6 is older than 12.8, so on an RTX 50 card choose the CUDA 13.2 option, which the page gives as:
pip3 uninstall -y torch torchvision torchaudio
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu132
That build needs a driver of 580 or newer (NVIDIA’s CUDA 13.x compatibility rule above). If nvidia-smi shows an older driver that still supports CUDA 12.8 (570.26 or newer), use the CUDA 12.8 wheel index instead. On 2026-10-27 the newest torch on that index is 2.11.0:
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu128
Work inside a virtual environment or conda environment if other projects on the machine depend on a different PyTorch.
Step 3: Verify
import torch
print(torch.__version__, torch.version.cuda)
print(torch.cuda.get_arch_list())
x = torch.randn(1024, 1024, device="cuda")
print((x @ x).sum().item())
If sm_120 is in the list and the matrix multiply prints a number without an error, PyTorch itself is fixed.
Step 4: If the error is still there, check your other GPU libraries
Packages that ship their own compiled GPU code (for example xformers, FlashAttention, bitsandbytes or vLLM) need their own build for sm_120. A common pattern is that import torch works but the error returns when one of these loads. Check each one’s official install docs for a build that matches your PyTorch and CUDA version, and reinstall it after you change PyTorch. Setting CUDA_LAUNCH_BLOCKING=1 before running your script makes the stack trace point at the call that actually failed, as the PyTorch error message itself suggests.
In Docker, the image’s CUDA version matters the same way: start from an image built for CUDA 12.8 or newer. The driver always comes from the host.
Doing this on CloudGPU
Our /pricing page lists the RTX 5090 32G and the RTX PRO 6000 96G on 2026-10-27, along with RTX 4090, RTX 4090D, RTX 3090, RTX A6000 and other cards; see current rates there. For your own PyTorch environment, use the Raw GPU option on /deploy, which our deploy page describes as “a raw GPU with JupyterLab + CUDA pre-installed. SSH access, root on a dedicated container, install any Python/CUDA libs you want.”
GPU time is billed per minute, rounded up, with a 1-minute minimum, and billing stops when you destroy the instance; see /terms. You can top up by card (Visa or Mastercard), Alipay, Google Pay or Apple Pay, or with USDT, as listed on /pricing.
How much VRAM a job needs depends on the model, precision and workflow; see How much VRAM do I need to run an LLM?.
Related guides
FAQ
What does “no kernel image is available for execution on the device” mean?
It means the software you are running, usually PyTorch or a library with its own GPU code, contains no compiled code for your card’s compute capability. On an RTX 5090 that is compute capability 12.0 (sm_120).
Which PyTorch version supports the RTX 5090?
PyTorch 2.7 and later, using a build for CUDA 12.8 or newer. The PyTorch 2.7 release post (2025-04-23) announced Blackwell support with pre-built CUDA 12.8 wheels.
Is the CUDA Version in nvidia-smi the version I have installed?
No. The CUDA Version in nvidia-smi is the newest CUDA your driver supports. The CUDA version PyTorch uses is printed by torch.version.cuda.
Which driver do I need for a CUDA 13.2 PyTorch build?
NVIDIA’s CUDA Toolkit release notes list driver 580 or newer for CUDA 13.x under minor-version compatibility. For CUDA 12.8 builds on Linux, they list driver 570.26 or newer.
PyTorch works but the error comes back in xformers or FlashAttention. Why?
Those packages ship their own compiled GPU code, so they also need a build that includes sm_120 and matches your PyTorch and CUDA version. Reinstall them from their official instructions after changing PyTorch.