Skip to content

Instantly share code, notes, and snippets.

@tonykero
Created October 28, 2020 23:37
Show Gist options
  • Save tonykero/8ceb62868378ee11e36b07f975731d26 to your computer and use it in GitHub Desktop.
Save tonykero/8ceb62868378ee11e36b07f975731d26 to your computer and use it in GitHub Desktop.
## Will successfully install amdgpu drivers and rocm,
## but pointless as there is no gpu device attached to WSL2 (only CUDA and DirectML is supported, not /dev/kfd or amd gpus)
## ROCM/HIP
sudo apt update
sudo apt dist-upgrade
sudo apt install libnuma-dev
wget -q -O - http://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list
sudo apt update
sudo apt install rocm-dkms
sudo usermod -a -G video $LOGNAME
sudo usermod -a -G render $LOGNAME
## TEST
/opt/rocm/bin/rocminfo
/opt/rocm/opencl/bin/clinfo
## AMDGPU DRIVER
#http://cofal.work/2019/09/27/Ubuntu%E4%B8%8B%E5%AE%89%E8%A3%85ROCm%E8%BF%87%E7%A8%8B/
#https://askubuntu.com/questions/1097030/cant-install-amdgpu-pro-18-40-on-ubuntu-server-18-04-01
sudo apt update && sudo apt install -y build-essential clang clang-format clang-tidy cmake cmake-qt-gui ssh curl apt-utils pkg-config g++-multilib git libunwind-dev libfftw3-dev libelf-dev libncurses5-dev libpthread-stubs0-dev vim gfortran libboost-program-options-dev libssl-dev libboost-dev libboost-system-dev libboost-filesystem-dev rpm build-essential cdbs dh-make dkms execstack dh-modaliases
sudo apt-get install linux-headers-4.15.0-20-generic
sudo apt-add-repository universe
sudo dpkg --add-architecture i386
sudo ./amdgpu-install --opencl=legacy --no-dkms
sudo apt-get -o Dpkg::Options::="--force-overwrite" install amdgpu-dkms
# for amdgpu-pro-install (use previously downloaded files in cache)
amdgpu-uninstall
sudo ./amdgpu-pro-install --opencl=legacy
#https://askubuntu.com/questions/1040474/warning-amdgpu-dkms-failed-for-running-kernel-on-both-16-04-18-04
apt install amdgpu-dkms libdrm-amdgpu-amdgpu1 libdrm-amdgpu1 libdrm2-amdgpu
# ---
sudo apt-get -o Dpkg::Options::="--force-overwrite" dist-upgrade
## TEST
/opt/rocm/bin/rocminfo
/opt/rocm/opencl/bin/clinfo
@incense
Copy link

incense commented Apr 22, 2024

Same error with ROCm 6.1.
Opened an issue here: https://github.com/ROCm/ROCm/issues/3051

@unclemusclez
Copy link

where is this damn mythical hsa-runtime-rocr4wsl-amdgpu ???

@Headcrabed
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment