1

How could I know the actual running frequency (not the vendor stock freq.) of my AMD gpu on Ubuntu 16.04 (Xenial) ? I can't find any information about this. I'm using the radeon driver. On the good old days, aticonfig was giving bunch of useful informations... but AMD drivers doesn't exist anymore for Xenial : http://www.omgubuntu.co.uk/2016/03/ubuntu-drops-amd-catalyst-fglrx-driver-16-04

s.k
  • 1,280

2 Answers2

3

For me (Ubuntu 14.04.05 LTS, so I'm forced to the open source driver for my HD5670 1GB GDDR3 card) I found this useful (setting DPM must be run as root, or a user that has driver write permissions):

When I have DPM set to "balanced":

cat /sys/kernel/debug/dri/0/radeon_pm_info

uvd    vclk: 0 dclk: 0
power level 0    sclk: 20000 mclk: 40000 vddc: 900 vddci: 0

when I force it high (default is "auto"):

echo "high" > /sys/class/drm/card0/device/power_dpm_force_performance_level

I get:

cat /sys/kernel/debug/dri/0/radeon_pm_info

uvd    vclk: 0 dclk: 0
power level 2    sclk: 77500 mclk: 66700 vddc: 1050 vddci: 0

If you prefer a GUI, there's a small project I came across, which also lets you create app launch profiles:

add-apt-repository ppa:trebelnik-stefina/radeon-profile
apt-get update
apt-get install radeon-profile

The installer failed due to a failed dependency on radeon-profile-daemon, but the tool still works. I'm guessing this daemon has to do with older kernel versions that used a different approach for DPM.

Side note, I was playing with DPM because I noticed that while running 3D applications with Wine, my CPU cores and GPU were all very much under utilized, yet my FPS was randomly dipping down way low (i.e. 30-40 FPS) for no apparent reason. Turning off DPM in the CPU and GPU (described above) got them up to a steady ~180-200 FPS. I also needed to disable VSYNC lock in the driver, which I did by putting the following into a config file:

cat /usr/share/X11/xorg.conf.d/10-radeon.conf

Section "Device"
    Identifier "Card0"
    Driver "radeon"
    Option "SwapbuffersWait" "off"
EndSection

Here's my CPU output after setting it to "Performance" using the indicator-cpufreq tool installed from Ubuntu Software Center:

grep -E "MHz" /proc/cpuinfo

cpu MHz     : 3000.000
cpu MHz     : 3000.000
cpu MHz     : 3000.000
cpu MHz     : 3000.000
M K
  • 71
  • sudo cat /sys/kernel/debug/dri/0/radeon_pm_info outputs PX asic powered off – Tooniis May 14 '18 at 11:09
  • ^ that is because my laptop has a hybrid graphics setup, so the dedicated AMD GPU was turned off. Launching something using DRI_PRIME=1 will make the frequencies appear. – Tooniis May 31 '18 at 03:39
0

You know the best way is to use AMDuProf.

To get AMDuProfDriver module working is a bit tricky. First uninstall the driver. Download the latest tarball from amd website (NOTE: *.deb package is most likely to not work).

I Will not take credit here. SEE https://github.com/sibradzic/stapmlifier/ who is actual founder of the fix and patches. Download uprof.patch from there (or you may see instruction at the end of README)

sudo apt install linux-headers-generic build-essential libelf-dev
tar -zxf ~/Downloads/AMDuProf_Linux_x64_2.0.493.tar.gz
cd AMDuProf_Linux_x64_2.0.493/bin

MODULE_NAME=AMDPowerProfiler
MODULE_VERSION=$(cat AMDPowerProfilerVersion) # 7.02
mkdir $MODULE_NAME-$MODULE_VERSION
tar -zxf AMDPowerProfilerDriverSource.tar.gz
cd $MODULE_NAME-$MODULE_VERSION

If your kernel version is greater or equal to 4.18, then you need to patch it with patch provided uprof.patch

patch -p1 < ~/stapmlifier/uprof.patch
make

sudo mkdir -p /lib/modules/`uname -r`/kernel/drivers/extra
sudo cp AMDPowerProfiler.ko /lib/modules/`uname -r`/kernel/drivers/extra/
sudo depmod
sudo modprobe AMDPowerProfiler

Create manual char node

VER=$(cat /proc/AMDPowerProfiler/device)
sudo mknod /dev/AMDPowerProfiler -m 666 c $VER 0
knoftrix
  • 419