Ubuntu open source ATI radeon driver power usage tweaks
I've always had Nvidia GPU card in my PCs. The only reason for that is great Linux support. Recently I've bought laptop with ATI HD4200 integrated GPU so I had to learn "how to walk on Linux" all over again. First thing there are two opensource drivers and fglrx proprietary ATI driver. Quantity is not quality so any of those drivers is not up to pair with current Nvidia drivers.
Open source driver lacks good 3D acceleration and quality power save functionality (it is laptop we're talking about) and fglrx driver has poor 2D acceleration. Basically it is up to you to decide which driver to use based on the way you use your PC. I've picked open source driver in spite the fact that it has no power save capabilities. Actually it has some basic power save capabilities, but they are turned off by default. In this article I will show you how to keep you ATI graphics card power usage under control on the Ubuntu Maverick based Linux operating systems with open source ATI radeon driver (could work for Debian and derivatives with kernel >=2.6.35).
First thing we must create script that will apply our settings on every reboot. We create script called "ati-power-save" and then we will fill it with our power save commands I will explain later:
sudo gedit /etc/init.d/ati-power-save
Now that you have text editor in front of you you must choose between two power save methods. First method is called "dynpm" and the second method is called "profile" method.
Dynpm method is more modern and efficient but it might not work with some hardware combinations (like mine for example). This method will adjust your GPU frequency and voltage based on the current demand. Here is what you need to put inside
/etc/init.d/ati-power-save to use dynpm power save method.
#!/bin/sh # ATI power save echo dynpm > /sys/class/drm/card0/device/power_method
Power profile method is based on four power profiles you choose manually or at boot time using script like the one we are creating here. You can choose between 1. "default" 2. "auto" 3. "low" 4. "high". Here is what you need to put inside
/etc/init.d/ati-power-save to use profile power save method.
#!/bin/sh # ATI power save echo profile > /sys/class/drm/card0/device/power_method echo low > /sys/class/drm/card0/device/power_profile
Instead of "low" profile you can select any of four supported power profiles. Now save your settings and close your text editor. To check current status of ATI power save (current method dynpm or profile and current power profile in case of profile method) and current ATI core and memory frequencies you can use following commands in your terminal:
cat /sys/class/drm/card0/device/power_method cat /sys/class/drm/card0/device/power_profile cat /sys/kernel/debug/dri/0/radeon_pm_info
All that's left is to mark our script executable (thanks Kevian for pointing this out) and to put it to be run at boot:
sudo chmod +x /etc/init.d/ati-power-save sudo update-rc.d ati-power-save defaults 99
That is it. Now reboot you PC and use "cat" commands to check are you settings applied. Cheers!