In diesem Artikel zeige ich Schritt für Schritt, wie man ComfyUI mit einer RX 9070 unter Ubuntu 24.04.4 zum Laufen bringt. Mit den folgenden Befehlen sollte die Installation problemlos gelingen.

Installation von Python 3.12 und der venv Umgebung

apt install python3.12 python3.12-venv

Install AMD Unified Driver Package Repositories and Installer Script

sudo apt update
wget https://repo.radeon.com/amdgpu-install/7.2.1/ubuntu/noble/amdgpu-install_7.2.1.70201-1_all.deb
sudo apt install ./amdgpu-install_7.2.1.70201-1_all.deb

AMD ROCm installieren

amdgpu-install -y --usecase=rocm --no-dkms

Gruppen Berechtigung für render und video setzen

sudo usermod -a -G render,video $LOGNAME
sudo reboot

ComfyUI von GitHub klonen und installieren

git pull https://github.com/Comfy-Org/ComfyUI.git
pip install -r requirements.txt

Einrichten der venv Umgebung und Installation von PyTorch für ROCm

cd ComfyUI
python3 -m venv .venv
source .venv/bin/activate
pip3 install --upgrade pip wheel
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2.1/torch-2.9.1%2Brocm7.2.1.lw.gitff65f5bc-cp312-cp312-linux_x86_64.whl
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2.1/torchvision-0.24.0%2Brocm7.2.1.gitb919bd0c-cp312-cp312-linux_x86_64.whl
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2.1/triton-3.5.1%2Brocm7.2.1.gita272dfa8-cp312-cp312-linux_x86_64.whl
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2.1/torchaudio-2.9.0%2Brocm7.2.1.gite3c6ee2b-cp312-cp312-linux_x86_64.whl
pip3 uninstall torch torchvision triton torchaudio
pip3 install torch-2.9.1+rocm7.2.1.lw.gitff65f5bc-cp312-cp312-linux_x86_64.whl torchvision-0.24.0+rocm7.2.1.gitb919bd0c-cp312-cp312-linux_x86_64.whl torchaudio-2.9.0+rocm7.2.1.gite3c6ee2b-cp312-cp312-linux_x86_64.whl triton-3.5.1+rocm7.2.1.gita272dfa8-cp312-cp312-linux_x86_64.whl

ONNX Runtime installieren

sudo apt install half
pip3 uninstall onnxruntime-migraphx
pip3 install onnxruntime-migraphx -f https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2.1/

ComfyUI starten

python3 main.py --preview-method auto --disable-smart-memory --disable-pinned-memory --enable-dynamic-vram

Hinweis: Jedes mal wenn man ComfyUI starten möchte, dann muss  man vorher die Umgebung laden.

cd ComfyUI
source .venv/bin/activate
python3 main.py --preview-method auto --disable-smart-memory --disable-pinned-memory --enable-dynamic-vram