Blender, on Ubuntu, using... AMD Radeon

Canadian Tech Pains

I've been a long-time fan of Radeon cards, despite their decreased performance over price-comparable NVIDIA counterparts... there's something about the Canadian in me that wants to support Canadian tech companies, or at least the technology hailed from the same.

I recently build a new PC, and one of my goals was to use all open-source software for it.

Open Source 3D Tech

90% of my stack makes that a breeze, but there was one key area holding me back: 3D editing. I've been wanting to dive in, and have spent a bit of time tinkering with Fusion 360 amongst others, but I wanted a solution that worked well in Linux.

Enter Blender

I tried a number of tools, but Blender takes the cake.

At this moment, I've spent the past few weeks re-designing a PC case.

And here's the first re-mixed one I made.

Blender's speed is just getting worse for me. So I set out to figure out how to get ROCM running on my computer -- again. I recall the last time it seemed arduous, so I wasn't eager.

A few quick google searches later, I found this page, and my hesitancy seems unwarranted! Much to my relief.

ROCM Quick Start - Linux

Best of all, this may just set me up to do some AI/ML experimentation in the weeks ahead.


Nitty Gritty Details for my Future Self, and for you, too:

I'm being a bit of a rebel and running an interim release of Ubuntu. This tends to make life difficult, but I'd like newer versions of the core software more often, so took the plunge.

Ubuntu Version: 23.04 - Lunar Lobster

Best of all, despite the not-officially supported version, I got it to work!

Here's some more Ubuntu details by way of a screenshot:

How Did I Do It?

It was relatively painless, and so hopefully, future self and/or non-self reader, it will be for you, too.

First off, the above noted quick start guide is -- actually -- a great place to start.

1 - Download Signing Key

$ sudo mkdir --parents --mwget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
    gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/nullode=0755 /etc/apt/keyrings

2 - Add the repositories

$ sudo tee /etc/apt/sources.list.d/amdgpu.list <<'EOF'
deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/5.7.1/ubuntu jammy main  
EOF  
$ sudo tee /etc/apt/sources.list.d/rocm.list <<'EOF'
deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/debian jammy main  
EOF  
$ echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600

3 - Update and Install

$ sudo apt update
$ sudo apt install amdgpu-dkms
$ sudo apt install rocm-hip-libraries

4 - Reboot

$ sudo reboot
Did it Work?

Not quite.

Then why'd you write all that?

Well, I'm superstitious. I did those steps, and then I did the next, so wanted to document it all.

Onwards!

The Next, Next Steps

Over on this gpuopen page, I was able to find some non-Linux operating system specific instructions.

https://gpuopen.com/learn/amd-lab-notes/amd-lab-notes-rocm-installation-readme/

These commands seemed to get me past the post:

$ export ROCM_REPO_BASEURL="https://repo.radeon.com/rocm/apt/5.4/"
$ export ROCM_REPO_COMP="ubuntu"
$ export ROCM_REPO_BUILD="main"
$ echo "deb [arch=amd64 trusted=yes] ${ROCM_REPO_BASEURL} ${ROCM_REPO_COMP} ${ROCM_REPO_BUILD}" > /etc/apt/sources.list.d/rocm.list
$ sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \  
 libdrm-amdgpu* \
 initramfs-tools \
 libtinfo* \
 initramfs-tools \
 rocm-llvm \
 rocm-hip-runtime \
 rocm-hip-sdk \
 roctracer-dev

After which, I was able to run:

$ sudo /opt/rocm/bin/rocminfo
Where's the Proof

In this screenshot, you can see that Blender is now happily using HIP to render (and in fact, the fans on the GPU are now quieter... so it must not be working as hard).

Good luck GPU-naut! :D