Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [How-To] Power saving with the Radeon driver
New Posts  All Forums:Forum Nav:

[How-To] Power saving with the Radeon driver

post #1 of 4
Thread Starter 

The open source driver for ATI cards has some power saving features. May not be that important for some desktop users, but for laptop users it's a must. The driver has two kinds of power saving schemes, one under UMS mode (older and more stable) and another under KMS mode. You can't use both methods at the same time. Most current distros have now defaulted to KMS, although none of them enable any power saving options in the drivers yet.  For this guide I will just focus on KMS, which is what most every current distro uses.
 

KMS

There are two methods.  One is the older profile based power switching.  This method is available for all cards that support power saving.  You will need the latest kernel available (minimum 2.6.35). To use it, simply execute the following command strings inside a terminal:

 

 

Code:

sudo -i
#to turn yourself into root

echo dynpm > /sys/class/drm/card0/device/power_method
## dynamic clock switching based on GPU load

echo profile > /sys/class/drm/card0/device/power_method
## profile based frequency switching; this is the default mode

 

If you select the profile method, you can then choose from several power profiles:

 

Code:
echo default > /sys/class/drm/card0/device/power_profile 
# uses default clocks/volts

echo low > /sys/class/drm/card0/device/power_profile 
## forces GPU to lowest available frequency; may cause some issues on certain laptops and displays, as this is the mode used when the display switches to dpms off mode

echo mid > /sys/class/drm/card0/device/power_profile 
## forces GPU  to be in the "mid" power state all the time; safer to use than "low" for regular desktop usage

echo high > /sys/class/drm/card0/device/power_profile
## forces GPU to highest available frequency

echo auto > /sys/class/drm/card-0/device/power_profile
## switches between high and mid power states depending on whether the system in on battery power or not

 

 

There is also DPM (Dynamic Power Management).  This is a newer (and better) method, though is only available for HD2K and newer cards and with kernels 3.11 and newer.  This method works more closely to how fglrx handles power management; clock switching should be automatic.  DPM is not enabled by default in the 3.11 kernels, where you have to add radeon.dpm=1 to your kernel parameters.  If you are using kernels 3.12 or newer, then DPM is enabled by default.

DPM can be further tweaked to your needs with the terminal.  First you need to learn that your card will have different power states and performance levels.  Each power state has three performance levels, which you can set manually.   Read the blog entry linked to at the end of this guide to learn more about this.

Usage is similar to the method above:


 

Code:

sudo -i

#you need to be root to use all these commands

 

#there are three power states: battery, balanced, performance

#you can change between these states by echoing to the following parameter

 

/sys/class/drm/card0/device/power_dpm_state

 

#each power state has several performance levels: auto, low, high

#you can also change between them by echoing to the following:

 

/sys/class/drm/card0/device/power_dpm_force_performance_level

 

 

The default is the balanced power state and the auto performance level.  You can change them to you hearts desire.

There is also a nifty GUI called radeon-profile if you don't want to mess with the terminal.  Link is at the end of the guide.


Notes

1) DPM works for a lot of people, but for me it only kind of does.  My HD7850 still spends about 90% of the time in "3d" clocks and voltage.  I have to manually set it to low.  

 

2) There was an issue with APUs and the open source drivers where they would default to the low power state without being able to change the clocks. DPM supposedly fixes this issue and APUs now correctly re-clock to proper performance levels.

 

 

Links of interest:

 

agd5f's blog post on DPM

radeon-profile


Edited by Melcar - 12/27/13 at 4:00pm
Magicbox
(17 items)
 
crapbox
(13 items)
 
 
CPUMotherboardGraphicsRAM
FX 8320 Sabertooth 990FX HD7850 Kingston DDR3  
Hard DriveHard DriveCoolingCooling
Seagate Barracuda 7200.14 Seagate Barracuda 7200.11 Thermaltake Frio AR Twin Turbo II 
OSOSMonitorKeyboard
Kubuntu  Windows 7 Ultimate  Acer 21.5 S220HQL (1920 x 1080) Vorago KB500 
PowerCaseMouseMouse Pad
Cooler Master Silent Pro M 850W Cooler Master HAF 912 Vorago 405 Generic ergonomic pad 
Audio
Xonar DX 
CPUMotherboardGraphicsRAM
Sempron 3300+ HP stock mobo (laptop) 200M (IGP) 2x1GB PC3200 
Hard DriveOptical DriveOSMonitor
100GB ATA133 DVD/CDRW Kubuntu 32 bit 14.1" (1280x768) 
Power
6 cell 
  hide details  
Reply
Magicbox
(17 items)
 
crapbox
(13 items)
 
 
CPUMotherboardGraphicsRAM
FX 8320 Sabertooth 990FX HD7850 Kingston DDR3  
Hard DriveHard DriveCoolingCooling
Seagate Barracuda 7200.14 Seagate Barracuda 7200.11 Thermaltake Frio AR Twin Turbo II 
OSOSMonitorKeyboard
Kubuntu  Windows 7 Ultimate  Acer 21.5 S220HQL (1920 x 1080) Vorago KB500 
PowerCaseMouseMouse Pad
Cooler Master Silent Pro M 850W Cooler Master HAF 912 Vorago 405 Generic ergonomic pad 
Audio
Xonar DX 
CPUMotherboardGraphicsRAM
Sempron 3300+ HP stock mobo (laptop) 200M (IGP) 2x1GB PC3200 
Hard DriveOptical DriveOSMonitor
100GB ATA133 DVD/CDRW Kubuntu 32 bit 14.1" (1280x768) 
Power
6 cell 
  hide details  
Reply
post #2 of 4
Thread Starter 
Added instructions for new 2.6.35 rc kernels.
Magicbox
(17 items)
 
crapbox
(13 items)
 
 
CPUMotherboardGraphicsRAM
FX 8320 Sabertooth 990FX HD7850 Kingston DDR3  
Hard DriveHard DriveCoolingCooling
Seagate Barracuda 7200.14 Seagate Barracuda 7200.11 Thermaltake Frio AR Twin Turbo II 
OSOSMonitorKeyboard
Kubuntu  Windows 7 Ultimate  Acer 21.5 S220HQL (1920 x 1080) Vorago KB500 
PowerCaseMouseMouse Pad
Cooler Master Silent Pro M 850W Cooler Master HAF 912 Vorago 405 Generic ergonomic pad 
Audio
Xonar DX 
CPUMotherboardGraphicsRAM
Sempron 3300+ HP stock mobo (laptop) 200M (IGP) 2x1GB PC3200 
Hard DriveOptical DriveOSMonitor
100GB ATA133 DVD/CDRW Kubuntu 32 bit 14.1" (1280x768) 
Power
6 cell 
  hide details  
Reply
Magicbox
(17 items)
 
crapbox
(13 items)
 
 
CPUMotherboardGraphicsRAM
FX 8320 Sabertooth 990FX HD7850 Kingston DDR3  
Hard DriveHard DriveCoolingCooling
Seagate Barracuda 7200.14 Seagate Barracuda 7200.11 Thermaltake Frio AR Twin Turbo II 
OSOSMonitorKeyboard
Kubuntu  Windows 7 Ultimate  Acer 21.5 S220HQL (1920 x 1080) Vorago KB500 
PowerCaseMouseMouse Pad
Cooler Master Silent Pro M 850W Cooler Master HAF 912 Vorago 405 Generic ergonomic pad 
Audio
Xonar DX 
CPUMotherboardGraphicsRAM
Sempron 3300+ HP stock mobo (laptop) 200M (IGP) 2x1GB PC3200 
Hard DriveOptical DriveOSMonitor
100GB ATA133 DVD/CDRW Kubuntu 32 bit 14.1" (1280x768) 
Power
6 cell 
  hide details  
Reply
post #3 of 4
Bit of a necro, but I've come up a trick with that changes your GPU into mid or high power depending on whether your laptop is plugged in or running on battery, if the auto profile doesn't work for you. It uses laptop-mode-tools to execute scripts that do as Melcar said in his post.

1. Make a file called gpu-save-on.sh and fill it with this:
Code:
#!/bin/sh
echo profile > /sys/class/drm/card0/device/power_method
echo mid > /sys/class/drm/card0/device/power_profile
2. Create another file, called gpu-save-off.sh and fill it with this:
Code:
#!/bin/sh
echo profile > /sys/class/drm/card0/device/power_method
echo high > /sys/class/drm/card0/device/power_profile
3. Run chmod +x on both of them
4. Copy gpu-save-on.sh to the following folders:
Code:
/etc/laptop-mode/batt-start
/etc/laptop-mode/lm-ac-stop
5. Copy gpu-save-off.sh to:
Code:
/etc/laptop-mode/nolm-ac-start/
/etc/laptop-mode/nolm-ac-stop/
/etc/laptop-mode/batt-stop/
/etc/laptop-mode/lm-ac-start/
Done - all you need to do now is reboot, or restart the laptop-mode service.
It plays TF2
(18 items)
 
LG Nexus 5
(12 items)
 
Acer 5745PG
(6 items)
 
CPUMotherboardGraphicsRAM
2600k @ 3.4GHz Gigabyte GA-P67A-UD7 Asus GTX760 DirectCU II 2GB Kingston HyperX 2x4/2x1GB 
Hard DriveHard DriveHard DriveOptical Drive
OCZ Vector 128GB Seagate 2TB  Seagate 500GB 7200.12 Some LG that works properly 
OSOSMonitorKeyboard
Windows 7 Pro 64bit Windows 8 Pro 64bit Samsung B2330h MS Digital Media Keyboard 
PowerCaseMouseMouse Pad
CoolerMaster Silent Pro M600 Coolermaster CM690II Advanced Logitech G500 CyberSnipa Something 
AudioAudio
JVC RX700 Creative X-Fi Titanium 
CPUMotherboardGraphicsRAM
Quad-core 2.3 GHz Krait 400 LG Something + Qualcomm MSM8974 Snapdragon 800 Adreno 330 2 GB 
Hard DriveOptical DriveCoolingOS
32 GB internal storage 8MP AutoAwesomeHDRFace + 1MP SelfieMachine Air Android 4.4.2 
MonitorPowerCaseMouse
True HD IPS+ 1080 x 1920 pixels, 4.95 inches Non-removable Li-Po 2300 mAh battery LG Sexybox Capacitive touchscreen 
CPUGraphicsRAMHard Drive
i5 480m @ 2.66GHz GT420M 1GB 4GB DDR3 WD 750GB 
OSMonitor
Windows 7 Professional 64 bit 15" 1366x768 + two point touchscreen 
  hide details  
Reply
It plays TF2
(18 items)
 
LG Nexus 5
(12 items)
 
Acer 5745PG
(6 items)
 
CPUMotherboardGraphicsRAM
2600k @ 3.4GHz Gigabyte GA-P67A-UD7 Asus GTX760 DirectCU II 2GB Kingston HyperX 2x4/2x1GB 
Hard DriveHard DriveHard DriveOptical Drive
OCZ Vector 128GB Seagate 2TB  Seagate 500GB 7200.12 Some LG that works properly 
OSOSMonitorKeyboard
Windows 7 Pro 64bit Windows 8 Pro 64bit Samsung B2330h MS Digital Media Keyboard 
PowerCaseMouseMouse Pad
CoolerMaster Silent Pro M600 Coolermaster CM690II Advanced Logitech G500 CyberSnipa Something 
AudioAudio
JVC RX700 Creative X-Fi Titanium 
CPUMotherboardGraphicsRAM
Quad-core 2.3 GHz Krait 400 LG Something + Qualcomm MSM8974 Snapdragon 800 Adreno 330 2 GB 
Hard DriveOptical DriveCoolingOS
32 GB internal storage 8MP AutoAwesomeHDRFace + 1MP SelfieMachine Air Android 4.4.2 
MonitorPowerCaseMouse
True HD IPS+ 1080 x 1920 pixels, 4.95 inches Non-removable Li-Po 2300 mAh battery LG Sexybox Capacitive touchscreen 
CPUGraphicsRAMHard Drive
i5 480m @ 2.66GHz GT420M 1GB 4GB DDR3 WD 750GB 
OSMonitor
Windows 7 Professional 64 bit 15" 1366x768 + two point touchscreen 
  hide details  
Reply
post #4 of 4
Thread Starter 
Updating with current info.
Magicbox
(17 items)
 
crapbox
(13 items)
 
 
CPUMotherboardGraphicsRAM
FX 8320 Sabertooth 990FX HD7850 Kingston DDR3  
Hard DriveHard DriveCoolingCooling
Seagate Barracuda 7200.14 Seagate Barracuda 7200.11 Thermaltake Frio AR Twin Turbo II 
OSOSMonitorKeyboard
Kubuntu  Windows 7 Ultimate  Acer 21.5 S220HQL (1920 x 1080) Vorago KB500 
PowerCaseMouseMouse Pad
Cooler Master Silent Pro M 850W Cooler Master HAF 912 Vorago 405 Generic ergonomic pad 
Audio
Xonar DX 
CPUMotherboardGraphicsRAM
Sempron 3300+ HP stock mobo (laptop) 200M (IGP) 2x1GB PC3200 
Hard DriveOptical DriveOSMonitor
100GB ATA133 DVD/CDRW Kubuntu 32 bit 14.1" (1280x768) 
Power
6 cell 
  hide details  
Reply
Magicbox
(17 items)
 
crapbox
(13 items)
 
 
CPUMotherboardGraphicsRAM
FX 8320 Sabertooth 990FX HD7850 Kingston DDR3  
Hard DriveHard DriveCoolingCooling
Seagate Barracuda 7200.14 Seagate Barracuda 7200.11 Thermaltake Frio AR Twin Turbo II 
OSOSMonitorKeyboard
Kubuntu  Windows 7 Ultimate  Acer 21.5 S220HQL (1920 x 1080) Vorago KB500 
PowerCaseMouseMouse Pad
Cooler Master Silent Pro M 850W Cooler Master HAF 912 Vorago 405 Generic ergonomic pad 
Audio
Xonar DX 
CPUMotherboardGraphicsRAM
Sempron 3300+ HP stock mobo (laptop) 200M (IGP) 2x1GB PC3200 
Hard DriveOptical DriveOSMonitor
100GB ATA133 DVD/CDRW Kubuntu 32 bit 14.1" (1280x768) 
Power
6 cell 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [How-To] Power saving with the Radeon driver