You are not logged in.

#1 2014-07-19 12:07:58

ValdikSS
Member
Registered: 2011-03-30
Posts: 31

Let's test thermald fan control feature

Hello
I like thermald a lot, it allows to manually control throttling and temperature modes, but it can't detect fans automatically, and there is almost no documentation of configuration file.
With the help of the developer, I've managed thermald to control my CPU fan on Lenovo ThinkPad X220, and it's pretty efficient.

Here is what you'll need:
1. Thermald from development_0 branch (or just add latest commit as patch to the current PKGBUILD in AUR) Fixed in AUR
2. Write your own thermald-conf.xml. You should describe trip points and multiple fans, although it could be just one fan with different minimum and maximum values. Here is my config
3. Make sure userspace fan control is enabled. For thinkpads, you should load thinkpad_acpi module with fan_control=1 option and write "1" to /sys/devices/platform/thinkpad_hwmon/pwm1_enable
4. Run thermald. You can start it in debug mode with:

sudo thermald --no-daemon --loglevel=debug

Post your results here. With thermald, my laptop runs 5-8°C cooler and fan is running more predictable.

Last edited by ValdikSS (2014-07-20 17:02:49)

Offline

#2 2014-07-19 12:38:00

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,112

Re: Let's test thermald fan control feature

This development is interesting particularly for laptops. One question that would be useful to know the answer to is whether there is any advantage to running thermald for a passively cooled system i.e. a fanless system?  Is there additional control for intel p-states that thermald can do over and above the normal thermal control in the kernel for such systems?


Mike C

Offline

#3 2014-07-19 12:59:08

ValdikSS
Member
Registered: 2011-03-30
Posts: 31

Re: Let's test thermald fan control feature

mcloaked wrote:

whether there is any advantage to running thermald for a passively cooled system i.e. a fanless system?

Yes. thermald was designed for fanless systems, for android on intel particularly.

Offline

#4 2014-07-20 05:30:46

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Let's test thermald fan control feature

This is quite interesting.  I will have to give this a whirl tomorrow.  I have looked through the default XML file before and it looked quite scary.  Your config is really quite simple and easy to understand.

(Honestly, I am just posting here so that this thread will show in 'Posted')

Offline

#5 2014-07-20 20:08:07

qwerty12
Member
From: London
Registered: 2011-06-20
Posts: 34

Re: Let's test thermald fan control feature

Hi,

Thanks, ValdikSS. I stole your config file and am using it as-is (I have an X230). The issue I was having was getting pwm1_enable set to 1 on startup. I tried systemd-tmpfiles.d but pwm1_enable was still 2. This worked to set it to 1 but pwm1 was staying stuck at 255 and thermald was clearly having no effect. So I disabled thermald and had the udev rule start it:

ACTION=="add", DRIVERS=="thinkpad_hwmon", ATTR{pwm1_enable}="1", TAG+="systemd", ENV{SYSTEMD_WANTS}="thermald"

After that, it seems to be working well on my laptop. Thanks again. Here's my output (on battery power, KDE and Chromium with six tabs open [one Flash]): http://slexy.org/view/s2rJPVMOtq


Sensors and pwm:

sensors ; sensors ; cat /sys/devices/platform/thinkpad_hwmon/pwm1
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +49.0°C  (high = +87.0°C, crit = +105.0°C)
Core 0:         +35.0°C  (high = +87.0°C, crit = +105.0°C)
Core 1:         +49.0°C  (high = +87.0°C, crit = +105.0°C)

thinkpad-isa-0000
Adapter: ISA adapter
fan1:        2967 RPM

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +49.0°C  (high = +87.0°C, crit = +105.0°C)
Core 0:         +35.0°C  (high = +87.0°C, crit = +105.0°C)
Core 1:         +49.0°C  (high = +87.0°C, crit = +105.0°C)

thinkpad-isa-0000
Adapter: ISA adapter
fan1:        2967 RPM

36

Last edited by qwerty12 (2014-07-20 20:09:33)

Offline

#6 2014-07-20 20:10:50

ValdikSS
Member
Registered: 2011-03-30
Posts: 31

Re: Let's test thermald fan control feature

qwerty12, does it run cooler?

Offline

#7 2014-07-20 20:38:57

qwerty12
Member
From: London
Registered: 2011-06-20
Posts: 34

Re: Let's test thermald fan control feature

Y'know, that's a good question... it feels cooler IMO but the temperatures reported back by sensors are similar to the temperatures I get when running without it. My savings aren't so great if I look at sensors - it's a degree or two less when running at around the same fan speed.

EDIT: It's definitely cooler when running on AC. Prior to thermald, the X230 would heat up heavily then.

Last edited by qwerty12 (2014-07-20 21:45:49)

Offline

#8 2014-07-26 14:43:08

jeanbroid
Member
Registered: 2013-07-06
Posts: 10

Re: Let's test thermald fan control feature

qwerty12, I have an x230 too, I created a file in /etc/udev/rules.d/ with the line you provided.
Yet it's not working : thermlad is not loaded at boot and pwm1_enable is still at 2.

did you do something else ?

Offline

#9 2014-08-21 16:35:20

qwerty12
Member
From: London
Registered: 2011-06-20
Posts: 34

Re: Let's test thermald fan control feature

@jeanbroid

Sorry, I've not been checking the Arch forums while I've been going from around 150 open ArchWiki tabs down to around three... Like ValdikSS said in his initial post, you need to tell thinkpad_acpi to allow userspace programs to set the fan speed.

Creating /etc/modprobe.d/thinkpad_acpi.conf with this inside:

options thinkpad_acpi fan_control=1

will do it.

There's also the issue of starting thermald. It can only be started after pwm1_enable is written to, which is what my udev rule does above. Sometimes, though, I ran into an issue where thermald would start but my fan would be on full blast and thermald wouldn't touch the pwm1 file until I restarted it. I use this udev rule which sets the fan level to a reasonable value while thermald prepares to take control:

ACTION=="add", DRIVERS=="thinkpad_hwmon", ATTR{pwm1_enable}="1", ATTR{pwm1}="128", TAG+="systemd", ENV{SYSTEMD_WANTS}="thermald"

For my issue of thermald not actually working when started, it was either a race condition in something out of my control that magically fixed itself or creating /etc/modules-load.d/thermale.conf with the following contents worked (they're both Sandybridge[+]-specific modules):

intel_powerclamp
intel_rapl

If you're still having issues with thermald not actually controlling the fan on bootup even though you've set everything up correctly, the other option is getting systemd to start it as an idle service, which in my case meant thermald would start a few seconds after KDM was displaying itself. Try this as a last resort, though. To do it: /etc/systemd/system/thermald.service.d/type.conf:

[Service]
Type=
Type=idle

I was running mprime with thermald and the EC would never push the fan above ~4378 RPM at 84 degrees Celsius. With thermald running, it took much longer to get to 83 and the top-left corner of my laptop actually remained pretty cool so I have no plans to stop using thermald here.

Last edited by qwerty12 (2014-08-21 16:50:34)

Offline

#10 2014-08-22 08:19:26

jeanbroid
Member
Registered: 2013-07-06
Posts: 10

Re: Let's test thermald fan control feature

@qwerty12

Thanks a lot for this thorough answer :-)

I guess I'll restart from the beginning and try to get it running !

Offline

#11 2014-08-24 00:38:02

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 6,145

Re: Let's test thermald fan control feature

This does look interesting, especially since I've noticed that my fan RPM does not seem to track temperatures at all well. (Like WonderWoofy, though, I'm mostly posting so I can easily find this again.)

Maybe this should make it into the wiki? Or is it not yet settled enough for that, do you think?


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Corporation Wireless 8265 / 8275 | US keyboard with Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#12 2014-08-24 09:51:23

ValdikSS
Member
Registered: 2011-03-30
Posts: 31

Re: Let's test thermald fan control feature

@cfr, It would be nice if someone (maybe me) documents this to wiki, but there are a lot of software for just controlling the fan.

Offline

#13 2014-08-27 22:49:36

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 6,145

Re: Let's test thermald fan control feature

ValdikSS wrote:

@cfr, It would be nice if someone (maybe me) documents this to wiki, but there are a lot of software for just controlling the fan.

But you wouldn't need to document the rest! The wiki works by people documenting the bits they know, including all the hardware-specific tweaks which enable stuff to work on laptops etc.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Corporation Wireless 8265 / 8275 | US keyboard with Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB