Setting up your RTX 5070, 5080 or 5090 for AI – ComfyUI – on Windows through WSL

One of the things you are probably trying to do if you have a RTX 5090 is try out some AI tasks with it. Sadly, a lot of the software isn’t ready yet for the brand new hardware. In this quick guide we will walk you through how to get going as fast as possible.

For those of you just looking for the commands, here’s what you’ll need if you want to DIY it a bit yourself. If something doesn’t work, read through the rest of the article!

# Ubuntu 24.04 - you may need to switch python versions on other distros. Can do a quick check with `python --version`

wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-8 python3.12-venv git
cd ~
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
python3 -m venv venv
. ./venv/bin/activate
# if you are just copying: copy the first block above, then wait for it to complete and switch the venv before copying the next block
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
pip install -r requirements.txt 

python3 main.py --listen 0.0.0.0

Prerequisite software on Windows

You will need a few things setup on Windows 11 itself before you can get ComfyUI or PyTorch running in WSL 2.

If you already have WSL installed, make sure the distro you are running has been upgraded to version 2.

Also probably good to grab the latest CUDA for when PyTorch and other programs do start supporting Windows natively.

WSL2 Software

Open up your WSL terminal. If you haven’t done this before, the easiest way is to click the Windows icon in the bottom left and type WSL. You’ll see a little blue penguin you can click on to open it. You may need to login with the username and password you set up.

Install Cuda

We will want to use at least CUDA 12.8. This is a copy from the official CUDA page for how to do a network install.

wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-8 

Grab ComfyUI

First, make sure you are in your home directory, or a subdirectory of it. You don’t want to be in the /mnt path using the Window drives, as it will be a lot slower.

cd ~
git clone https://github.com/comfyanonymous/ComfyUI.git

Install Required Build Tools

As these are all python packages, we will want to create a virtual environment to keep this all contained so we don’t mess with system packages. If something goes horribly wrong, we can just nuke the venv and recreate it.

cd ~/ComfyUI
python3 -m venv venv 
source venv/bin/activate

After using the source command you should see the terminal now show (venv) to the left of your name. To leave the python virtualenv, type deactivate.

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

Optional: Easy Start Script

echo -e "~/ComfyUI/venv/bin/python ~/ComfyUI/main.py --listen 0.0.0.0" > ~/start_comfyui.sh && chmod +x ~/start_comfyui.sh

That command creates a file ~/start_comfyui.sh with the following content and makes it executable.

~/ComfyUI/venv/bin/python ~/ComfyUI/main.py --listen 0.0.0.0

Optional: Grab the ComfyUI Manager

To make life a lot easier to grab other modules, the comfyui manager is a well loved addition.

cd ~/ComfyUI/custom_nodes 
git clone https://github.com/ltdrdata/ComfyUI-Manager comfyui-manager
cd comfyui-manager
pip install -r requirements.txt

Start The Server

~/start_comfyui.sh

Once it starts up, you can open your browser to http://localhost:8188 and start playing!