特殊:Badtitle/NS100:BinaryDriverHowto/Fglrx lowpower:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
第2行: 第2行:
{{Languages|UbuntuHelp:BinaryDriverHowto/Fglrx_lowpower}}
{{Languages|UbuntuHelp:BinaryDriverHowto/Fglrx_lowpower}}
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 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.  
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).
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'
* 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:
* In /etc/default/fglrx, uncomment/set:
<pre><nowiki>FGLRX_ACPI_SWITCH_POWERSTATES=true
<pre><nowiki>FGLRX_ACPI_SWITCH_POWERSTATES=true
</nowiki></pre>
</nowiki></pre>
* In /etc/default/acpi-support, uncomment/set:
* In /etc/default/acpi-support, uncomment/set:
<pre><nowiki>ENABLE_LAPTOP_MODE=true
<pre><nowiki>ENABLE_LAPTOP_MODE=true
</nowiki></pre>
</nowiki></pre>
* Then we need a modified version of /etc/acpi/fglrx-powermode.sh
* 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)
(if the script doesn't exist, it means you haven't got the fglrx driver installed)
<pre><nowiki>
<pre><nowiki>
mkdir ~/bin
mkdir ~/bin
第25行: 第18行:
chmod +x ~/bin/fglrx-powermode.sh
chmod +x ~/bin/fglrx-powermode.sh
</nowiki></pre>
</nowiki></pre>
* Next, edit/create ~/.gnomerc to call the new script (eg):
* Next, edit/create ~/.gnomerc to call the new script (eg):
sample ~/.gnomerc
sample ~/.gnomerc
<pre><nowiki>
<pre><nowiki>
#!/bin/bash
#!/bin/bash
~/bin/fglrx-powermode.sh
~/bin/fglrx-powermode.sh
</nowiki></pre>
</nowiki></pre>
* Set execute permissions on script
* Set execute permissions on script
<pre><nowiki>chmod +x ~/bin/fglrx-powermode.sh
<pre><nowiki>chmod +x ~/bin/fglrx-powermode.sh
</nowiki></pre>
</nowiki></pre>
* Now if you boot while on battery, ati-config --lsp should indicate the vid card as in low power mode.
* Now if you boot while on battery, ati-config --lsp should indicate the vid card as in low power mode.
<pre><nowiki>aticonfig --lsp
<pre><nowiki>aticonfig --lsp
core/mem [flags]
core/mem [flags]
第47行: 第34行:
2: 392/209 MHz [default state]
2: 392/209 MHz [default state]
</nowiki></pre>
</nowiki></pre>
=== Comments ===
=== Comments ===
Worked for me on my Dell D610.  On dapper, <code><nowiki>/etc/acpi</nowiki></code> has <code><nowiki>battery.d</nowiki></code> and <code><nowiki>ac.d</nowiki></code> directories.  The scripts in here are sourced (not executed) by the <code><nowiki>power.sh</nowiki></code> 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 <code><nowiki>/etc/default</nowiki></code>):
Worked for me on my Dell D610.  On dapper, <code><nowiki>/etc/acpi</nowiki></code> has <code><nowiki>battery.d</nowiki></code> and <code><nowiki>ac.d</nowiki></code> directories.  The scripts in here are sourced (not executed) by the <code><nowiki>power.sh</nowiki></code> 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 <code><nowiki>/etc/default</nowiki></code>):
<pre><nowiki>
<pre><nowiki>
第59行: 第44行:
I consider this a better solution than making a script for gnome to run.
I consider this a better solution than making a script for gnome to run.
-- JPKotta
-- JPKotta
I don't think this will set low power mode at boot up.
I don't think this will set low power mode at boot up.
-- fz
-- 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 <code><nowiki>/etc/acpi/{battery.d,ac.d}/ati.sh</nowiki></code>.  The 'new_state=' line is obviously different in the ac.d vs. battery.d scripts.
I somehow lost the fglrx_powermode.sh script.  So I reinvented the wheel and came up with this script which I put directly in <code><nowiki>/etc/acpi/{battery.d,ac.d}/ati.sh</nowiki></code>.  The 'new_state=' line is obviously different in the ac.d vs. battery.d scripts.
<pre><nowiki>
<pre><nowiki>
. /usr/share/acpi-support/power-funcs
. /usr/share/acpi-support/power-funcs
new_state=1
new_state=1
if [ -x /usr/bin/aticonfig ]; then  
if [ -x /usr/bin/aticonfig ]; then  
for x in /tmp/.X11-unix/*; do
for x in /tmp/.X11-unix/*; do

2007年11月30日 (五) 16:16的版本

{{#ifexist: :BinaryDriverHowto/Fglrx lowpower/zh | | {{#ifexist: BinaryDriverHowto/Fglrx lowpower/zh | | {{#ifeq: {{#titleparts:BinaryDriverHowto/Fglrx lowpower|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:BinaryDriverHowto/Fglrx lowpower|1|-1|}} | zh | | }}

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