Because I use only laptops, temperature control is important. I don't like loud fans and hot keyboards. Existing power management utilities work well when laptops are running on batteries, but then disable power management features when laptops are plugged in. Therefore, I now manually configure all power management settings. I haven't noticed any performance impacts.
I suspect this post will be a continual work-in-progress, because these things seem to change from time to time.
Kernel boot parameters
These items are in /etc/default/grub, between the quotes on the line that begins with GRUB_CMDLINE_LINUX_DEFAULT:
A kernel boot line containing all these would be:
Note: the i915 parameters are useful only if your computer has Intel graphics.
Temperature sensors and ThinkFan
Install the package lm-sensors and then run sudo sensors-detect to query your computer for available sensors. Answer "yes" to all the questions. When the script ends, it will offer to write at least one module -- probably coretemp -- to /etc/modules. Finally, run sudo service module-init-tools start (*buntu 13.04 and earlier) or sudo service kmod start (*buntu 13.10 and later) to activate the module.
Now what you can do with this is system-dependent. You can run sensors to see the current state of hardware sensors in your computer. If you have a ThinkPad, you might consider installing thinkfan, which enables extended fan control functionality of thinkpad_acpi. Configuring ThinkFan is a multi-step process. Here's what I did.
Shell script to enable power managment features
Essentially, this script automates enabling all the "tunables" that the power configuration utility powertop allows you to. Create the file /etc/init.d/z-powerlevels and add these lines:
Register the script with Upstart:
After all of the above, my X1 draws about 11 watts with wireless in use and the screen at 50% brightness. The fan cycles up and down as needed and the keyboard is slightly warm but not hot.
I suspect this post will be a continual work-in-progress, because these things seem to change from time to time.
Kernel boot parameters
These items are in /etc/default/grub, between the quotes on the line that begins with GRUB_CMDLINE_LINUX_DEFAULT:
- acpi_osi=Linux ... allows the kernel to support some ACPI features that the BIOS would otherwise disable if the BIOS detects Windows isn't running
- pcie_aspm=force ... enable PCI Express power management forcibly
- i915.i915_enable_rc6=1 ... Intel graphics power saving render (remove if you experience random hangs)
- i915.i915_enable_fbc=1 ... Intel graphics frame buffer compression
- i915.lvds_downclock=1 ... panel downclocking
A kernel boot line containing all these would be:
Code:
GRUB_CMDLINE_LINUX_DEFAULT="acpi_osi=Linux pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1"
Temperature sensors and ThinkFan
Install the package lm-sensors and then run sudo sensors-detect to query your computer for available sensors. Answer "yes" to all the questions. When the script ends, it will offer to write at least one module -- probably coretemp -- to /etc/modules. Finally, run sudo service module-init-tools start (*buntu 13.04 and earlier) or sudo service kmod start (*buntu 13.10 and later) to activate the module.
Now what you can do with this is system-dependent. You can run sensors to see the current state of hardware sensors in your computer. If you have a ThinkPad, you might consider installing thinkfan, which enables extended fan control functionality of thinkpad_acpi. Configuring ThinkFan is a multi-step process. Here's what I did.
- Find and document temperature sensors
Code:sudo -i cd / find -iname '*temp*input*' >/tmpin exit
- Set up ThinkFan
- Install it:
Code:sudo apt-get install thinkfan
- Create the configuration file for the thinkpad_acpi kernel module to enable fan control:
Code:sudo nano /etc/modprobe.d/thinkfan.conf
- Add the following line to the file, then save and exit the editor:
Code:options thinkpad_acpi fan_control=1
- Edit the service file for ThinkFan:
Code:sudo nano /etc/default/thinkfan
- change the START line to enable the service, then save and exit the editor:
Code:START=yes
- Edit the configuration file for ThinkFan:
Code:sudo nano /etc/thinkfan.conf
- Cursor to a blank line above the temperature setting lines that look like "(nn nn nn)"
- Insert the contents of the file /tmpin
- Type the word sensor in front of each inserted line, type a space, and remove the leading period
- Exit the editor and delete /tmpin
- Run it
Code:sudo /etc/init.d/thinkfan start
- Install it:
Shell script to enable power managment features
Essentially, this script automates enabling all the "tunables" that the power configuration utility powertop allows you to. Create the file /etc/init.d/z-powerlevels and add these lines:
Code:
#! /bin/sh echo 0 > /proc/sys/kernel/nmi_watchdog echo 1 | tee /sys/devices/system/cpu/sched_*_power_savings > /dev/null echo auto | tee /sys/bus/*/devices/*/power/control > /dev/null echo min_power | tee /sys/class/scsi_host/host*/link_power_management_policy > /dev/null echo 1 > /sys/module/snd_hda_intel/parameters/power_save iwconfig wlan0 power on
Code:
chmod a+x /etc/init.d/z-powerlevels sudo update-rc.d z-powerlevels defaults
After all of the above, my X1 draws about 11 watts with wireless in use and the screen at 50% brightness. The fan cycles up and down as needed and the keyboard is slightly warm but not hot.
Comment