PDA

View Full Version : Do you have F15 on a Laptop and crappy battery life? Try this...


sillav
12th July 2011, 07:02 PM
Explanation is here, but solution is to

"pcie_aspm=force" to their boot command line

http://www.phoronix.com/scan.php?page=article&item=linux_2638_aspm&num=2

solinem
18th August 2011, 07:46 AM
Well, and how do I add the following command:
"pcie_aspm=force"
to my boot command line?

Iron_Mike
18th August 2011, 08:46 AM

Open a terminal window and change to root with "su -" and type:

gedit /boot/grub/grub.conf

flebber
18th August 2011, 12:19 PM
I got it working following this post http://forums.fedoraforum.org/showpost.php?p=1490811&postcount=8 with the command.
sudo sed -e 's/ ro / ro pcie_aspm=force/' -i /etc/grub.conf

solinem
18th August 2011, 10:22 PM
Thanks to all of you!
It seems the battery of my Toshiba is now performing as it was before I installed Fedora 15

marko
18th August 2011, 10:44 PM
Another laptop issue with power is that some laptops like the Sonys and Asus's have dual video cards. Their cards might depend on a particular closed driver to turn the idle card off when a card is being used for video. Under Linux we don't have that proprietary driver and the open drivers may not handle the power on/off and so both cards will draw power even if you just use one. This is being worked around but it needs a very new kernel (3.0 kernels will fix this) to have support for dual cards.

Dutchy
18th August 2011, 10:52 PM
I tried that boot command line but unfortunately it gives me weird graphical artefacts.
My battery life was really, really poor and I've found the following solutions:
Laptop-mode-tools and a custom power.d script build myself from googling Powertop advices.

However the biggest power drainer was my second/discrete graphic card (I've got an Asus with nVidia not so Optimus, which is a bit useless in Linux by default for now).
I found a way to disable it with Asus-switcheroo and it saves me around 15 watt!

Now I'm easily getting 3 hours out of it instead of 1 and it is even better than with Windows!

Some sources which could help you save power:
docs.fedoraproject.org/en-US/Fedora/14/html/Power_Management_Guide (http://docs.fedoraproject.org/en-US/Fedora/14/html/Power_Management_Guide/index.html)
thinkwiki.org (http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption)
lesswatts.org (http://www.lesswatts.org/)
samwel.tk/laptop_mode (http://samwel.tk/laptop_mode/)
en.wikipedia.org/wiki/PowerTOP (http://en.wikipedia.org/wiki/PowerTOP)
github.com/awilliam/asus-switcheroo (https://github.com/awilliam/asus-switcheroo)
github.com/Bumblebee-Project/Bumblebee (https://github.com/Bumblebee-Project/Bumblebee)

marko
18th August 2011, 11:00 PM
Dutchy:

There is also "acpi_call" which something you can grab from https://github.com/mkottman/acpi_call
You'd need to compile and install it so the "acpi_call.ko" module gets loaded.

BUT the good news is vgaswitcheroo is in 2.6.40-4 anyway and you can turn off the video card pretty easily now and don't need acpi_call ... I suppose that's what you're using:

echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

I don't need acpi_call anymore to turn off the extra card, but I still use it because my Asus UL30VT has no other way to control the brightness (yet). I think that will eventually
be fixed.

Dutchy
19th August 2011, 12:18 PM
You're right, that's the one and it is indeed in there now!
I didn't notice it because it kept booting 2.6.40.3-0.fc15.x86_64 in favour of 2.6.40-4.fc15.x86_64 for which I still had to install it manually.

I think it's because of the alphabetical order:
2.6.40.3-0.fc15.x86_64
2.6.40-4.fc15.x86_64
2.6.38.6-26.rc1.fc15.x86_64

Guess it's really time for grub2.

For anyone who's interested, here are some parts of my sleep.d powersave script.
You do want to tweak it to your setup because some parts might cause annoying side effects with the pci devices (such as delays on a usb mouse or even hibernate and power off problems. Should be harmless though).
If that is the case you'll need to troubleshoot it with Powertop and/or lspci (or a graphical tool like gnome-device-manager).
If you are using laptop-mode-tools remember that some of these savings are already taken care of even though Powertop says different.
To try it out run the lines as root and when you're ready put the script in /etc/pm/power.d with execution rights and it should be automatically run when on battery (if i'm correct however it also could be triggered by laptop-mode-tools).
You can also control it manually with sudo pm-powersave true / false

Power save script:
#!/bin/sh
# Generic /etc/pm/power.d powersave script.
on() {
# All pci devices:
find /sys/devices/pci* -path "*power/control" -exec bash -c "echo auto > '{}'" \;
# SATA Link Power Management:
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
# Power Aware CPU scheduler:
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
# VM Writeback:
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
# nVidia (Optimus) off (vgaswitcheroo/switch, only useful with second graphic card and kernel 3.0+):
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
}

off() {
# All pci devices:
find /sys/devices/pci* -path "*power/control" -exec bash -c "echo on > '{}'" \;
# SATA Link Power Management:
echo max_performance > /sys/class/scsi_host/host0/link_power_management_policy
# VM Writeback:
echo 500 > /proc/sys/vm/dirty_writeback_centisecs
# Power Aware CPU scheduler:
echo 2 > /sys/devices/system/cpu/sched_mc_power_savings
# nVidia (Optimus) off (should stay off):
#echo ON > /sys/kernel/debug/vgaswitcheroo/switch
}

case $1 in
true) on;;
false) off;;
*) exit $NA;;
esac

As basis I used some script from /usr/lib64/pm-utils/sleep.d.
I actually don't really know what $NA;; does so I just left it in there.
Hope this might be useful for someone.

sbjaved
5th September 2011, 10:34 PM
Dutchy:

There is also "acpi_call" which something you can grab from https://github.com/mkottman/acpi_call
You'd need to compile and install it so the "acpi_call.ko" module gets loaded.

BUT the good news is vgaswitcheroo is in 2.6.40-4 anyway and you can turn off the video card pretty easily now and don't need acpi_call ... I suppose that's what you're using:


I don't need acpi_call anymore to turn off the extra card, but I still use it because my Asus UL30VT has no other way to control the brightness (yet). I think that will eventually
be fixed.
when I try to run echo > OFF, I get this:

[root@saad-dell-xps-15 ~]# echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
-bash: /sys/kernel/debug/vgaswitcheroo/switch: No such file or directory


Here's my lspci:

[saad@saad-dell-xps-15 ~]$ lspci -vnnn | grep VGA
00:02.0 VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0116] (rev 09) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller [0300]: nVidia Corporation GF106 [GeForce GT 555M SDDR3] [10de:0df4] (rev a1) (prog-if 00 [VGA controller])


lsmod lists nouveau and i915 modules for video.