So far, AMD does not yet officially support Debian in ROCm. Only RHEL, SLES and Ubuntu are supported in ROCM 5.7.1. On the Debian side there is a team working on providing support in the next release.
However, one can install ROCm on Debian Bookworm using the amdgpu-install tool for Ubuntu.
wget https://repo.radeon.com/amdgpu-install/5.7.1/ubuntu/jammy/amdgpu-install_5.7.50701-1_all.deb sudo apt install ./amdgpu-install_5.7.50701-1_all.deb
Then one can install rocm step-by-step.
Kernel Driver
First install the amdgpu kernel dkms:
sudo amdgpu-install --usecase=dkms
If a custom kernel is used, this will not directly work, because only kernel up to 6.2 are suupported. Otherwise exclude the custom kernels with:
BUILD_EXCLUSIVE_KERNEL="^(6\.[0-2]\..*|5\..*)"
in /etc/dkms/amdgpu.conf
ROCm
ROCm only supports Python 3.10, unfortunately this is no longer available in Debian Bookworm. However python3.10 can be installed from Debian Sid.
Then install ROCm
sudo amdgpu-install --usecase=rocm
Check the install with:
rocminfo
Also add your user to these groups:
sudo usermod -a -G render,video $LOGNAME