个人工具

UbuntuHelp:BinaryDriverHowto/Fglrx lowpower

来自Ubuntu中文

跳转至: 导航, 搜索

This is an ugly hack to get a Radeon video card to run on low power when running off batteries. It saves quite a bit of power, but it's known that enabling low power mode on the fglrx driver can cause "mysterious hangs", so be aware of that. However, when it works, battery life is considerably improved. This works for me, but YMMV. Use at your own risk. Interested to hear any/all feedback. The following was written for Ubuntu 6.06 (Dapper Drake).

  • First install the fglrx driver by installing the xorg-driver-fglrx package from the Restricted Repository & make sure you can run 'aticonfig --lsp'
  • In /etc/default/fglrx, uncomment/set:
FGLRX_ACPI_SWITCH_POWERSTATES=true
  • In /etc/default/acpi-support, uncomment/set:
ENABLE_LAPTOP_MODE=true
  • Then we need a modified version of /etc/acpi/fglrx-powermode.sh

(if the script doesn't exist, it means you haven't got the fglrx driver installed)

mkdir ~/bin
cat /etc/acpi/fglrx-powermode.sh | sed 's/su \$user -c \"\(.*\)\"/\1/' > ~/bin/fglrx-powermode.sh
chmod +x ~/bin/fglrx-powermode.sh
  • Next, edit/create ~/.gnomerc to call the new script (eg):

sample ~/.gnomerc

#!/bin/bash

~/bin/fglrx-powermode.sh
  • Set execute permissions on script
chmod +x ~/bin/fglrx-powermode.sh
  • Now if you boot while on battery, ati-config --lsp should indicate the vid card as in low power mode.
aticonfig --lsp
    core/mem [flags]
-----------------
* 1: 111/111 MHz [low voltage]
  2: 392/209 MHz [default state]

Comments

Worked for me on my Dell D610. On dapper, /etc/acpi has battery.d and ac.d directories. The scripts in here are sourced (not executed) by the power.sh script on switching of power modes. In most cases, there is no difference between sourcing and executing. I just linked the fglrx script into the two directories (after editing the files in /etc/default):

cd /etc/acpi/battery.sh
sudo ln -s ../fglrx_powermode.sh
cd ../ac.d
sudo ln -s ../fglrx_powermode.sh

I consider this a better solution than making a script for gnome to run. -- JPKotta I don't think this will set low power mode at boot up. -- fz I somehow lost the fglrx_powermode.sh script. So I reinvented the wheel and came up with this script which I put directly in /etc/acpi/{battery.d,ac.d}/ati.sh. The 'new_state=' line is obviously different in the ac.d vs. battery.d scripts.

. /usr/share/acpi-support/power-funcs

new_state=1

if [ -x /usr/bin/aticonfig ]; then 
    for x in /tmp/.X11-unix/*; do
        displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
        getXuser;
        if [ x"$XAUTHORITY" != x"" ]; then      
            export DISPLAY=":$displaynum"
            /usr/bin/aticonfig --set-powerstate=$new_state
        fi
    done
fi

If you want to run it at boot time, put a symlink to /etc/acpi/power.sh named something like /etc/rc2.d/S99powerstate (I have not tested this). --jpkotta