ROCm + Ubuntu 24.04 basic ComfyUI setup instructions

I recently upgraded to U2404 and experienced some hiccups, but ultimately a pretty straightforward install of ComfyUI. I learned through trial and error, and following the advice of several people in the Reddit community (some over on r/ROCm, others on r/linux or r/comfyui). I don't remember all the people who helped out, but I present here a consolidation of the process for anyone else needing a bit of a walkthru.

Note, this does NOT apply to a WSL2 setup, which you should follow AMDs instructions for (and which still don’t work for RDNA2 and below).

This works for RDNA2+, your mileage may vary for older hardware. My system is AMD/AMD - 5900X and RX6900XT, but it's confirmed to work on 3800X + RX6800 as well.

Step 1 - make sure your baseline install is updated, and install synaptic package manager, python, and git:

sudo apt update
sudo apt upgrade
sudo apt install synaptic python3 python3-venv python3-pip git

Step 2 - Install ROCm and HIP libraries, rocminfo, and radeontop, add your user to the required groups, then reboot:

sudo apt install libamd-comgr2 libhsa-runtime64-1 librccl1 librocalution0 librocblas0 librocfft0 librocm-smi64-1 librocsolver0 librocsparse0 rocm-device-libs-17 rocm-smi rocminfo hipcc libhiprand1 libhiprtc-builtins5 radeontop
sudo usermod -aG render,video $USER
sudo reboot

Note: AFTER a reboot, confirm ROCm is installed by running: rocminfo. The first line should be ROCk module loaded.

Note 2: radeontop is not required, but you can use it to monitor the load on your Radeon GPU.

Step 4 - Clone ComfyUI:

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

Step 5 - Create a virtual environment for Comfy and activate the virtual environment:

cd ComfyUI
python3 -m venv venv
. ./venv/bin/activate

Step 6 - FIRST, install the ROCm version of the torch libraries FOLLOWED by the remainder of ComfyUI requirements.

Go to: https://pytorch.org/get-started/locally/

Select: stable/linux/pip/python/ROCm and it will generate the install command.

[install command from PyTorch website]
pip install -r requirements.txt

Step 7 - ALL DONE! Just run ComfyUI:

python3 main.py