How to reduce annoying fan noise

The most annoying thing about my Librem 15v4 laptop (and perhaps other models) is the on-again-off-again fan noise. At least, it does vary the fan speed based upon current need, but the maximum speed is too close to a tornado for my liking. I suspect I’m not alone in this regard. In the longrun, I hope that Purism: (1) somehow improves the acoustics, perhaps by the use of a bigger heat spreader, more vent holes, more thermally conductive case material, better vibration isolation (like a Lexus), and low-performace-SKU cores; and (2) adds a “quiet mode” to PureOS power settings which disables Intel Turbo mode as described below.

The good news is that I found substantial fan noise relief by simply disabling Turbo fequencies on all cores. Turbo is a feature which allows a given core to exceed the frequency which is sustainable under it’s specified thermal design profile (TDP). In principle, it’s a great idea because you can safely overclock when plugged into AC. In reality, it’s more trouble than it’s worth because often only works for a matter of seconds before the thermal envelope is breached and the frequency needs to be scaled back for a while. In other words, it’s a great way to generate fan noise and warm up your lap while running your apps trivially faster.

There are numerous utilities out there which claim to let the user set power management policies, but I found that only Xfce Power Manager claims to let you manipulate frequencies. However, at least on my machine, that did not turn out to be the case. So that leaves the hard way, which is to manually alter the CPU machine status register (MSR) for Turbo control. Here’s how to do it:

sudo apt install msr-tools
sudo modprobe msr

That will install and load the package you need. First of all, see if Turbo is enabled on processor 0 by reading bit 38 of MSR 1A0:

sudo rdmsr -p0 0x1A0 -f 38:38

If it comes back as 0, then Turbo is enabled, otherwise not. This should be the same result for the other processors ("-p1", “-p2”, etc.), but you can read them all if you like.

You can disable Turbo by writing back to 1A0 with bit 38 set. But in order to do that, you need to see its entire 64-bit value, so you don’t change any other bits:

sudo rdmsr -p0 0x1A0

This returns 0000850089 in my case, so let’s set bit 38 and write back ("-a" for all processors, as opposed to “-p0” for just the one that we read):

sudo wrmsr -a 0x1A0 0x4000850089

You can repeat the first read above, and verify that bit 38 now returns 1.

Open up a bunch of browser tabs playing videos. Notice that, while the fan still runs, it runs quieter. You can even toggle Turbo in a terminal while you do so, which should result in fan speed changes a few seconds later:

sudo wrmsr -a 0x1A0 0x0000850089
sudo wrmsr -a 0x1A0 0x4000850089

The bad news is that I have no idea how to run this at startup. Yes, you can modify .bashrc (and include the modprobe above), but because this is a sudo command, you’ll get asked for your password every time you first open a terminal. Surely, there’s a better way, perhaps through sysfs or a power management app, but I haven’t found it, so please let me know if you find something.

6 Likes

Thanks for the above!

The simplest way I know is to:
sudo your_fav_editor /etc/modules
and add the line
msr
to the bottom. That loads the module at boot. Then use
sudo crontab -e
and add the line
@reboot /usr/sbin/wrmsr -a 0x1A0 0x4000850089
to the bottom. I’ve just done that on my Librem 15 and it worked.

2 Likes

Well, that worked. God, what a relief!

Presumably though you shouldn’t write that value unconditionally. You should read the current value, set bit 38, and then write back the result - as @whistler says.

1 Like

Running PureOS amber on a Librem 13v4 I couldn’t stand the repeating noise of the fan after some month neither anymore.

For me the solution has been a lot less challenging: I just installed a Gnome extension.

CPU Power Manager by martin31821 works on my notebook well and does exactly what I need. I just selected a profile with the maximum frequency at 50% and the fan never turned on again.

Funny thing is that I even do not notice that I do run at “half power”. Since I do not run software needing CPU power (like eg. 3D rendering) every time the CPU usage went up it had been some stupid web-content, some bug in some software or some other system error.

Same now, but the fan does not alert me anymore :wink:.

To still get some feedback if a core is at 100% for some probably stupid, buggy reason I installed Vitals by corecoding alongside.

Now it looks like this

system_monitor_gnome

Don’t know if it works on the Librem15 also, but maybe it is worth a try.

5 Likes

That’s great! I’m not concerned with the fan on mine. It is hardly ever on even though I do intensive work on mine. I do like being able to control the thermal envelope directly like that though.

I think the app that notifies of rampant processes is even more crucial. Especially when trying to maximize battery life on the go.

Although, do you know how to change what is displayed on the panel? Right now it is memory and system, but I’d prefer something like temp and system.

I’d like to emphasize that again: Same for me.

The fan went on when some process started running bad. Mostly those were firefox processes in my case, but I also had repeatedly problems with rocket chat and revolt.

The problems are not soved by make them ignorable :wink: , but now I can decide when to tend to processes running wild.

L14 is going to be more “massage-able” in this regard we hope …

1 Like

@reC Better (more expensive) fan bearings might help, in addition to the other mitigations mentioned above.

@ChriChri I wonder what 50% actually means. The first half of “normal” P states (frequency levels)? 50% of the maximum normal frequency? 50% of the maximum Turbo frequency? I guess it doesn’t matter, to the extent that one can just binary search for the percentage just below the annoyance threshold. Thanks for sharing.

“Mostly those were firefox processes” – Firefox is probably responsible for a gigaton of annual CO2 dissipation. I mean WTF is it doing half the time? Mining crypto? Granted, autoplay videos are the root of all browser evil. Probably AdBlockPlus would block them, but I’m not sure how safe that would be to use with Tor, so I find myself playing whack-a-mole with this crap all day, while the fan is just laughing at me.

Well, I didn’t really look at it, but I thought it just limits the frequency the CPU is running on. As you can see in the little screenshot there is a GHz-value shown in the extension. Running on 50% max it stays at 1.80 GHz or below.

ChriChri’s solution is great. I have mine set to 30% and I can hardly tell a difference. Switching workspaces and task switching is still fluid and pleasant.

Specifically I like that if I am not doing something which really needs the grunt, I can keep the laptop cooler, conserve power, and have all of this not impact my workflow. Brilliant solution, and another example of why i like Linux despite my hangups with some of the prevailing ideologies present among it.

1 Like

Actually I think we should try to push it a bit further.

If we’d like to have convergence on mobiles using the same software stack as on a highly powered notebook the software stack has to adapt to use as little resources as possible.

Nobody will expect that on a linux phone in desktop mode using blender, gimp or other software which uses big amounts of data or needs a lot of calculating power will work.

But I’d expect that I can browse the internet, use an email client, use libreoffice and the like.

That means that these use cases for a convergence linux phone should work on a notebook with near to no memory and CPU usage - looking at the values in percentage of what is available on such a full featured system.

I do not say that we’re far away from it, but especially the situation with browsers is not yet getting there.

Well, a bit off-topic, maybe something for another thread :wink: .

1 Like

Assuming that it’s an i7-7500U then that would make sense.

Model name:                      Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
CPU max MHz:                     3500.0000
CPU min MHz:                     400.0000

so 1.79GHz would be close to 50% of 3.5GHz.

FYI the frequencies available aren’t particularly granular, so 50% might be the same as 65%, for instance. The obvious thing to do is balance granularity against the time and power penalties of changing frequencies at the PLL level, so you only ever go exactly as fast as you need (within the limits of granularity), based on the percent idleness in the previous time slice, but Intel and AMD don’t do obvious things.

Also, turn off your wifi at night so your machine doesn’t rev up the fan due to checking for updates or conducting other internet transactions. This obviously applies to those of us who sleep in the same room with our laptops.

@ nobody in particular … i just remember playing TANKS on a pentium 3 a while back so modern computers should have NO problem whatsoever at doing that AND more …

this is 2020 … magnetic levitation fans are the way to go … look at some of what NOCTUA is doing in Austria …

1 Like

I came around to meter it in my work scenario (multiple browser windows with each multiple tabs, terminals, calendar, messenger and chats, thunderbird, etc. pp.).

Averaged on working 24/7 one year I’ve got 141kWh/year running at 30% maximum and 150kWh/year running at any speed chosen by the OS up to 100%.

I found that disabling “Turbo Boost” reduces the worst fan noise moments significantly already.

Edit - forgot deep-sleep: ~2W

cpupower-gui combined with mate’s CPU Frequency scaling Monitor works good. I am not sure if the above suggestion is the same.

Basically it is.

I will echo ChriChri’s comments. I have since left my cpu throlling percentage to 100% and have just disabled turbo boost. The machine can moderate to complex work and the fan never comes on.

This is either a testament to the effectiveness of an all aluminum body, or to Intel’s thermal engineering.

In my case (L13v4) it returns
850089
The zeros are missing. Is the command wrmsr -a 0x1A0 0x4000850089 still correct?

I admire your pendanticism. Yes, go for it.

Power dissipation grows like the square of clock frequency – but even faster due to the voltage increase required to thwart transistor leakage – so the required thermal efflux rapidly explodes out of control. Aluminum is of course more conductive than plastic, but only affords a modest frequency increment, all else being equal. Intel’s thermal engineering is world class because their CPU is so inefficient.

1 Like