As of now pretty much everyone has heard of systemd, the next generation init system for Linux. Next to the fact that if provides a really fast boot (on different systems tested approximately 50% of the original boot time) and a clean solution for dependencies of services it also offers the capability to write services in a very simple manner. So today we are going to write a simple service to set your power profile (as introduced last year). Note that you (obviously) need a systemd enabled system like Fedora 15.

First of all we need to know how to set set power profile. This requires three things: a fairly recent kernel, a Radeon graphics card that supports power modes on Linux and sysfs enabled in your kernel. A simple way to test this is to execute the following command:

Note: If your card is not "card0" you need to change the value of TARGET to the proper value.

After you create the scripts you should test if this works for you. The service is meant to set your power mode to low which is the best for mobile devices running on battery or to cool down your system. To test the service call:

/usr/local/sbin/radeon-power_profile

This will print out which profile is currently active ("default" in most cases). Now you can start the service

systemctl start radeon-power_profile.service

This will most likely cause a single flicker of the display (this might be a bug as it does not happen when GPU and memory clock changes happen on Microsoft Windows). After that a second call to /usr/local/sbin/radeon-power_profile should show your clock is now at "low". Verify that your system is running stable and smooth as before. Note: Setting the power mode to low will obviously cause your 3D rendering to be slower. If everything works as expected you can enable the service by default using

systemctl enable radeon-power_profile.service

Now your system will set the power mode during boot. On my systems it really extended the battery life time and my passive (fan-less) card went from 70°C to 45°C.