NVIDIA RTX 5090 Not Using GPU Acceleration? Here's How to Fix It!
Many enthusiasts who deploy AI projects locally are always eager to get their hands on NVIDIA's latest graphics cards. When the RTX 4090 was released, people couldn't wait to upgrade and experience the blazing-fast computing power. Now, with the RTX 5090, there's another wave of buying frenzy. However, after installing the 5090, a tragedy occurs: the program can't run with GPU acceleration, the speed is as slow as a turtle, or even crashes directly, making it difficult to even start!
NVIDIA GeForce RTX 5070 Ti with CUDA capability sm_120 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_50 sm_60 sm_61 sm_70 sm_75 sm_80 sm_86 sm_90.
...
RuntimeError: CUDA error: no kernel image is available for execution on the device
Some suspect that the CUDA or PyTorch version is too low, so they upgrade to CUDA 12.8 and PyTorch 2.6, but the problem still persists.
In fact, the reason is simple: The underlying architectures of the RTX 4090 and RTX 5090 are different, and the torch library is incompatible.
The 4090 uses the Ada Lovelace architecture, while the 5090 uses the new Blackwell architecture. The current official version of PyTorch does not fully support the 5090's Blackwell core, so updating it won't help.
So, is the 5090 useless? Of course not! Here are two solutions designed for Windows and Linux users, which are simple and easy to understand. Let's get started step by step!
First, upgrade to CUDA 12.8
Method 1: Install PyTorch Nightly
- This is PyTorch's "daily updated version," which has begun to support the 5090's Blackwell architecture, and can be used for the time being.
- The disadvantage is that it is not stable enough, and there may be minor problems from time to time, but it can basically run.
Installation Steps for Windows Users
Choose different installation methods according to the project deployment method
- Source Code Deployment: If you are building your own environment, first activate the virtual environment: For example, enter
venv\Scripts\activate
, and see the(venv)
prefix indicating success (for example only, subject to the actual virtual environment). - Integrated Package: Search for
python.exe
, find it and enter the folder, entercmd
in the address bar and press Enter, then enterpython -m
in the opened terminal, and do not press Enter to execute it yet, see the next step to paste the command. - Install PyTorch Nightly Command
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
- Paste the command in the command line, press Enter to run, and wait patiently for the installation to complete.
Installation Steps for Linux Users
- Activate the virtual environment For example, enter
source venv/bin/activate
, and see the(venv)
prefix indicating success (also for example only, subject to the actual environment name). - Install PyTorch Nightly Command
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
- Paste the command in the terminal and press Enter to run.
Note: The Nightly build may be unstable. If an error occurs when running the project, you can try Method 2.
Method 2: Install a Third-Party PyTorch Package
- This is a community-provided PyTorch version (based on 2.6.0) that has been adapted to the 5090 and is relatively stable in actual testing.
- The disadvantage is that the
torchaudio
library is missing. If the project needs to use torchaudio to process audio, an error may be reported.
First, you need to download the whl file
- Open the webpage:
https://huggingface.co/w-e-w/torch-2.6.0-cu128.nv
- Scroll to the bottom of the page and find your Python version (e.g., 3.10 means Python 3.10, 3.11 means 3.11).
- Each version has 2
.whl
files (torch
andtorchvision
), click the link to download. - Put the two files in a folder without spaces, otherwise it may fail (such as
D:\download
or/home/user/temp
).
Windows User Installation
According to the project deployment method, choose different installation methods
- Source Code Deployment:
- Open the command line (Win + R, enter
cmd
and press Enter). - Enter the virtual environment: for example, enter
venv\Scripts\activate
and see the(venv)
prefix. - Enter the installation command:
- Open the command line (Win + R, enter
pip install --force-reinstall "path\to\first.whl" "path\to\second.whl"
Or drag the files directly: enter pip install --force-reinstall
, then drag the two .whl
files to the window, add a space between the two whl files, and press Enter to run.
- Integrated Package:
- Search for
python.exe
, if found, enter the folder, entercmd
in the address bar and press Enter to open the cmd console - Enter the installation command
- Search for
python -m pip install --force-reinstall "path\to\first.whl" "path\to\second.whl"
Or after entering python -m pip install --force-reinstall
, directly drag the 2 files to the cmd terminal and press Enter to execute
Linux Users
- Enter the virtual environment Open the terminal and enter
source venv/bin/activate
. - Install the .whl file Enter the command:
pip3 install --force-reinstall /path/to/first.whl /path/to/second.whl
Or drag the two .whl
files directly to the terminal, add a space between the 2 whl files, and press Enter to run.
Which method is better?
- Try Method 1 first: The Nightly build is feature-rich and updated quickly, which is suitable for most situations.
- Backup Method 2: The third-party package is more stable, but lacks
torchaudio
, which is suitable for projects that do not rely on audio. - Ultimate Solution: Wait for the official PyTorch to support a stable version of 5090 (it may take a few months), and it will be most worry-free to use the official version directly at that time.
Common Problems
- The installation prompts that the whl file does not exist or No such file
- It is possible that your whl is saved in a folder name or path with spaces, which is treated as a parameter when executing the command.
- The solution is to: copy the whl file to a folder without spaces, and make sure that there are no spaces in the path from the drive letter to the end. Or use English double quotation marks
"
to enclose the whl name, such as"/path/to/first.whl"
Still an error after installation?
- Check CUDA: Run
nvidia-smi
to confirm that 5090 is recognized and the CUDA version is 12.8. - Make sure the Python version and the
.whl
file match (e.g., Python 3.10 uses 3.10).
- Check CUDA: Run
Is the speed still slow?
- View GPU usage: Windows uses Task Manager, Linux uses
nvidia-smi
.
- View GPU usage: Windows uses Task Manager, Linux uses
Now, you should be able to get the computing power of the RTX 5090 running!