How to enable the Radeon dynamic power management feature?

Update (8-05-2014): As expected, in Ubuntu 14.04 DPM is enabled by default for all modern AMD GPU's (HD 4000 through HD 7000 series). If you are running this release together with a supported graphics card, you don't need to do anything to use this feature.

Update (28-11-2013): Ubuntu 13.10 ships with the 3.11 kernel by default. So if you are using this release, all you need to do is add the parameter to the Linux Kernel. I updated the guide accordingly. Also, it looks like by Ubuntu 14.04, DPM will be enabled by default so hopefully this guide will be obsolete by then! ;)

Ok, In the last few days I experimented a bit and got it enabled! It's actually really easy once you found out how to do it.. For people who also want to try it, I'll explain every step. Starting with the installation of the new kernel.

First of all a few points to consider. The Radeon DPM support is only for Radeon HD 2000 (R600) series graphics cards and newer. If you're using a really old ATI Radeon graphics card, the power management support is already tapped out on the open-source driver.

Steps for Ubuntu 13.04 or below only:

To use Radeon DPM you need the Linux 3.11 kernel or newer. You can use the Ubuntu mainline kernel PPA and download the latest stable 3.11 Linux kernel image from this kernel.ubuntu.com directory. Any future kernel updates are fine too and can then also be found in this directory.

Using the dynamic power management feature requires updated firmware for the graphics card. The latest Radeon microcode/firmware can be downloaded from this directory. You need the *_smc.bin files from June. If you're unsure of your specific graphics card codename, you can generally find it from looking at output of lspci -v | less ... The file(s) need to be placed within /lib/firmware/radeon. If you try to use Radeon DPM without the firmware, acceleration will end up being disabled for the GPU. You also need to make sure you have the updated firmware in /lib/firmware/radeon before installing the >3.11 kernel - it will be pulled automagically into the installed image.

Ubuntu 13.10 or lower, or users of Radeon HD 3000 or below:

The Radeon DPM support is not enabled by default below Linux kernel 3.13, or for older GPUs. You must add the radeon.dpm=1 parameter to the Linux kernel to enable it in these cases. For the steps to do so on Ubuntu, see the Ubuntu Wiki about the different ways.

With the new kernel installed, firmware updated and Kernel parameter enabled you should be good to go. You must now reboot your system and you can check if everything is working after that by doing

cat /sys/kernel/debug/dri/64/radeon_pm_info

Note: @luca992 pointed out that the file radeon_pm_info could be in a different directory (for example in /sys/kernel/debug/dri/1/ instead of dri/64/). If you're absolutely sure you followed all steps correctly, you can check if this could be the case in your situation.

You should see something like this:

uvd    vclk: 0 dclk: 0
power level 0    sclk: 22000 mclk: 25000 vddc: 900

You can further configure DPM by opening /etc/rc.local and adding the following line:

echo parameter > /sys/class/drm/card0/device/power_dpm_state

Where "parameter" can be:

  • battery (a set of performance levels targeted for optimal operation on battery)
  • balanced (a set of performance levels targeted for optimal every day use)
  • performance (a set of performance levels targeted for the highest GPU performance)

Sources: http://www.botchco.com/agd5f/?p=57


Ok, I'm going to part from the presumption you already have the kernel 3.11-GIT and have a r6xx-SI or newer ATI card. From there on, you just have to add radeom.dpm=1 as a kernel module parameter and DPM should be activated.

It could be either in the GRUB parameter, in the /etc/default/grub file write

GRUB_CMDLINE_LINUX_DEFAULT="quiet radeon.dpm=1"
sudo update-grub

Or in a .conf file under your /etc/modprobe directory:

sudo su -
touch /etc/modprobe.d/radeon-dpm.conf
echo options radeon dpm=1 > /etc/modprobe.d/radeon-dpm.conf 
cat /etc/modprobe.d/radeon-dpm.conf 
# will output "options radeon dpm=1"

Quote from the sources:

The AMD Radeon driver finally has dynamic power management support! For Radeon GPUs the core clock and memory clocks will dynamically adjust (along with the voltages) based upon load, this works for multi-monitor configurations, and it's at near feature parity to what's provided by PowerPlay and the features in the AMD Catalyst driver. This is a big win for saving on power/battery when using the open-source Radeon Linux driver along with offering better performance for newer GPUs that have a boot clock speed that's lower than their rated frequencies. This support goes back to Radeon HD 2000 (R600) GPUs but is currently not enabled by default but requires setting radeon.dpm=1.

Sources:

  • http://lists.freedesktop.org/archives/dri-devel/2013-June/040436.html
  • http://www.phoronix.com/scan.php?page=article&item=amd_radeon_dpm&num=1
  • http://www.phoronix.com/scan.php?page=news_item&px=MTQwNjA
  • http://www.phoronix.com/scan.php?page=article&item=amd_dpm_preview&num=1

Tags:

Kernel