What a mess this is...
We must set up these repositories to grab amdgpu-install... which... installs additional repositories...
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
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/7.0.1 jammy main
deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/graphics/7.0.1/ubuntu jammy main
EOF
sudo tee /etc/apt/preferences.d/rocm-pin-600 << EOF
Package: *
Pin: release o=repo.radeon.com
Pin-Priority: 600
EOFHOWEVER These versions seemed incompatible with Kernel 6.12, so I downgraded to use 6.4.3:
cat /etc/apt/sources.list.d/rocm.list
deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.4.3 noble main
#deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.4.2 noble main
#deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/7.0.1 jammy main
#deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/graphics/7.0.1/ubuntu jammy mainALSO I downloaded the keyring 100 times and half the time I can't verify signatures, so the sha356 sum of the key I used:
ac6b006da6f9efdee2a22bc46f386f537d2b749f3059964574dba4f74aeb1c9d /etc/apt/keyrings/rocm.gpgAt this point, you may not be able to get amdgpu-install installed via apt.
If you can't obtain amdgpu-install binary from apt, you can download one:
mkdir /tmp/rocm-install
cd /tmp/rocm-install
PACKAGE=amdgpu-install_6.4.60402-1_all.deb
wget https://repo.radeon.com/amdgpu-install/6.4.2.1/ubuntu/noble/$PACKAGE
dpkg -i $PACKAGEAt this point, you need to be able to run amdgpu-install, regardless how you obtained it.
The next step is tricky, as it will likely fail, but as long as it installs the additional apt lists, you should be able to move forward.
Eventually, we want to come back and run amdgpu-install and have it run all the way through.
For now, you can try to use amdgpu-install, but what are the chances it actually works?
sudo apt update
# The following command may fail, but you should have the appropriate repositories
sudo amdgpu-install --usecase=rocm,dkms
# You may also be interested in targeting this installation:
# sudo amdgpu-install --usecase=hiplibsdk,rocm,dkmsThis is when I compiled GCC 11.4, as all these ROCm packages said they'd be happy if they had it. What I didn't realize is that it's really just an arbitrary dependency.
I'm pretty sure at this point, you just have to create the dummy packages, but for completeness of information, I will mention I have a working /opt/gcc-11 now.
mkdir /tmp/dummypackages
cd /tmp/dummypackages
sudo apt update
sudo apt install -y equivs
equivs-control libstdc++-11-dev-dummy
cat << EOF | tee libstdc++-11-dev-dummy
Package: libstdc++-11-dev
Version: 11.4.0-custom
Provides: libstdc++-11-dev
Description: Dummy Package for Custom GCC 11.4 Build
EOF
equivs-build libstdc++-11-dev-dummy
sudo dpkg -i libstdc++-11-dev*.deb
equivs-control libgcc-11-dev-dummy
cat << EOF | tee libgcc-11-dev-dummy
Package: libgcc-11-dev
Version: 11.4.0-custom
Provides: libgcc-11-dev
Description: Dummy Package for Custom GCC 11.4 Build
EOF
equivs-build libgcc-11-dev-dummy
sudo dpkg -i libgcc-11-dev*.debYou should be able to install most of the AMD ROCm packages, however, it is likely that you will be unable to build a Kernel Module. Thanks to @meefik, we have the missing pieces.
sudo mkdir -p /usr/src/ofa_kernel/x86_64/
sudo ln -s /usr/src/linux-headers-`uname -r` /usr/src/ofa_kernel/x86_64/`uname -r`
uname -r | tee /var/tmp/amdgpu-dkms-kernelssudo su -c "SRCARCH=x86 dpkg-reconfigure amdgpu-dkms --force"
sudo amdgpu-install --usecase=rocm,dkmsNow, edit how DKMS will build the module.
$ tail -n 2 /usr/src/amdgpu-6.12.12-2194681.24.04/dkms.conf
MAKE[0]="SRCARCH=x86 make KERNELVER=$kernelver"
$ sudo dpkg --remove --force-remove-reinstreq amdgpu-dkms
$ sudo apt install --fix-brokenIf you don't --fix-broken, AMDGPU DKMS will re-compile with every apt install.
Be sure to add your user to the appropriate groups (sudo usermod -a -G render,video $USER)
You may wish to activate/de-activate the AMD repos.
sudo mv /etc/apt/sources.list.d/rocm.list /etc/apt/sources.list.d/rocm.list.bak
sudo mv /etc/apt/sources.list.d/amdgpu.list /etc/apt/sources.list.d/amdgpu.list.bak
sudo apt updatesudo mv /etc/apt/sources.list.d/rocm.list.bak /etc/apt/sources.list.d/rocm.list
sudo mv /etc/apt/sources.list.d/amdgpu.list.bak /etc/apt/sources.list.d/amdgpu.list
sudo apt updateThe following did not work, but I want to keep track of the information.
sudo apt download rocm-llvm
sudo ar x rocm-llvm_19.0.0.25224.60402-120~24.04_amd64.deb
tar xf control.tar.gz
sudo sed -i 's/Depends: \(.*\)/Depends: python3, libc6, libstdc++6, libstdc++-13-dev, libgcc-13-dev, rocm-core, \1/' control
tar czf control.tar.gz control
sudo ar rcs rocm-llvm_fixed.deb debian-binary control.tar.gz data.tar.gz
sudo dpkg -i rocm-llvm_fixed.deb