What is the best way to run ROCm on Debian?

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
td211
Posts: 16
Joined: 2024-12-05 05:15
Has thanked: 1 time
Been thanked: 1 time

What is the best way to run ROCm on Debian?

#1 Post by td211 »

I have a system with hybrid AMD graphics (iGPU + dGPU), I need to get OpenCL to work and ROCm for some tensorflow related projects. What is the recommended way to do it considering AMD ROCM does not officially support Debian?

I'm considering an Ubuntu container and install ROCm in it, would that work? And how can I integrate it with my Debian host to make working with the container less of a hassle?

User avatar
ruwolf
Posts: 924
Joined: 2008-02-18 05:04
Location: Banovce nad Bebravou
Has thanked: 91 times
Been thanked: 71 times

Re: What is the best way to run ROCm on Debian?

#2 Post by ruwolf »

This is only my personal hint, so it may be not the best solution.
If it works in Ubuntu, I would try to use FrankenDebian, even it is not recommended.
With very well understanding/knowledge of APT pinning, Debian and Ubuntu releases and their upgrades and potential risks, of course!

Aki
Global Moderator
Global Moderator
Posts: 4190
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 123 times
Been thanked: 565 times

Re: What is the best way to run ROCm on Debian?

#3 Post by Aki »

Hello,
td211 wrote: 2024-12-19 17:02 I have a system with hybrid AMD graphics (iGPU + dGPU), I need to get OpenCL to work and ROCm for some tensorflow related projects. What is the recommended way to do it considering AMD ROCM does not officially support Debian?
I’m not a ROCM user, but according to installation instruction [1], Debian 12 is supported.

Hope this helps.


[1] AMD - ROCm™ Software 6.3.1- Quick start installation guide
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

td211
Posts: 16
Joined: 2024-12-05 05:15
Has thanked: 1 time
Been thanked: 1 time

Re: What is the best way to run ROCm on Debian?

#4 Post by td211 »

Aki wrote: 2024-12-22 07:09 I’m not a ROCM user, but according to installation instruction [1], Debian 12 is supported.

Hope this helps.


[1] AMD - ROCm™ Software 6.3.1- Quick start installation guide
Thanks for the link but it needs Python 3.10, which isn't available on Debian. It also suggests add an Ubuntu jammy repo, so a FrankenDebian.

User avatar
ruwolf
Posts: 924
Joined: 2008-02-18 05:04
Location: Banovce nad Bebravou
Has thanked: 91 times
Been thanked: 71 times

Re: What is the best way to run ROCm on Debian?

#5 Post by ruwolf »

It needs libpython3.10 for Ubuntu 22.04, but libpython3.12 for Ubuntu 24.04, so, in my humble opinion, libpython3.11 for Debian 12 should not be a problem.

pwzhangzz
User Project Contributor
User Project Contributor
Posts: 536
Joined: 2020-11-11 17:42
Has thanked: 12 times
Been thanked: 41 times

Re: What is the best way to run ROCm on Debian?

#6 Post by pwzhangzz »

Thanks for the link. According to the planned release milestones, we should be able to expect the RCOm 6.1 deb package in Bookworm repo early 2025 (& we may expect the 6.3+ packages in Sid repo thereafter):
2024-11-30 Transitions underway

2025-01-12 Transition freeze

2025-02-12 Soft freeze (only small, target changes; no NEW)

2025-03-12 Hard freeze
viewtopic.php?t=158450 (quoting my own thread; sorry, can't recall where I got this from)

However, I will try the above-mentioned installation guide when I have some time during the New Year holidays. This will be a great example for the need to make an "immutable" Debian (customized live iso).

pwzhangzz
User Project Contributor
User Project Contributor
Posts: 536
Joined: 2020-11-11 17:42
Has thanked: 12 times
Been thanked: 41 times

Re: What is the best way to run ROCm on Debian?

#7 Post by pwzhangzz »

I tried to install ROCm-6.3.1 in Sid. Everything seems to be working OK, except that I had to change from libpython3.10 to libpython3.12. Also download of the deb package was performed unsandboxed as root as the file '/home/user/amdgpu-install_6.3.60301-1_all.deb' couldn't be accessed by user '_apt'.

However, the installation of the rocm package would need 35.7 GB of space; this test was run with my customized Sid live iso ("immutable Debian") which can access only about 8GB of free RAM space. Not even close. Will try again using a persistence drive with enough disk space.

pwzhangzz
User Project Contributor
User Project Contributor
Posts: 536
Joined: 2020-11-11 17:42
Has thanked: 12 times
Been thanked: 41 times

Re: What is the best way to run ROCm on Debian?

#8 Post by pwzhangzz »

Installations of both rocm and amdgpu-dkms packages are successful. However, post-installation processing of amdgpu-dkms returned an error message:

Code: Select all

dpkg: error processing package amdgpu-dkms (--configure): installed amdgpu-dkms package post-installation script subprocess returned error exit status 10
log file:

Code: Select all

DKMS make.log for amdgpu-6.10.5-2095006.22.04 for kernel 6.12.6-amd64 (amd64)
Wed Jan  1 07:25:55 PM HST 2025
make: Entering directory '/usr/src/linux-headers-6.12.6-amd64'
/tmp/amd.y2Byqdt6/Makefile:52: *** dma_resv->seq is missing. exit....  Stop.
make[1]: *** [/usr/src/linux-headers-6.12.6-common/Makefile:1962: /tmp/amd.y2Byqdt6] Error 2
make: *** [/usr/src/linux-headers-6.12.6-common/Makefile:236: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.12.6-amd64'
For the sake of completeness, the following are the steps that I used in installing the rocm and gpu-dkms packages in Sid:

Code: Select all

sudo apt update
sudo apt install "linux-headers-$(uname -r)"
sudo apt install python3-setuptools python3-wheel libpython3.12
sudo usermod -a -G render,video $LOGNAME
wget https://repo.radeon.com/amdgpu-install/6.3.1/ubuntu/jammy/amdgpu-install_6.3.60301-1_all.deb
sudo apt install ./amdgpu-install_6.3.60301-1_all.deb
sudo apt update
sudo apt install amdgpu-dkms rocm
Happy ROCming with Debian!

superjamie
Posts: 9
Joined: 2023-07-26 10:50
Has thanked: 1 time
Been thanked: 1 time

Re: What is the best way to run ROCm on Debian?

#9 Post by superjamie »

Debian has ROCm libraries in-repo. They're an older libary version than AMD's but Debian libraries have all architectures since gfx800 compiled so should work on many GPUs that official ROCm doesn't support.

You need either Bookworm Backports kernel or Trixie kernel, those both expose all required kernel interfaces.

There is no need to install the external amdgpu driver or external ROCm drivers. That arguably provides an inferior experience to just using Debian's ROCm.

I don't know about tensorflow, it seems tensorflow-rocm is available in pip.

The debian-ai mailing list would be a better place to discuss this if you can't get it working.

Post Reply