Fooocus icon indicating copy to clipboard operation
Fooocus copied to clipboard

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

Open mashb1t opened this issue 10 months ago • 77 comments

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 https://github.com/lllyasviel/Fooocus/discussions/3835#discussioncomment-12034382

mashb1t avatar Feb 02 '25 20:02 mashb1t

same issue as in https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/2601

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

https://github.com/lllyasviel/Fooocus/blob/59f183ab9b8e4a4bbf0fb8bc43886e19e8dfdfae/launch.py#L30-L32

@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 https://github.com/lllyasviel/Fooocus/discussions/3835#discussioncomment-12034514

mashb1t avatar Feb 02 '25 20:02 mashb1t

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

tin-co avatar Feb 02 '25 22:02 tin-co

@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.

mashb1t avatar Feb 02 '25 22:02 mashb1t

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

magmirant0011 avatar Feb 03 '25 08:02 magmirant0011

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

Slider-Override avatar Feb 04 '25 19:02 Slider-Override

cuda has many errors, especially with the compatibility of versions with pitorch, in general this is fixed by updating these two elements, in the same way the version of pip usually affects it. In any case, you could run it in Google Colab and see in the log the versions with which it works safely and then create a development environment with docker, for example, with version control of the dependencies and work with it

El mar, 4 de feb de 2025, 1:33 p. m., Slider-Override < @.***> escribió:

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

— Reply to this email directly, view it on GitHub https://github.com/lllyasviel/Fooocus/issues/3862#issuecomment-2634887375, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUWVFYVVIQP6ZIGWER2RXR32OEIXHAVCNFSM6AAAAABWKYRBISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZUHA4DOMZXGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ikaruslab1 avatar Feb 04 '25 19:02 ikaruslab1

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!

zlo899nv avatar Feb 05 '25 19:02 zlo899nv

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)

adamreading avatar Feb 07 '25 09:02 adamreading

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.

zebulon2 avatar Feb 07 '25 19:02 zebulon2

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

Latee77 avatar Feb 08 '25 13:02 Latee77

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!

zebulon2 avatar Feb 08 '25 16:02 zebulon2

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

agapess avatar Feb 08 '25 16:02 agapess

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: https://github.com/comfyanonymous/ComfyUI/discussions/6643

zebulon2 avatar Feb 08 '25 19:02 zebulon2

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 :)

Latee77 avatar Feb 09 '25 07:02 Latee77

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

freddiehdxd avatar Feb 10 '25 05:02 freddiehdxd

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 avatar Feb 16 '25 11:02 KoholSzkodzi

⚙️ 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.

KoholSzkodzi avatar Feb 17 '25 12:02 KoholSzkodzi

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

IIMKGII avatar Feb 18 '25 17:02 IIMKGII

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.

KoholSzkodzi avatar Feb 18 '25 18:02 KoholSzkodzi

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

SyedShad avatar Feb 26 '25 09:02 SyedShad

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

KoholSzkodzi avatar Feb 26 '25 15:02 KoholSzkodzi

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"

reb0rn21 avatar Feb 26 '25 19:02 reb0rn21

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

IIMKGII avatar Feb 26 '25 20:02 IIMKGII

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

sgvalenti avatar Feb 27 '25 21:02 sgvalenti

is there an xformers version compatible with rtx 5000 series?

Six6pounder avatar Feb 28 '25 07:02 Six6pounder

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

IIMKGII avatar Feb 28 '25 07:02 IIMKGII

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

Six6pounder avatar Feb 28 '25 07:02 Six6pounder

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?

pppking9527 avatar Mar 01 '25 08:03 pppking9527

⚙️ 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.

  • Download CUDA 12.8 Toolkit: https://developer.nvidia.com/cuda-12-8-0-download-archive

⚠️ 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

  • Go to: https://huggingface.co/w-e-w/torch-2.6.0-cu128.nv

  • These are unofficial builds but are released with permission from NVIDIA.

  • Download the versions that match your Python version:

    • torch
    • 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.

Thanks for super guide, it also works with pinokio but script folder is in another location it should be C:\pinokio\api\fooocus.git\app\env\Scripts *This method also works with other programs just change the path with that programs folder and repeat the steps. **if you fail with pytorch torchvision files, try other versions.

moodrabbit avatar Mar 03 '25 19:03 moodrabbit

⚙️ 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.

  • Download CUDA 12.8 Toolkit: https://developer.nvidia.com/cuda-12-8-0-download-archive

⚠️ 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

  • Go to: https://huggingface.co/w-e-w/torch-2.6.0-cu128.nv

  • These are unofficial builds but are released with permission from NVIDIA.

  • Download the versions that match your Python version:

    • torch
    • 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.

Thanks for super guide, it also works with pinokio but script folder is in another location it should be C:\pinokio\api\fooocus.git\app\env\Scripts *This method also works with other programs just change the path with that programs folder and repeat the steps. **if you fail with pytorch torchvision files, try other versions.

Still doesn't work for me with different combinations of torch for rtx5080

just1k1337 avatar Mar 05 '25 08:03 just1k1337