Linux Thermal Daemon (thermald) is a tool developed by Intel's Open Source Technology Center which monitors and controls the CPU temperature, preventing it from overheating.
Thermald tries to prevent the CPU from overheating without a significant impact on performance by using some specific Intel functions available in the Linux Kernel. According to the Ubuntu wiki, thermald can control cooling using:
- active or passive cooling devices as presented in sysfs
- the Running Average Power Limit (RAPL) driver (Sandybridge upwards)
- the Intel P-state CPU frequency driver (Sandybridge upwards)
- the CPU freq driver
- the Intel PowerClamp driver
It's worth mentioning that thermald applies various cooling methods only when the temperature reaches a certain threshold, so you may not notice a difference while using it if your laptop doesn't usually get very hot.
I couldn't find any information on what processors are supported by thermald on its official page, but according to a Debian wiki entry, it's supported to support Intel Sandy Bridge and newer CPUs only. Also, according to a bug report, thermald is buggy / doesn't properly support Haswell.
By default, thermald runs in zero configuration mode so after installing it, you don't need to configura anything however, if your ACPI configuration is buggy or you just want to fine tune it by adding more sensors and cooling devices, you can edit the thermald XML configuration file, located under /etc/thermald/thermal-conf.xml For more information about this, see the thermal-conf.xml man page ("man thermal-conf.xml")
How to enable intel_pstate in Ubuntu 14.04 and newer
This is for Ubuntu 14.04 and newer only! Don't use it in older Ubuntu versions or you may encounter various issues (see below).
While it's not mandatory, thermald should work better if Intel P-state is enabled. Intel P-state is not enabled by default in Ubuntu 14.04, but you can enable it easily (from what I've read, it's enabled by default in Fedora, Arch Linux and OpenSUSE for instance).
intel_pstate is a new power scaling driver for modern Intel CPUs (it supports Intel SandyBridge+ processors). According to Arjan van de Ven from Intel (for more info, see the comments he posted HERE), ondemand shouldn't be used any more and instead, modern Intel processors should use Intel P-state.
In Ubuntu, pstate is disabled by default because it didn't work properly a while back. It looks like the issues that resulted in intel_pstate being disabled by default in Ubuntu were fixed, but pstate is still not enabled by default in Ubuntu 14.04.
Note that while I didn't encounter any issues on my laptop running Ubuntu 14.04 with intel_pstate enabled and from what I've read, it works for others as well, it might not work properly for you so use it at your own risk and only enable it if you know how to disable it in case something goes wrong!
1. To enable intel_pstate in Ubuntu 14.04 (only enable it if your laptop is using Sandy Bridge or Ivy Bridge CPUs), edit the /etc/default/grub configuration file with a text editor as root - I'll use Gedit below:
gksu gedit /etc/default/grub
And for "GRUB_CMDLINE_LINUX_DEFAULT=" (it's on line 11 on my system), add "intel_pstate=enable", like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=enable"
Make sure you've changed the /etc/default/grub file properly or else your system may fail to boot! Once you're done, save the file and update Grub:
sudo update-grub
2. Restart your system and to check if intel_pstate is enabled, run the following command:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
The command above should return "intel_pstate".
To be able to use the "cpupower" commands below, you'll need to install "linux-tools-common" and "linux-tools-generic":
sudo apt-get install linux-tools-common linux-tools-generic
Another way of checking if Intel P-State is enabled is by using the following command:
cpupower frequency-info
And the output should be something like this:
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 0.97 ms.
hardware limits: 800 MHz - 3.10 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 800 MHz and 3.10 GHz.
The governor "performance" may decide which speed to use
within this range.
boost state support:
Supported: yes
Active: yes
25500 MHz max turbo 4 active cores
25500 MHz max turbo 3 active cores
25500 MHz max turbo 2 active cores
25500 MHz max turbo 1 active cores
If Intel Pstate is not enabled after following the steps above, it most probably means that your CPU doesn't support intel_pstate so you should disable it (simply remove "intel_pstate=enable" from /etc/default/grub and run "sudo update-grub").
3. With intel_pstate, there are only two cpufreq governors: performance and powersave (there's no "ondemand"). In my test, the "powersave" governor offered significantly better results so that's what I recommend. So try the powersave mode firstly and only if you're not satisfied with the results, switch to performance.
You can switch between the "performance" and "powersave" intel_pstate governors manually by using the following commands:
- use the "powersave" intel_pstate cpufreq governor:
sudo cpupower frequency-set -g powersave
- use the "performance" cpufreq intel_pstate governor:sudo cpupower frequency-set -g performance
You can see the currently active cpufreq governor by using the following command:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
4. If you want to make the "powersave" governor default in Ubuntu (using the commands above commands, the settings are lost after a reboot), firstly install cpufrequtils:
sudo apt-get install cpufrequtils
And then edit the /etc/init.d/cpufrequtils file and change GOVERNOR to "powersave" (GOVERNOR="powersave"). You can do this automatically by using the following command:
sudo sed -i 's/^GOVERNOR=.*/GOVERNOR="powersave"/' /etc/init.d/cpufrequtils
To revert this change and set the governor back to default (which is "ondemand" and that's not available for Intel P-State, but I'm adding this info in case you don't want to use Intel P-State any more), use the command below:
sudo sed -i 's/^GOVERNOR=.*/GOVERNOR="ondemand"/' /etc/init.d/cpufrequtils
It's also worth mentioning that TLP supports Intel P-State.
Install thermald
Thermald is available in the official Ubuntu 14.04 and 14.10 repositories. To install it, use the following command:
sudo apt-get install thermald
Thermald should then start automatically.Update: for Ubuntu 14.04, you can install the latest Thermald backported from Ubuntu 14.10 by using the WebUpd8 Backports PPA. Or you can manually download the deb from HERE.
Thermald is not available for older Ubuntu versions but you can compile it from source.
Arch Linux users can install thermald via AUR.
For other Linux distributions, search for Thermald in your distro's repositories or compile it from source.
Arch Linux users can install thermald via AUR.
For other Linux distributions, search for Thermald in your distro's repositories or compile it from source.
More info / references:
- https://01.org/linux-thermal-daemon/documentation/introduction-thermal-daemon
- https://wiki.debian.org/thermald
- https://wiki.ubuntu.com/Kernel/PowerManagement/ThermalIssues
- https://github.com/01org/thermal_daemon
thanks to apater for the tip!