GPU rendering in Blender with ROCm HIP on Linux
Updated for ROCm 7.2.1 Requires Blender 4.5.3 or greater. ROCm 7.14 and 10.0 cause Blender to randomly crash, apparently because of a regression in Blender 5.2. See this issue to monitor its resolution.
To enjoy the Blender rendering accelerated by an AMD GPU we have to use ROCm. Unfortunately few Linux distributions are officially supported by ROCm, only Ubuntu is on the consumer side. A good practice is therefore to create an Ubuntu container using Distrobox and Podman, install the ROCm part that interests us and launch Blender with this container.
The point being that ROCm sometimes breaks the retro-compatibility and that we can keep using the latest working version with Blender for as long as needed. If you use others programs using ROCm β like AI β, it allows to have multiple different ROCm versions in parallel, each adapted to each program. And also to switch from one container to another to test the newer ROCm versions, so as to rollback quickly if needed.
Add the user to the groups render and video π
The execution of ROCm requires the user to be in the video and render groups. We start by creating the groups before adding our user:
sudo groupadd render
sudo groupadd video
sudo usermod -aG render,video $LOGNAMEIt will be necessary to disconnect the user or reboot the computer for it to take effect.
Creating the Ubuntu container π
Creation of an Ubuntu 26.04 container named “rocm72”: distrobox create -i ubuntu:26.04 -n rocm72
We then enter into the newly created container: distrobox enter rocm72
We then update Ubuntu and we install some dependencies:
sudo apt update && sudo apt upgrade
sudo apt install libsm6 pipewire-pulse
# libsm6 is required by Blender.
# pipewire-pulse is optional for 3D but required for audio if you also do video editing.Adding the official AMD ROCm repo π
We add the repo PGP key: wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
We add the repo to APT:
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/7.2.1 noble main" \
| sudo tee --append /etc/apt/sources.list.d/rocm.list
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \
| sudo tee /etc/apt/preferences.d/rocm-pin-600Installation of HIP π
HIP is the ROCm part required by Blender for the GPU rendering. It’s an interface that convert the CUDA instructions to code supported by ROCm.
We start by updating the repos sudo apt update then we install HIP sudo apt install hip-runtime-amd.
Launch Blender by the container π
On the command line it comes down to distrobox enter rocm72 -- /path/to/blender.
Via a file blender-rocm72.desktop duplicated from the original, this will require to modify these few lines:
[Desktop Entry]
Name=Blender (HIP 7.2)
[...]
Exec=distrobox enter rocm72 -- ./blender
Path=/chemin/vers/blender/
TryExec=distroboxIt’s advised to download Blender from the official website as to easily have different versions in parallel and create a symbolic link blender to the desired version directory as to no have to modify the .desktop file on every Blender update.
Enable HIP in Blender π
In Preferences/System/HIP tab check the GPU (not the CPU). Then in the Render Properties of the scene, after having choose the Cycles engine, select under as Device the option GPU Compute. Enjoy the speed ! π
