Difference between revisions of "How to make use of Graphics Chips Power Management features"

From ThinkWiki
Jump to: navigation, search
(Added settings for KMS)
 
(29 intermediate revisions by 15 users not shown)
Line 1: Line 1:
==Power Saving With A Framebuffer Console==
+
=ATI Radeon Mobility chips=
 +
 
 +
==Power saving with a framebuffer console==
 
In order to use the dynamic GPU clock-scaling similar to what X.org has, you need to use the radeonfb kernel module. You'll need to enable the '''CONFIG_FB_RADEON''' in your kernel configuration. If setup correctly you should see something like the following in your kernel log:
 
In order to use the dynamic GPU clock-scaling similar to what X.org has, you need to use the radeonfb kernel module. You'll need to enable the '''CONFIG_FB_RADEON''' in your kernel configuration. If setup correctly you should see something like the following in your kernel log:
 
  radeonfb: Dynamic Clock Power Management enabled
 
  radeonfb: Dynamic Clock Power Management enabled
  
==DynamicClocks in the Radeon Xorg driver==
+
==Using the X.org Radeon driver==
 +
===Activation===
 
The xorg X server has support for a power saving feature from ATI called PowerPlay. Xorg calls this feature DynamicClocks. It can be enabled in the server by adding '''Option  "DynamicClocks" "on"''' in the '''Device''' section in {{path|/etc/X11/xorg.conf}}
 
The xorg X server has support for a power saving feature from ATI called PowerPlay. Xorg calls this feature DynamicClocks. It can be enabled in the server by adding '''Option  "DynamicClocks" "on"''' in the '''Device''' section in {{path|/etc/X11/xorg.conf}}
  
Line 9: Line 12:
 
         Identifier  "Videocard0"
 
         Identifier  "Videocard0"
 
         Driver      "radeon"
 
         Driver      "radeon"
         VendorName  "IBM Thinkpad"
+
         VendorName  "IBM ThinkPad"
 
         BoardName  "ATI Radeon Mobility M9"
 
         BoardName  "ATI Radeon Mobility M9"
 
         '''Option      "DynamicClocks" "on"'''
 
         '''Option      "DynamicClocks" "on"'''
Line 19: Line 22:
 
  (II) RADEON(0): Dynamic Clock Scaling Enabled
 
  (II) RADEON(0): Dynamic Clock Scaling Enabled
  
{{WARN|Enabling DynamicClocks crashes some models. If the CPU is entering one of the lower power states (C3 or lower) during Xorg startup the display may stay black. As a workaround disable DynamicClocks in Xorg and use [http://www.hasw.net/linux/ rovclock] instead. But it does not scale the clocks to match the workload.}}
+
You do not need to do anything else, it dynamically manages the power consumption itself.
 +
 
 +
{{NOTE|Enabling DynamicClocks crashes some models. If the CPU is entering one of the lower power states (C3 or lower) during Xorg startup the display may stay black. As a workaround disable DynamicClocks in Xorg and use [[Rovclock]] instead. But it does not scale the clocks to match the workload. Update 5/2/2006: Seems fixed in Xorg6.9}}
 +
 
 +
===Problem with <tt>vbetool</tt>===
 +
 
 +
When <tt>vbetool</tt> is used to restore the display state (as done by some suspend/resume scripts), the setting of <tt>DynamicClocks</tt> is forgotten and the GPU will consume more power until the next X server startup. You can manually enable DynamicTools again by starting a blank second X server (e.g., by running {{cmdroot|X :1}}) and then exiting it via {{key|Ctrl}}{{key|Alt}}{{key|Backspace}}.
 +
 
 +
===Problem with suspend-to-disk===
 +
 
 +
Upon resume from suspend-to-disk, the setting of <tt>DynamicClocks</tt> is forgotten and the GPU will consume more power until the next X server startup. You can manually enable DynamicClocks again by starting a blank second X server (e.g., by running {{cmdroot|X :1}}) and then exiting it via {{key|Ctrl}}{{key|Alt}}{{key|Backspace}}.
 +
 
 +
If you're using the hibernate script that's part of [[Software Suspend 2]], setting UseDummyXServer to yes in {{path|hibernate.conf}} automatically starts a second X server, hence enabling DynamicClocks again. (Remember to disable UseDummyXServer if you switch to the [[fglrx]] driver, otherwise your computer will hang upon resume.)
 +
 
 +
{{NOTE|When using the [[Synaptics TouchPad driver for X]] with the SHMConfig-Option set to true in {{path|xorg.conf}}, starting a second X server breaks the Shared Memory and the touchpad can't be configured with {{cmd|synclient|}} any longer. Starting the dummy X server with a different xorg.conf file is a solution to this, a patch can be found in the [http://bugzilla.suspend2.net/show_bug.cgi?id=138 suspend2 bugzilla].}}
 +
 
 +
===Debian Notes===
 +
If your {{Debian}} doesn't have Xorg, yet, see [http://incubator.vislab.usyd.edu.au/roller/page/Steve/20040909 Installing a non-intrusive X.org server on Debian].
 +
 
 +
Sarge backports are available from [http://www.backports.org/ here].
 +
 
 +
For those running Squeeze or later the radeon driver now uses kernal-mode-settings (KMS) by default. At this time, squeeze/sid do not have power management support for radeon in KMS. To enable UMS (user mode settings) which uses the xorg.conf edits above (and therefore gives you power management) you must change modeset=1 to modest=0 in /etc/modprobe.d/radeon-kms. Additionally, on a t60 running squeeze "DynamicPM" "on" worked, whereas "DynamicClocks" "on" failed.
 +
 
 +
==Using the ATI proprietary driver==
 +
 
 +
Versions 8.19.10 and higher of the ATI [[fglrx]] driver support "PowerPlay", which "allows for the user to switch between power consumption modes".  
 +
 
 +
To list available modes do:
 +
:{{cmdroot|aticonfig  --list-powerstates}}
 +
:{{cmdresult|&nbsp;&nbsp;&nbsp;core/mem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[flags]}}
 +
:{{cmdresult|---------------}}
 +
:{{cmdresult|1: 105/122 MHz&nbsp;&nbsp;[low voltage]}}
 +
:{{cmdresult|2: 209/182 MHz&nbsp;&nbsp;[low voltage]}}
 +
:{{cmdresult|3: 297/230 MHz&nbsp;&nbsp;[default state]}}
  
 +
(Strangely, the same ThinkPad {{T43}} with [[ATI Mobility Radeon X300]] running [[fglrx]] 8.19.10 sometimes gives other, non-sensical results, perhaps due to interaction with [[rovclock]].)
  
==How to use it==
+
To changing the power mode on the fly:
After enabling it, my first question was how do I control it?  After reading about it, the answer is: you don't have to, it manages the power consumption for you.\
+
:{{cmdroot|1=aticonfig --set-powerstate=2 --effective=now}}
  
==X.org on Debian==
+
{{NOTE|The powerstate command is exclusive in newer versions of [[fglrx]]. All other commands will be ignored.}}
Because debian doesn't have X.org yet - [http://incubator.vislab.usyd.edu.au/roller/page/Steve/20040909 Installing a non-intrusive X.org server on Debian].
 
  
'''Update:''' X.org has made it into Debian.  See: [http://packages.debian.org/unstable/x11/xserver-xorg]
+
With newer driver versions (8.26 and later), <tt>atieventsd</tt> should dynamically change the power state and clock, depending on thermal conditions and AC plug.
  
There are also sarge backports available [http://www.backports.org/ here] or [http://people.debian.org/~nobse/xorg-x11/ here].
+
Limitations (as of [[fglrx]] 8.19.10):
 +
* You can't set the power state in {{path|/etc/X11/xorg.conf}} .
 +
* You can't activate power saving when using dual-head mode (e.g., LCD+CRT).
  
Add the following line to your repository list:
+
{{NOTE|[[fglrx]] power saving is not compatible with the [[Rovclock]] utility. Setting power saving mode using both [[fglrx]] and [[Rovclock]] results in an unusably slow desktop.}}
deb http://people.debian.org/~nobse/xorg-x11/ sarge main
 
  
==External Sources==
+
==External sources==
 
*[http://www.ati.com/products/pdf/powerplaywp2.pdf Marketing information from ATI]
 
*[http://www.ati.com/products/pdf/powerplaywp2.pdf Marketing information from ATI]
  
 +
=Other graphics chips=
 +
No instructions are presently known for other chips.
 +
 +
But see [[Problem with display remaining black after resume]].
 +
 +
=Recent kernel and X with kernel modesetting (KMS)=
 +
On recent systems (e.g. Ubuntu Maverick) with kernel modesetting
 +
echo profile > /sys/class/drm/card0/device/power_method
 +
echo low > /sys/class/drm/card0/device/power_profile
 +
switches to low power mode.
 +
(On a T43 this is too slow to play fullscreen video.) See also [http://www.overclock.net/linux-unix/731469-how-power-saving-radeon-driver.html Power saving with the Radeon driver].
  
 
[[Category:G40]] [[Category:G41]] [[Category:R32]] [[Category:R40]] [[Category:R40e]] [[Category:R50]] [[Category:R50e]] [[Category:R50p]] [[Category:R51]] [[Category:R52]] [[Category:T30]] [[Category:T40]] [[Category:T40p]] [[Category:T41]] [[Category:T41p]] [[Category:T42]] [[Category:T42p]] [[Category:T43]] [[Category:T43p]]
 
[[Category:G40]] [[Category:G41]] [[Category:R32]] [[Category:R40]] [[Category:R40e]] [[Category:R50]] [[Category:R50e]] [[Category:R50p]] [[Category:R51]] [[Category:R52]] [[Category:T30]] [[Category:T40]] [[Category:T40p]] [[Category:T41]] [[Category:T41p]] [[Category:T42]] [[Category:T42p]] [[Category:T43]] [[Category:T43p]]

Latest revision as of 21:22, 7 December 2010

ATI Radeon Mobility chips

Power saving with a framebuffer console

In order to use the dynamic GPU clock-scaling similar to what X.org has, you need to use the radeonfb kernel module. You'll need to enable the CONFIG_FB_RADEON in your kernel configuration. If setup correctly you should see something like the following in your kernel log:

radeonfb: Dynamic Clock Power Management enabled

Using the X.org Radeon driver

Activation

The xorg X server has support for a power saving feature from ATI called PowerPlay. Xorg calls this feature DynamicClocks. It can be enabled in the server by adding Option "DynamicClocks" "on" in the Device section in /etc/X11/xorg.conf

Section "Device"
       Identifier  "Videocard0"
       Driver      "radeon"
       VendorName  "IBM ThinkPad"
       BoardName   "ATI Radeon Mobility M9"
       Option      "DynamicClocks" "on"
EndSection

With this option enabled, the X11 server should print (/var/log/Xorg.0.log):

(**) RADEON(0): Option "DynamicClocks" "on"
(II) RADEON(0): Dynamic Clock Scaling Enabled

You do not need to do anything else, it dynamically manages the power consumption itself.

NOTE!
Enabling DynamicClocks crashes some models. If the CPU is entering one of the lower power states (C3 or lower) during Xorg startup the display may stay black. As a workaround disable DynamicClocks in Xorg and use Rovclock instead. But it does not scale the clocks to match the workload. Update 5/2/2006: Seems fixed in Xorg6.9

Problem with vbetool

When vbetool is used to restore the display state (as done by some suspend/resume scripts), the setting of DynamicClocks is forgotten and the GPU will consume more power until the next X server startup. You can manually enable DynamicTools again by starting a blank second X server (e.g., by running # X :1) and then exiting it via CtrlAltBackspace.

Problem with suspend-to-disk

Upon resume from suspend-to-disk, the setting of DynamicClocks is forgotten and the GPU will consume more power until the next X server startup. You can manually enable DynamicClocks again by starting a blank second X server (e.g., by running # X :1) and then exiting it via CtrlAltBackspace.

If you're using the hibernate script that's part of Software Suspend 2, setting UseDummyXServer to yes in hibernate.conf automatically starts a second X server, hence enabling DynamicClocks again. (Remember to disable UseDummyXServer if you switch to the fglrx driver, otherwise your computer will hang upon resume.)

NOTE!
{{{1}}}

Debian Notes

If your Debian doesn't have Xorg, yet, see Installing a non-intrusive X.org server on Debian.

Sarge backports are available from here.

For those running Squeeze or later the radeon driver now uses kernal-mode-settings (KMS) by default. At this time, squeeze/sid do not have power management support for radeon in KMS. To enable UMS (user mode settings) which uses the xorg.conf edits above (and therefore gives you power management) you must change modeset=1 to modest=0 in /etc/modprobe.d/radeon-kms. Additionally, on a t60 running squeeze "DynamicPM" "on" worked, whereas "DynamicClocks" "on" failed.

Using the ATI proprietary driver

Versions 8.19.10 and higher of the ATI fglrx driver support "PowerPlay", which "allows for the user to switch between power consumption modes".

To list available modes do:

# aticonfig --list-powerstates
   core/mem     [flags]
---------------
1: 105/122 MHz  [low voltage]
2: 209/182 MHz  [low voltage]
3: 297/230 MHz  [default state]

(Strangely, the same ThinkPad T43 with ATI Mobility Radeon X300 running fglrx 8.19.10 sometimes gives other, non-sensical results, perhaps due to interaction with rovclock.)

To changing the power mode on the fly:

# aticonfig --set-powerstate=2 --effective=now
NOTE!
The powerstate command is exclusive in newer versions of fglrx. All other commands will be ignored.

With newer driver versions (8.26 and later), atieventsd should dynamically change the power state and clock, depending on thermal conditions and AC plug.

Limitations (as of fglrx 8.19.10):

  • You can't set the power state in /etc/X11/xorg.conf .
  • You can't activate power saving when using dual-head mode (e.g., LCD+CRT).
NOTE!
fglrx power saving is not compatible with the Rovclock utility. Setting power saving mode using both fglrx and Rovclock results in an unusably slow desktop.

External sources

Other graphics chips

No instructions are presently known for other chips.

But see Problem with display remaining black after resume.

Recent kernel and X with kernel modesetting (KMS)

On recent systems (e.g. Ubuntu Maverick) with kernel modesetting

echo profile > /sys/class/drm/card0/device/power_method
echo low > /sys/class/drm/card0/device/power_profile 

switches to low power mode. (On a T43 this is too slow to play fullscreen video.) See also Power saving with the Radeon driver.