When you need to monitor CPU consumption in Linux, you can use top or htop. But when you run a machine learning program, and want to confirm whether it is actually using the GPU instead of the CPU, how would you do it for an AMD GPU on Linux?
This is where you do: sudo apt -y install radeontop
and run it with: radeontop -c
This works even for the GPU on the AMD processor (called an APU). To monitor NVIDIA GPU usage there are different tools. To know more about radeontop, type: man radeontop.
Some extra info:
To install rocm on Linux Mint 21.3 (running Ubuntu 22.04) for your APU/GPU, download rocm 5.4.5 from here. More info here.
sudo dpkg -i amdgpu-install_5.4.50403-1_all.deb
sudo amdgpu-install --list-usecase
sudo amdgpu-install --usecase=hiplibsdk,rocm,dkms
sudo reboot
rocm-smi
sudo rocminfo
You have to run this after installing:
sudo usermod -a -G video <your linux username>
sudo usermod -a -G render <your linux username>
radeontop -c
