个人工具

“UbuntuHelp:BinaryDriverHowto/Fglrx lowpower”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
{{From|https://help.ubuntu.com/community/BinaryDriverHowto/Fglrx lowpower}}
+
{{From|https://help.ubuntu.com/community/BinaryDriverHowto/Fglrx_lowpower}}
{{Languages|UbuntuHelp:BinaryDriverHowto/Fglrx lowpower}}
+
{{Languages|UbuntuHelp:BinaryDriverHowto/Fglrx_lowpower}}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+
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.
<html>
+
<head>
+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+
<meta name="robots" content="index,nofollow">
+
  
 +
This works for me, but YMMV. Use at your own risk. Interested to hear any/all feedback.
  
<title>BinaryDriverHowto/Fglrx - Community Ubuntu Documentation</title>
+
The following was written for Ubuntu 6.06 (Dapper Drake).
  
<script type="text/javascript">
+
* First install the fglrx driver & make sure you can run 'aticonfig --lsp'
<!--// common functions
+
  
// We keep here the state of the search box
+
* In /etc/default/fglrx, uncomment/set:
searchIsDisabled = false;
+
<pre><nowiki>FGLRX_ACPI_SWITCH_POWERSTATES=true
 +
</nowiki></pre>
  
function searchChange(e) {
+
* In /etc/default/acpi-support, uncomment/set:
    // Update search buttons status according to search box content.
+
<pre><nowiki>ENABLE_LAPTOP_MODE=true
    // Ignore empty or whitespace search term.
+
</nowiki></pre>
    var value = e.value.replace(/\s+/, '');
+
    if (value == '' || searchIsDisabled) {
+
        searchSetDisabled(true);
+
    } else {
+
        searchSetDisabled(false);
+
    }
+
}
+
  
function searchSetDisabled(flag) {
+
* Then we need a modified version of /etc/acpi/fglrx-powermode.sh
    // Enable or disable search
+
(if the script doesn't exist, it means you haven't got the fglrx driver installed)
    document.getElementById('fullsearch').disabled = flag;
+
    document.getElementById('titlesearch').disabled = flag;
+
}
+
  
function searchFocus(e) {
+
<pre><nowiki>
    // Update search input content on focus
+
mkdir ~/bin
    if (e.value == 'Search') {
+
cat /etc/acpi/fglrx-powermode.sh | sed 's/su \$user -c \"\(.*\)\"/\1/' > ~/bin/fglrx-powermode.sh
        e.value = '';
+
chmod +x ~/bin/fglrx-powermode.sh
        e.style.color = 'black';
+
</nowiki></pre>
        searchIsDisabled = false;
+
    }
+
}
+
  
function searchBlur(e) {
+
* Next, edit/create ~/.gnomerc to call the new script (eg):
    // Update search input content on blur
+
    if (e.value == '') {
+
        e.value = 'Search';
+
        e.style.color = 'gray';
+
        searchIsDisabled = true;
+
    }
+
}
+
  
function actionsMenuInit(title) {
+
sample ~/.gnomerc
    // Initiliaze action menu
+
<pre><nowiki>
    for (i = 0; i < document.forms.length; i++) {
+
#!/bin/bash
        var form = document.forms[i];
+
        if (form.className == 'actionsmenu') {
+
            // Check if this form needs update
+
            var div = form.getElementsByTagName('div')[0];
+
            var label = div.getElementsByTagName('label')[0];
+
            if (label) {
+
                // This is the first time: remove label and do buton.
+
                div.removeChild(label);
+
                var dobutton = div.getElementsByTagName('input')[0];
+
                div.removeChild(dobutton);
+
                // and add menu title
+
                var select = div.getElementsByTagName('select')[0];
+
                var item = document.createElement('option');
+
                item.appendChild(document.createTextNode(title));
+
                item.value = 'show';
+
                select.insertBefore(item, select.options[0]);
+
                select.selectedIndex = 0;
+
            }
+
        }
+
    }
+
}
+
//-->
+
</script>
+
  
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="/htdocs/ubuntu/css/common.css">
+
~/bin/fglrx-powermode.sh
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" href="/htdocs/ubuntu/css/screen.css">
+
</nowiki></pre>
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" href="/htdocs/ubuntu/css/print.css">
+
<link rel="stylesheet" type="text/css" charset="utf-8" media="projection" href="/htdocs/ubuntu/css/projection.css">
+
  
<link rel="Start" href="/community/UserDocumentation">
+
* Set execute permissions on script
<link rel="Alternate" title="Wiki Markup" href="/community/BinaryDriverHowto/Fglrx?action=raw">
+
<pre><nowiki>chmod +x ~/bin/fglrx-powermode.sh
<link rel="Alternate" media="print" title="Print View" href="/community/BinaryDriverHowto/Fglrx?action=print">
+
</nowiki></pre>
<link rel="Up" href="/community/BinaryDriverHowto">
+
<link rel="Search" href="/community/FindPage">
+
<link rel="Index" href="/community/TitleIndex">
+
<link rel="Glossary" href="/community/WordIndex">
+
<link rel="Help" href="/community/HelpOnFormatting">
+
</head>
+
  
<body  lang="en" dir="ltr">
+
* Now if you boot while on battery, ati-config --lsp should indicate the vid card as in low power mode.
  
    <script xmlns="" src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>
+
<pre><nowiki>aticonfig --lsp
            <script xmlns="" type="text/javascript"><![CDATA[
+
core/mem [flags]
                    _uacct = "UA-737845-5";
+
-----------------
                    urchinTracker();
+
* 1: 111/111 MHz [low voltage]
            ]]></script>
+
2: 392/209 MHz [default state]
<div id="header">
+
</nowiki></pre>
<div id="mastwrap"><div id="masthead">
+
<div id="logo"><a href="/community/UserDocumentation">Community Ubuntu Documentation</a></div>
+
  
<form id="searchform" method="get" action="">
+
=== Comments ===
<div>
+
<input type="hidden" name="action" value="fullsearch">
+
<input type="hidden" name="context" value="180">
+
<label for="searchinput">Search:</label>
+
<input id="searchinput" type="text" name="value" value="" size="20"
+
    onfocus="searchFocus(this)" onblur="searchBlur(this)"
+
    onkeyup="searchChange(this)" onchange="searchChange(this)" alt="Search">
+
<input id="titlesearch" name="titlesearch" type="submit"
+
    value="Titles" alt="Search Titles">
+
<input id="fullsearch" name="fullsearch" type="submit"
+
    value="Text" alt="Search Full Text">
+
</div>
+
</form>
+
<script type="text/javascript">
+
<!--// Initialize search form
+
var f = document.getElementById('searchform');
+
f.getElementsByTagName('label')[0].style.display = 'none';
+
var e = document.getElementById('searchinput');
+
searchChange(e);
+
searchBlur(e);
+
//-->
+
</script>
+
  
 +
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>
 +
cd /etc/acpi/battery.sh
 +
sudo ln -s ../fglrx_powermode.sh
 +
cd ../ac.d
 +
sudo ln -s ../fglrx_powermode.sh
 +
</nowiki></pre>
 +
I consider this a better solution than making a script for gnome to run.
 +
-- JPKotta
  
  <div id="sisternav">
+
I don't think this will set low power mode at boot up.
      <ul>
+
-- fz
        <li id="plain">
+
            <a href="https://help.ubuntu.com/6.06"
+
              accesskey="t">6.06 LTS</a>
+
        </li>
+
        <li id="plain">
+
            <a href="https://help.ubuntu.com/6.10"
+
              accesskey="t">6.10</a>
+
        </li>
+
        <li id="plain">
+
            <a href="https://help.ubuntu.com/7.04"
+
              accesskey="t">7.04</a>
+
        </li>
+
        <li id="current">
+
            <a href="https://help.ubuntu.com/community"
+
              accesskey="t">Community Docs</a>
+
        </li>
+
      </ul>
+
  </div>
+
  
</div></div>
+
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>
 +
. /usr/share/acpi-support/power-funcs
  
<ul class="extranav">
+
new_state=1
<li><a href="/community/UserDocumentation">User Documentation</a></li>
+
</ul>
+
  
</div>
+
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
 +
</nowiki></pre>
 +
If you want to run it at boot time, put a symlink to <code><nowiki>/etc/acpi/power.sh</nowiki></code> named something like <code><nowiki>/etc/rc2.d/S99powerstate</nowiki></code> (I have not tested this).
 +
--jpkotta
  
<div id="page" lang="en" dir="ltr"><!-- start page -->
+
----
 
+
[[category:CategoryCleanup]]
 
+
<h1 id="title"><a title="Click to do a full-text search for this title" href="/community/BinaryDriverHowto/Fglrx?action=fullsearch&amp;value=linkto%3A%22BinaryDriverHowto%2FFglrx%22&amp;context=180">BinaryDriverHowto/Fglrx</a></h1>
+
<div lang="en" id="content" dir="ltr">
+
<a id="top"></a>
+
<div lang="en" id="content" dir="ltr">
+
<a id="top"></a>
+
<p><strong>This page does not exist yet. You can create a new empty page, or use one of the page templates. Before creating the page, please check if a similar page already exists.</strong> </p>
+
<a href="/community/BinaryDriverHowto/Fglrx?action=edit">Create new empty page</a><p> </p>
+
<div>
+
<table>
+
<tr>
+
<td>
+
<p> <strong>Page templates:</strong> </p>
+
</td>
+
<td>
+
<p> <strong>Existing pages with similar names:</strong> </p>
+
</td>
+
</tr>
+
<tr>
+
<td style="vertical-align: top;">
+
<p> <ul>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=AideTemplate">AideTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=[[category:CategoryTemplate">CategoryTemplate</a></li>]]
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=DocumentationTemplate">DocumentationTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=HelpTemplate">HelpTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=HilfeTemplate">HilfeTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=HomepageTemplate">HomepageTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=PagePersonnelleTemplate">PagePersonnelleTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=Pr%c3%a9sentationTemplate">PrésentationTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=SlideShowHandOutTemplate">SlideShowHandOutTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=SlideShowTemplate">SlideShowTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=SlideTemplate">SlideTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=SupportPapierD'UnePr%c3%a9sentationTemplate">SupportPapierD'UnePrésentationTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=ThuisbladTemplate">ThuisbladTemplate</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=TransparentTemplate">TransparentTemplate</a></li>
+
</ul>
+
</p>
+
</td>
+
<td style="vertical-align: top;">
+
<p> <ul>
+
<li><a href="/community/BIND9ServerHowto">BIND9ServerHowto</a></li>
+
</ul>
+
<ul>
+
<li><a href="/community/BinaryDriverHowto">BinaryDriverHowto</a></li>
+
<li><a href="/community/BinaryDriverHowto/ATI">BinaryDriverHowto/ATI</a></li>
+
<li><a href="/community/BinaryDriverHowto/EiconDiva">BinaryDriverHowto/EiconDiva</a></li>
+
<li><a href="/community/BinaryDriverHowto/Fglrx_lowpower">BinaryDriverHowto/Fglrx lowpower</a></li>
+
<li><a href="/community/BinaryDriverHowto/KeyspanDriver">BinaryDriverHowto/KeyspanDriver</a></li>
+
<li><a href="/community/BinaryDriverHowto/MatroxParhelia">BinaryDriverHowto/MatroxParhelia</a></li>
+
<li><a href="/community/BinaryDriverHowto/Nvidia">BinaryDriverHowto/Nvidia</a></li>
+
<li><a href="/community/BinaryDriverHowto/ati">BinaryDriverHowto/ati</a></li>
+
</ul>
+
</p>
+
</td>
+
</tr>
+
</table>
+
</div>
+
<a id="bottom"></a>
+
 
+
</div>
+
<a id="bottom"></a>
+
 
+
</div>
+
 
+
</div> <!-- end page -->
+
 
+
 
+
<div id="footer">
+
 
+
  <div id="ubuntulinks">
+
    &copy; 2007 <a href="http://www.canonical.com">Canonical Ltd</a>. Ubuntu, Kubuntu, Edubuntu and Canonical are registered trademarks of Canonical Ltd.<br />
+
    <a href="http://www.ubuntu.com/feedback">Feedback</a> &mdash;
+
    <a href="http://www.ubuntu.com/legal">Legal</a> &mdash;
+
    <a href="https://wiki.ubuntu.com/wiki/credits">Credits</a><!-- &mdash;
+
    <a href="http://www.ubuntu.com/sitemap">Site Map</a>-->
+
  </div>
+
 
+
 
+
</div>
+
</body>
+
</html>
+
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年5月24日 (四) 09:06的版本

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 & 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