This repo provides a docker buildfile based on the original ROCm-Dockerimage to compile PyTorch and Torchvision for the AMD RX570/RX580/RX590 generation. PyTorch, Torchvision and rocBLAS-Library are not compiled to use the GPU-Polaris generation in the original PIP repository. And of course not compiled too in the official ROCm-PyTorch Dockerfile. However, if Polaris 20/21 GPU support is to be used in ComfyUI, there is no way around newly compiled PyTorch and Torchvision whl/wheel python files. And in ROCm 6.X you have to recompile rocBLAS-Library too. That what this Docker Buildfile will do for you.
OS | linux | Python | ROCm | PyTorch | Torchvision | GPU |
---|---|---|---|---|---|---|
Ubuntu-22.04.2 | 6.X | 3.10.10 | 6.1.3 | 2.4.0 | 0.19.0 | RX570/580/590 aka Polaris 20/21 aka GCN 4 |
-
Used ROCm Docker Version: Ubuntu 22.04+ROCm6.1.3+Python3.10
-
PyTorch GIT: v2.4.0
-
Torchvison GIT: v0.19.0
-
rocBLAS Library: latest
- It is not necessary to install the entire ROCm-Stack on the host system. Unless you want to use something to optimize your GPU via rocm-smi. In my case, I need the rocm stuff to reduce the power consumption of my RX570 GPU to 145 watts with
rocm-smi --setpoweroverdrive 145 && watch -n2 rocm-smi
every time I restart the container.
- install the docker-subsystem / docker.io on your linux system
- download the latest file version of this github-repos
- build your Docker image via
docker build . -t 'rocm61_pt24:latest'
- start the container via:
docker run -it --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -p 8188:8188 rocm61_pt24:latest
- install ComfyUI and download a Model inside the container
- After installing ComfyUI reinstall pytorch and torchvision wheels into your ComfyUI-Python-Environment. you find the Polaris compiled Python-Wheel-Files into the "/pytorch/dist" and "/vision/dist" Directory