Can't Use GPU Acceleration After Installing NVIDIA RTX 5090? Don't Worry, Here's the Solution!
Many friends who like to deploy AI projects locally are always chasing NVIDIA's latest graphics cards. When the RTX 4090 came out, they couldn't wait to replace it and experience lightning-fast computing power. After the RTX 5090 was released, there was another wave of buying frenzy. However, after installing the 5090, tragedy struck: programs couldn't run GPU acceleration, the speed was as slow as a turtle, or even crashed directly, and even starting became a problem!
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 people suspect that the CUDA or PyTorch version is too low, so they upgrade to CUDA 12.8 and PyTorch 2.6, but the problem is still not resolved.
In fact, the reason is very simple: the underlying architectures of 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 Blackwell core of the 5090, so updating it is useless.
So, is there no way to use the 5090? Of course not! The following provides two solutions, designed specifically for Windows and Linux users, which are simple and easy to understand. Just follow the instructions and you can fix it. Let's do it step by step!
First upgrade to CUDA12.8
Method 1: Install PyTorch Nightly
- This is the "daily update version" of PyTorch, which has begun to support the Blackwell architecture of the 5090 and can be used reluctantly.
- The disadvantage is that it is not stable enough, and there may be occasional small problems, but it can basically run.
Windows User Installation Steps
Select different installation methods according to the project deployment method
- Source code deployment method: If you are building your own environment, first activate the virtual environment: For example, enter
venv\Scripts\activate
, and see the(venv)
prefix to indicate success (only for example, subject to the actual virtual environment). - Integrated package method: Search for
python.exe
, find it and enter the folder, entercmd
in the address bar and press Enter, enterpython -m
in the opened terminal, do not press Enter to execute after entering, 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.
Linux User Installation Steps
- Activate virtual environment For example, enter
source venv/bin/activate
, and see the(venv)
prefix to indicate success (also just an example, 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 version may be unstable. If an error occurs when running the project, you can try Method 2.
Method 2: Install 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 it lacks the
torchaudio
library. If the project needs to use torchaudio to process audio, it may report an error.
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 (for example, 3.10 means Python 3.10, and 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's deployment method, choose different installation methods
- Source code deployment method:
- 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\the\first.whl" "path\to\the\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 method:
- 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\the\first.whl" "path\to\the\second.whl"
Or after entering python -m pip install --force-reinstall
, directly drag these 2 files to the cmd terminal and press Enter to execute
Linux User
- 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/the/first.whl /path/to/the/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 version is fully functional and updated quickly, making it suitable for most situations.
- Use Method 2 as a backup: The third-party package is more stable, but lacks
torchaudio
, making it suitable for projects that do not rely on audio. - Ultimate solution: Wait for the official stable version of PyTorch to support 5090 (may take a few months), and then directly use the official version to save the most trouble.
Common questions
- 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, and it is treated as a parameter when executing the command.
- The solution is: 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 quotes
"
to wrap the whl name, for example"/path/to/the/first.whl"
Still getting 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 (for example, Python 3.10 uses 3.10).
- Check CUDA: Run
Still slow?
- Check GPU usage: Windows uses Task Manager, Linux uses
nvidia-smi
.
- Check GPU usage: Windows uses Task Manager, Linux uses
Now, you should be able to get the computing power of the RTX 5090 running!