Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVIDIA GeForce RTX 5090 with CUDA capability sm_120 is not compatible with the current PyTorch installation. #3862

Open
mashb1t opened this issue Feb 2, 2025 · 28 comments

Comments

@mashb1t
Copy link
Collaborator

mashb1t commented Feb 2, 2025

iv got my 5090 , not working , lot of different error

RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

init.py:215: UserWarning:
NVIDIA GeForce RTX 5090 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.
If you want to use the NVIDIA GeForce RTX 5090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

Originally posted by @agapess in #3835 (comment)

@mashb1t
Copy link
Collaborator Author

mashb1t commented Feb 2, 2025

same issue as in lllyasviel/stable-diffusion-webui-forge#2601

@lllyasviel turns out pytorch 2.1.0 isn't compatible with 5000 series GPUs and has to be updated.

Fooocus/launch.py

Lines 30 to 32 in 59f183a

torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu121")
torch_command = os.environ.get('TORCH_COMMAND',
f"pip install torch==2.1.0 torchvision==0.16.0 --extra-index-url {torch_index_url}")

@agapess running Fooocus using Docker after adjusting requirenents_docker.txt to more recent versions might work, but is currently not supported.

Docker quickstart: https://github.com/lllyasviel/Fooocus/blob/main/docker.md

_Originally posted by @mashb1t in #3835 (reply in thread)

@tin-co
Copy link

tin-co commented Feb 2, 2025

How long do you reckon it will take until there is a version that supports the 5000 series?

@mashb1t
Copy link
Collaborator Author

mashb1t commented Feb 2, 2025

@tin-co as i've handed over code ownership again to lllyasviel, i really can't tell when he has time to patch it.

Feel free to update to a more recent version of pytorch yourself, but as there are only a few basic unit tests which have nothing to do with image generation it's going to be a bumpy ride.

@magmirant0011
Copy link

Xformers need update but i managed to get it going, its pretty pointless for me without xformers to use my stable diffusion but at least its possible

@Slider-Override
Copy link

Is there any fix or workaround on Windows? , looks like with the 50xx Fooocus stop working total
RuntimeError: CUDA error: no kernel image is available for execution on the device

@ikaruslab1
Copy link

ikaruslab1 commented Feb 4, 2025 via email

@zlo899nv
Copy link

zlo899nv commented Feb 5, 2025

Hi all! Update from our NVIDIA team.

To use PyTorch for Linux x86_64 and Linux SBSA on NVIDIA 5080, 5090 Blackwell RTX GPUs use the latest nightly builds, or the command below.

pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128

Stay tuned for further updates

Thanks!

@adamreading
Copy link

Update from our NVIDIA team,

To use PyTorch for Linux x86_64 on NVIDIA 5080, 5090 Blackwell RTX GPUs use the latest nightly builds, or the command below. pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128

for Linux SBSA pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128

torchvision and torchaudio for SBSA coming soon

Thanks!

I am using WSL - Ubuntu - everything else is set up and working in Comfyui - I have the latest pytorch nightly from pip install --pre torch torchvision torchaudio --index-url[ https://download.pytorch.org/whl/nightly/cu128] - but when I use Sageattention I get this:
loaded completely 29493.675 3667.902587890625 True
0%| | 0/80 [00:00<?, ?it/s]'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
'sm_120' is not a recognized processor for this target (ignoring processor)
LLVM ERROR: Cannot select: intrinsic %llvm.nvvm.shfl.sync.bfly.i32
Aborted (core dumped)

@zebulon2
Copy link

zebulon2 commented Feb 7, 2025

The nvidia solution has worked for me in Fooocus. I just had to activate Fooocus venv and type the pip command to update torch to the latest version.

@Latee77
Copy link

Latee77 commented Feb 8, 2025

So Fooocus is working with 5080 / 5090 with Nvidia solution and no need for update Fooocus itself?

@zebulon2
Copy link

zebulon2 commented Feb 8, 2025

So Fooocus is working with 5080 / 5090 with Nvidia solution and no need for update Fooocus itself?

No, you just need to activate the Python virtual environment where Fooocus is installed and type the pip command above (it installs the necessary PyTorch updates). For me it worked without problem. And how fast it is with Blackwell architecture!

@agapess
Copy link

agapess commented Feb 8, 2025

So Fooocus is working with 5080 / 5090 with Nvidia solution and no need for update Fooocus itself?

No, you just need to activate the Python virtual environment where Fooocus is installed and type the pip command above (it installs the necessary PyTorch updates). For me it worked without problem. And how fast it is with Blackwell architecture!

on linux or windows

@zebulon2
Copy link

zebulon2 commented Feb 8, 2025

So Fooocus is working with 5080 / 5090 with Nvidia solution and no need for update Fooocus itself?

No, you just need to activate the Python virtual environment where Fooocus is installed and type the pip command above (it installs the necessary PyTorch updates). For me it worked without problem. And how fast it is with Blackwell architecture!

on linux or windows

Linux, using Stability Matrix. Not familiar with windows, but the update concerns Python libraries, so I am not sure it was platform dependent. Pytorch is the key here.
EDIT: apparently cuda is also involved (needs 12.8), but it is also part of pip update. There are also some infos here, for ComfyUI: comfyanonymous/ComfyUI#6643

@Latee77
Copy link

Latee77 commented Feb 9, 2025

I need ”for dummies” - level instructions for these virtual enviroment / pip commands to do it, but lets see that when i get 5090 some day :)

@freddiehdxd
Copy link

Manually Enable RTX 5090 Support

Run the following before running your Python script:
set TORCH_CUDA_ARCH_LIST=12.0

pip install cmake ninja

git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
git submodule sync
git submodule update --init --recursive

Edit setup.py, find TORCH_CUDA_ARCH_LIST, and add:

TORCH_CUDA_ARCH_LIST="8.6+PTX;9.0+PTX;12.0+PTX;12.6+PTX"

MAX_JOBS=8 USE_CUDA=1 python setup.py install

@KoholSzkodzi
Copy link

KoholSzkodzi commented Feb 16, 2025

so if i want to use my 5090 on windows, for example i want to use stability matrix with foocus, or pinokio for f5 tts, i have to wait for some pythorch updates? i had similar issues, everything downloaded-> srtipt launched (foocus), gui started, but when i wanted to test the models on my new gpu it said:

RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

so what can i do to use my card?

ps. im really not into coding, i have no idea what when where and how, i know only that i have to have a python on my pc for it to work and still dont know why, i just want to use AI tools (the nvidia marketing is like "its the best AI card" and i cant use AI)

@KoholSzkodzi
Copy link

KoholSzkodzi commented Feb 17, 2025

⚙️ Solution for Fooocus on Windows with NVIDIA 50xx Series (Tested on 5090 with Driver 572.42 Game Ready)

This guide explains how to fix compatibility issues for Stability Matrix with Fooocus on Windows using an NVIDIA 50xx series GPU (like the 5090).


🔗 Prerequisites: CUDA 12.8

You need CUDA 12.8 installed on your system for this to work.

⚠️ Important Note:

During the installation:

  • Select “Custom Install”
  • Uncheck the Graphics Drivers (The drivers included may be outdated, and using the latest Game Ready driver 572.42 is recommended).

Solution Overview

To get Fooocus working with your NVIDIA 5090, you’ll need to install a custom version of PyTorch and Torchvision that supports CUDA 12.8. Here’s how to do it:


1. 🔗 Download Compatible PyTorch and Torchvision


2. 📂 Locate the Virtual Environment

  • Find the virtual environment used by Fooocus. It’s usually here:
    C:\Users\*your_username*\AppData\Roaming\StabilityMatrix\Packages\Fooocus\venv\scripts
    
  • Navigate to this folder using File Explorer.

3. 💻 Open Command Prompt in the Correct Directory

  • In File Explorer, click on the path bar (where the folder path is displayed).
  • Type cmd and press Enter. This opens Command Prompt directly in that folder.

4. ✅ Activate the Virtual Environment

In the Command Prompt, type:

activate

You should see something like (venv) at the start of the command line.


5. 📥 Install PyTorch and Torchvision

  • Go to the folder where you downloaded the .whl files for PyTorch and Torchvision.
  • Right-click on the PyTorch file and select Copy as path.
  • In the Command Prompt, type:
    pip install "paste your file path here"
  • If it says a version is already installed, use:
    pip install "paste your file path here" --force-reinstall
  • Repeat for the Torchvision file:
    pip install "torchvision file path"
    Or, if needed:
    pip install "torchvision file path" --force-reinstall

6. 🚫 Deactivate the Virtual Environment

Once the installation is complete, type:

deactivate

This exits the virtual environment.


Done!

Your Fooocus setup should now work without errors on your NVIDIA 5090 GPU with driver 572.42 Game Ready.

@IIMKGII
Copy link

IIMKGII commented Feb 18, 2025

Thanks for the great writeup. I'm not a python dev myself, so sorry if i'm using the wrong terminology here, but the same approach works when using the python_embed version of Fooocus on Windows. And i want to confirm that it's working on an RTX 5080.
Easiest way is to navigate to the python_embed folder in CMD and run python -m pip install path/to/whl-file.whl for both torch and torchvision

@KoholSzkodzi
Copy link

Thanks for the great writeup. I'm not a python dev myself, so sorry if i'm using the wrong terminology here, but the same approach works when using the python_embed version of Fooocus on Windows. And i want to confirm that it's working on an RTX 5080. Easiest way is to navigate to the python_embed folder in CMD and run python -m pip install path/to/whl-file.whl for both torch and torchvision

Me to, i dont know how to code, its chat gpt generated. Its working very well, and i understood what and how it works, but its not my work.

@SyedShad
Copy link

Thanks for the detalied guide! It worked for me for RTX 5080, though I think the "activate" command should be executed in the venv\Scripts folder instead

@KoholSzkodzi
Copy link

Thanks for the detalied guide! It worked for me for RTX 5080, though I think the "activate" command should be executed in the venv\Scripts folder instead

yess i edited it, thanks for that

@reb0rn21
Copy link

Any solution for linux, I found https://download.pytorch.org/whl/nightly/xpu/torch-2.7.0.dev20250226%2Bxpu-cp310-cp310-linux_x86_64.whl
but i have no torchvision and when i try to install i get:
ERROR: Could not find a version that satisfies the requirement pytorch-triton-xpu==3.2.0+gite98b6fcb; platform_system == "Linux" and platform_machine == "x86_64" (from torch) (from versions: none) ERROR: No matching distribution found for pytorch-triton-xpu==3.2.0+gite98b6fcb; platform_system == "Linux" and platform_machine == "x86_64"

@IIMKGII
Copy link

IIMKGII commented Feb 26, 2025

Any solution for linux, I found https://download.pytorch.org/whl/nightly/xpu/torch-2.7.0.dev20250226%2Bxpu-cp310-cp310-linux_x86_64.whl but i have no torchvision and when i try to install i get: ERROR: Could not find a version that satisfies the requirement pytorch-triton-xpu==3.2.0+gite98b6fcb; platform_system == "Linux" and platform_machine == "x86_64" (from torch) (from versions: none) ERROR: No matching distribution found for pytorch-triton-xpu==3.2.0+gite98b6fcb; platform_system == "Linux" and platform_machine == "x86_64"

For linux it's easy, just use the latest nightly build: pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
Just make sure you uninstall the old torch packages before installing the new ones

@sgvalenti
Copy link

I just wanted to

I need ”for dummies” - level instructions for these virtual enviroment / pip commands to do it, but lets see that when i get 5090 some day :)

What I did is that I used Grok to walk me through. I just told it what I wanted to do, It gave me the commands to fix everything. I got Flux and Foocus to work

@Six6pounder
Copy link

is there an xformers version compatible with rtx 5000 series?

@IIMKGII
Copy link

IIMKGII commented Feb 28, 2025

is there an xformers version compatible with rtx 5000 series?

What exactly is your problem (and OS)? Fooocus should work just fine now with 50 series now

@Six6pounder
Copy link

is there an xformers version compatible with rtx 5000 series?

What exactly is your problem (and OS)? Fooocus should work just fine now with 50 series now

Fooocus works fine without xformers using pytorch like pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128 (using wsl, didn't try with windows), I'd like to make xformers work also on 50 series, but I had no luck so far

@pppking9527
Copy link

Update from our NVIDIA team,
To use PyTorch for Linux x86_64 on NVIDIA 5080, 5090 Blackwell RTX GPUs use the latest nightly builds, or the command below. pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
for Linux SBSA pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128
torchvision and torchaudio for SBSA coming soon
Thanks!

I am using WSL - Ubuntu - everything else is set up and working in Comfyui - I have the latest pytorch nightly from pip install --pre torch torchvision torchaudio --index-url[ https://download.pytorch.org/whl/nightly/cu128] - but when I use Sageattention I get this: loaded completely 29493.675 3667.902587890625 True 0%| | 0/80 [00:00<?, ?it/s]'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) 'sm_120' is not a recognized processor for this target (ignoring processor) LLVM ERROR: Cannot select: intrinsic %llvm.nvvm.shfl.sync.bfly.i32 Aborted (core dumped)

Me too.who have good idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests