个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示2个用户的13个中间版本)
第1行: 第1行:
{{From|https://help.ubuntu.com/community/BinaryDriverHowto/Fglrx lowpower}}
+
{{From|https://help.ubuntu.com/community/BinaryDriverHowto/Fglrx_lowpower}}
{{Languages|php5}}
+
{{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>
+
This works for me, but YMMV. Use at your own risk. Interested to hear any/all feedback.
<head>
+
The following was written for Ubuntu 6.06 (Dapper Drake).
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+
* First install the fglrx driver  by installing the xorg-driver-fglrx package from the Restricted Repository & make sure you can run 'aticonfig --lsp'
<meta name="robots" content="index,nofollow">
+
* In /etc/default/fglrx, uncomment/set:
 +
<pre><nowiki>
 +
FGLRX_ACPI_SWITCH_POWERSTATES=true
 +
</nowiki></pre>
 +
* In /etc/default/acpi-support, uncomment/set:
 +
<pre><nowiki>
 +
ENABLE_LAPTOP_MODE=true
 +
</nowiki></pre>
 +
* 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)
 +
<pre><nowiki>
 +
mkdir ~/bin
 +
cat /etc/acpi/fglrx-powermode.sh | sed 's/su \$user -c \"\(.*\)\"/\1/' > ~/bin/fglrx-powermode.sh
 +
chmod +x ~/bin/fglrx-powermode.sh
 +
</nowiki></pre>
 +
* Next, edit/create ~/.gnomerc to call the new script (eg):
 +
sample ~/.gnomerc
 +
<pre><nowiki>
 +
#!/bin/bash
  
 +
~/bin/fglrx-powermode.sh
 +
</nowiki></pre>
 +
* Set execute permissions on script
 +
<pre><nowiki>
 +
chmod +x ~/bin/fglrx-powermode.sh
 +
</nowiki></pre>
 +
* Now if you boot while on battery, ati-config --lsp should indicate the vid card as in low power mode.
 +
<pre><nowiki>
 +
aticonfig --lsp
 +
    core/mem [flags]
 +
-----------------
 +
* 1: 111/111 MHz [low voltage]
 +
  2: 392/209 MHz [default state]
 +
</nowiki></pre>
 +
=== 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>):
 +
<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
 +
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 <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
  
<title>BinaryDriverHowto/Fglrx - Community Ubuntu Documentation</title>
+
new_state=1
  
<script type="text/javascript">
+
if [ -x /usr/bin/aticonfig ]; then
<!--// common functions
+
     for x in /tmp/.X11-unix/*; do
 
+
        displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
// We keep here the state of the search box
+
         getXuser;
searchIsDisabled = false;
+
         if [ x"$XAUTHORITY" != x"" ]; then     
 
+
             export DISPLAY=":$displaynum"
function searchChange(e) {
+
            /usr/bin/aticonfig --set-powerstate=$new_state
     // Update search buttons status according to search box content.
+
         fi
    // Ignore empty or whitespace search term.
+
    done
    var value = e.value.replace(/\s+/, '');
+
fi
    if (value == '' || searchIsDisabled) {
+
</nowiki></pre>
        searchSetDisabled(true);
+
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).
    } else {
+
--jpkotta
        searchSetDisabled(false);
+
    }
+
}
+
 
+
function searchSetDisabled(flag) {
+
    // Enable or disable search
+
    document.getElementById('fullsearch').disabled = flag;
+
    document.getElementById('titlesearch').disabled = flag;
+
}
+
 
+
function searchFocus(e) {
+
    // Update search input content on focus
+
    if (e.value == 'Search') {
+
         e.value = '';
+
         e.style.color = 'black';
+
        searchIsDisabled = false;
+
    }
+
}
+
 
+
function searchBlur(e) {
+
    // Update search input content on blur
+
    if (e.value == '') {
+
        e.value = 'Search';
+
        e.style.color = 'gray';
+
        searchIsDisabled = true;
+
    }
+
}
+
 
+
function actionsMenuInit(title) {
+
    // Initiliaze action menu
+
    for (i = 0; i < document.forms.length; i++) {
+
        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">
+
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" href="/htdocs/ubuntu/css/screen.css">
+
<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">
+
<link rel="Alternate" title="Wiki Markup" href="/community/BinaryDriverHowto/Fglrx?action=raw">
+
<link rel="Alternate" media="print" title="Print View" href="/community/BinaryDriverHowto/Fglrx?action=print">
+
<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">
+
 
+
    <script xmlns="" src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>
+
            <script xmlns="" type="text/javascript"><![CDATA[
+
                    _uacct = "UA-737845-5";
+
                    urchinTracker();
+
             ]]></script>
+
<div id="header">
+
<div id="mastwrap"><div id="masthead">
+
<div id="logo"><a href="/community/UserDocumentation">Community Ubuntu Documentation</a></div>
+
 
+
<form id="searchform" method="get" action="">
+
<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>
+
 
+
 
+
  <div id="sisternav">
+
      <ul>
+
         <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>
+
 
+
<ul class="extranav">
+
<li><a href="/community/UserDocumentation">UserDocumentation</a></li>
+
</ul>
+
 
+
</div>
+
 
+
<div id="page" lang="en" dir="ltr"><!-- start page -->
+
 
+
 
+
<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=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]]

2010年5月19日 (三) 21:42的最新版本

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