Setting up your AMD GPU for Tensorflow in Ubuntu (Updated for 20.04) | by Gungle | Nov, 2023


Check Device & Latest Update

glxinfo | grep "Device"
AMD Radeon RX 5600 XT (NAVI10, DRM 3.37.0, 5.4.0-42-generic, LLVM 10.0.0) (0x731f)

sudo apt update
sudo apt dist-upgrade

Install the dependency libnuma-dev for ROCm.

sudo apt install libnuma-dev

Once libnuma-dev gets installed, add the official ROCm repos to apt

wget -qO - http://repo.radeon.com/rocm/apt/debian/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

Install the ROCm kernel

sudo apt update
sudo apt install rocm-dkms

Add your user to the VIDEOGROUP

sudo usermod -a -G video $LOGNAME
sudo usermod -a -G render $LOGNAME

Open /etc/adduser.conf and add these lines

sudo nano /etc/adduser.conf
ADD_EXTRA_GROUPS=1
EXTRA_GROUPS="render,video"

Open /etc/udev/rules.d/70-kfd.rules and add the following

sudo nano /etc/udev/rules.d/70-kfd.rules
SUBSYSTEM=="kfd", KERNEL=="kfd", TAG+="uaccess", GROUP="video"

Install libtinfo5

sudo apt install libtinfo5

Add ROCm binaries to your path (bash or zsh whichever you use)

echo 'export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/' | sudo tee -a /etc/profile.d/rocm.sh



Source link

Be the first to comment

Leave a Reply

Your email address will not be published.


*