I'm on a Compaq 615 and it's fan is loud. Not much you can do about that but I'm trying to keep the CPU/GPU as cool as possible. This is what Powertop has to say:
If I change all of them to "good", the changes don't survive a reboot.
I added the line to the "grub"-file as suggested here
How do I make the Powertop suggested "Tunables" permanent?
If you change all of them to good anyway, you could simply use the command
Call powertop auto-tune automatically at boot time
1.
On systems using
systemd
as startup manager (like Ubuntu) install it as a service:2.
On systems not using
systemd
, or if you want to use the old style with/etc/rc.local
file, add this line at the end to/etc/rc.local
:Note: if the script already contains
exit 0
be sure you place all commands before that line, cause that exits the scriptIf you want to set all to good but one line you could first auto-tune and then disable one setting with an extra line, for example, if you want to re-enable the touchscreen-device (at usb 2-7), add this before the
exit 0
:Note: on Linux with
systemd
, make sure /etc/rc.local is executed at startup by the compatibility serviceHere's how you can make the changes permanent:
This will generate a
powertop-xxxxxxxxxx-xxxxxx.html
file.Now either open that up in the browser and copy the
echo
commands from "... in need of Tuning" to/etc/rc.local
.Or extract the commands using something like this:
If
rc.local
containsexit 0
you need to make sure to put the commands before this line.You need to download and compile it because no one have the latest version
Download powertop https://01.org/powertop/downloads/2013/powertop-v2.3
powertop-2.3.tar.gz < < < Click & Download Me
Before compiling you need to install dependencies
Installing Dependencies ( Just copy paste the following commands )
Installing Powertop
To build and install PowerTOP type the following commands,
You can also use -j2 for how many cores you want to use in ./make.Replace -j2 with whatever number of CPU cores you want to use for the compilation process. for example i have used ./make -j8
Powertop is installed you can unplugged ac power and can run
However, most of the settings are not saved and they are lost after a reboot. You, can, however, make them permanent, by using the commands provided in the PowerTOP html report. To generate an HTML report, run the following command: webupd8.org
Implementing Powertop Suggestion On Battery And Back To Maximize Performance On Ac Power
For that you need to make a script that run powertop suggestion on battery and maximize the performance on ac power
Copy paste the following the following in power file
Now you need to assign execution permission of power script
Now when you Unplugged, Powertop suggestion will take over and maximize the battery life & you Plugged in AC power you will have Max Performance.
Helpfull Links
http://ubuntuforums.org/showthread.php?t=1855126&page=3 http://www.webupd8.org/2012/08/install-powertop-21-in-ubuntu-1204.html
For -j Option http://dnscrypt.org/
It's not the answer you're asking for, but you can try running in
laptop-mode
. To do this:Source: http://ubuntuforums.org/showthread.php?t=1157408&p=7271995#post7271995 (by Axx83)
Udev rules
For permanent power savings that configure settings directly at the source, instead of creating scripts or relying on possible not installed packages. Thus as soon as hardware gets added by
udev
your settings are applied.A correct
udev
rule makes the settings not apply when the hardware is not there, thus making the configuration more portable. And you learn more about the inner workings of your Linux kernel :-). The configuration made this way, do also apply when not running on battery.An example for tunable
Enable SATA link power Managmenet for host0
. The suggestion is to:This already gives you an idea where the hardware is: in /sys/class/scsi_host. You can verify this with:
Better not touch the system udev rules in /lib/udev/rules.d/ and create your own udev rule file roughly at level 60 in /etc/udev/rules.d/. For example with the nano editor:
Some other examples write rules like:
I would say don't and make your rule even better by only applying it when the link power management policy is set to max_performance. Have a look at the little difference (look for the double equation sign):
Test you rule with
udevadm test /devices/…
:I can't find a way to apply the rule, so in this case I did a reboot to apply the newly created udev rule.
systemd makes it easy:
Save the unit file,
kill -HUP 1
,systemctl enable --now powertop-autotune.service
, done!P.S. if you need any exceptions to what
--auto-tune
does, just add moreExecStart
lines to set your own settings.This link talks about the same is talking about the same issue:
https://bbs.archlinux.org/viewtopic.php?pid=860406
I am interested in the solution by myself and will try later. Tell me If you can manage to implement this solution.
I couldnt get it running as the system always told me permission denied to run the executable file.
However this seems to work:
http://philatwarrimoo.blogspot.com/2011/06/powertop-howto-enable-device-power.html
I used the short command and run it with sudo.
As a semi automatic solution I created a launcher:
the script is as follows:
Is there a way to prevent asking for my password?
I solved this by creating a dash script
/root/power_save.sh
:Set it as executable:
And add it to root crontab with
sudo crontab -e
:You can use TLP to set your power saving settings from Powertop, and by enabling the service they will be set on each boot.
Per rubo77's answer, I'm running
powertop --auto-tune
in/etc/rc.local
and then undoing one of the changes it does by default to a USB device that I don't want to do.However, since the device I want to disable auto power control for is an external USB device that could potentially appear with a different
/sys
tree device number, I did a bit more scripting to dynamically identify it:where
VENDOR
andPRODUCT
are set to the USB vendor and product IDs in lower case hex.These are available by
identifying the device in the
lsusb
output (IDs appear there in the formaaaa:bbbb
), orobserving the command that powertop runs when you toggle the power setting, going to the device's current
/sys/bus/usb/devices/*
directory, and getting the values from the currentidProduct
andidVendor
files.