Fix Intel CPU Throttling on Linux
github.com
github.com
The whole point is to ignore them because they're horrible and hold back what these CPUs can really do. Fuck the manufacturers playing these stupid marketing games.
Intel warrants their CPUs at TjMax 24/7, they'll automatically throttle when they hit that limit, and disabling all this other throttling crap makes them run that way for full performance.
Mostly I mention it to say that there's not _no_ reason for thermal limits in modern setups...
There's zero reason for all this extra "thermal management" crap beyond corporate greed.
What people want is a box that does computing within spec and without melting, sterilizing their laps/hands, or otherwise introducing malbehaviors they have to work around.
People want stuff that doesn't or is very difficult to break. When it does break, they want it to be a straightforward repair.
but you're now generating more heat than the system is designed to dissipate
I believe that's more accurately rephrased as "now you have more performance than they wanted you to have", because that's how it's being used in practice.
FYI, it is painfully obvious that you're toeing some sort of company line here.
Edit: and getting flagged for pointing out the truth should itself be quite telling. ;-)
"An unthrottled CPU without any OS-level policy will generate enough heat that the case temperature may rise to levels that violate safety regulations" can certainly be interpreted as "now you have more performance than they wanted you to have", yes.
> FYI, it is painfully obvious that you're toeing some sort of company line here.
I work for a company that develops trucks. While thermal dissipation is something that we do need to worry about, I can promise that it is absolutely not at the scale involved here. I've also been pretty consistent in criticising Intel for refusing to document DPTF. Whose company line do you think I'm toeing here?
Despite literally zero evidence of that actually being a problem in practice?
I've also been pretty consistent in criticising Intel for refusing to document DPTF. Whose company line do you think I'm toeing here?
Not Intel, but there's plenty of evidence that DPTF just cripples performance; and why else would you jump in to an article about unlocking manufacturer-crippled products with FUD like "not the correct approach"? It's like posting "may cause processor damage" and advocating for stock speeds on every article about overclocking.
For the record, I've been overclocking (not at extreme or competitive levels) since the early 90s and haven't killed any hardware because of it. The system I'm posting this from has been on a 50% overclock for over a decade and it's still rock-solid stable.
Seems like there are quite a few other reasons why someone would "jump in", including being a relative expert. Maybe you could think of a few others yourself?
Sustained contact with metal at a temperature as low as 45C is sufficient to cause discomfort, and it's a surprisingly small rise above that before you can actually cause burns (https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&d...). Skin temperature is a standard input to DPTF policies, and during my testing I was certainly able to get the skin temperature of my test laptop well above that level - DPTF would trigger throttling instead.
> why else would you jump in to an article about unlocking manufacturer-crippled products with FUD like "not the correct approach"?
DPTF defaults to a "safe" configuration, where "safe" is a euphemism for "almost unusably slow". If what you care about is your laptop not being almost unusably slow, it's reasonable to choose an approach that obtains that without introducing any additional thermal concerns. If what you care about is obtaining the absolute maximum performance possible from your hardware with no regard to any safety or longevity concerns, then yes, implementing the DPTF policy is probably not what you want to do. But recommending the latter without providing any information about the tradeoffs is irresponsible.
You choosing to not even look for evidence so you could make an argument in ignorance does not automatically mean it doesn't exist. This is literally the first google result for "laptop case temperature causing burns": https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4292129/
Also look at this fun condition: https://en.wikipedia.org/wiki/Erythema_ab_igne
> Temperatures between 43 and 47 °C can cause this skin condition; modern laptops can generate temperatures in this range. Indeed, laptops with powerful processors can reach temperatures of 50 °C and be associated with burns.
Some more results:
https://escholarship.org/uc/item/4n04r793
https://www.researchgate.net/publication/23164210_Thigh_Burn...
They added thermal throttling because most users only max out their CPU a tiny fraction of the time so the thermal inertia can compensate for inadequate cooling. It’s infrequent enough that most users could even disable it without noticing a difference. The problem is under the wrong conditions Aka inadequate cooling plus high ambient temperatures plus extreme workload = dead CPU.
And no this isn’t theoretical, one summer working without AC I cooked a CPU before they added thermal protection. It actually happened to several people in the same heatwave.
Only fairly recently with Turbo Boost did Intel combine both ideas. It’s actually a fairly clever optimization as single threaded workloads benefit quite a bit from the extra thermal overhead.
Silicon aging is worse at higher temperatures, people are going to kill their 7/10nm chips far quicker if they keep overclocking as they've previously done. But that'll be Big Silicon's fault too, no doubt.
Thermal limits like this are really about managing the manufacturers liabilities, and protecting the expected lifetine of the product.
Like I said, Intel warrants their CPUs to be operational at TjMax continuously, and that's the temperature they'll reach and stay at automatically if not given enough cooling. There's plenty of stories of people with computers whose heatsink has somehow detached or become so severely clogged as to be at that limit all the time, and the CPUs survive just fine.
This article isn't about that; it's about manufacturers artifically limiting performance beyond that to hit a marketing target like battery life or power consumption.
So, instead, you see the latter. This means that, yes, even if using official Intel DPTF drivers, systems will still occasionally thermally throttle. They may do so even if the CPU itself is not at a dangerous temperature, because the rest of the system may still be too hot and the CPU is the easiest tunable knob in terms of heat generation.
So, yeah, you can still obtain better performance by disabling DPTF and overriding power limits. And in the process you'll end up with a system that will become hotter than permitted by international standards, and you'll risk various types of failure ranging from inconvenient (the adhesive sticking things like rubber feet to the bottom of the machine tending to melt) to expensive (the unexpected levels of thermal expansion cycles causing components to fail earlier). It's fine that you're not worried about these things, but it's just straight up wrong to recommend that people override those limits without being clear about potential outcomes.
[1] https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CEL...
(Edit: replaced IEC 60950-1 with 62368-1, which is the up to date version, and linked to EU incorporation of that spec)
Since that isn't the case, however, many people get a laptop that isn't capable of performing the tasks it's advertised for. The excuse of "well, we didn't think you'd really need that much power" doesn't really cut it, when said power was strongly advertised on the box.
I don't think the average laptop user should need to concern themselves with acquiring the necessary knowledge to discern good laptop benchmarks.
They don't. The average laptop user doesn't have sustained workloads that keep the system running at 100% capacity for over an hour, so they don't need and shouldn't want benchmarks reflecting such a use case. They're genuinely better served by benchmarks reflecting workloads that come in shorter bursts.
I also use this tool to bypass manufacturer limits in battery mode that are intended to make the system seem like the battery is not undersized for the CPU's power draw. Sometimes I'd rather have more CPU for less time.
I have never used a laptop for a decade, nor have I had the CPU fail. So perhaps faster performance and shorter lifespan is okay.
In all I've spent about 25% of the cost of the laptop over the years in repairs, but the result is that I'm able to keep using a device that's almost 12 years old instead of junking it. Saved quite a bit of money vs a new device, too.
Incidentally, it's interesting in regards to this issue that these old bulky laptops with beefy chips are actually quite good at avoiding thermal throttling. Despite having a traditional loud fan, I rarely even hear it come on.
In the show, trigger is a street sweep who has "kept the same broom" for 10 years, only periodically replacing the brush and occasionally replacing the handle.
The joke is of course, that it's no longer the same broom.
(Response crafted by anti-repair lobby gpt)
Dies of silicons are packaged, socketed, etc instead every part of silicon will get closer in a package and will handle everything.
Faster, cheaper, more energy efficient.
This is my PC right now. Sometimes it does a boot loop, where it can get to BIOS but not GRUB and I'm not sure why, as there are no error messages. Pulling the plug and plugging it back in helps.
I'm not sure whether it's the motherboard, or maybe a disk not wanting to read data or something. Guess I'll have to wait and see, eventually swapping out parts one by one once it fails entirely.
Just replaced my main desktop which was fx8350, but that computer is now on its 2nd life with a friend and shows no signs of stopping.
There was a time when 10 year old computer was absolute rubbish. These days, if you upgrade from spinning drive to ssd, 10 year old well made computers are just fine :)
Basically, in 3 decades of personal computing, I never had a CPU failure other than that one time I crushed atlon xp with the heatsink :O
Of course lots of CPU make it for longer, but 10 years is certainly not a design target.
Or if you put consummer CPUs in embedded equipements that are always (or at least often) under load, Intel will not care much if you have an high failure rate after a few years, even if you buy an high volume. They have dedicated SKUs with better expected durability.
That's it.
I still regularly use this machine even though it not longer is my main portable device. The only thing keeping me from doing so is its 32-bit CPU which now that 32-bit support has mostly gone the way of the dodo. I much prefer its 4:3 form factor 1600x1200 screen, keyboard and construction over the P50 I'm using in its stead.
The computers don't break on Windows, why Linux uses should take this overly conservative approach that limits the performance of their computer?
This check doesn’t work on Linux, so for safety reasons the former limit is enforced.
Trusting Intel to provide accurate info on the actual performances of a chip feels too naive at this point.
It shouldn't be too difficult to correct on Linux. Why is Windows taking the manufacturer's limits into account while Linux basically ignore it?
As for the pros and cons of the `throttled` project, yes, this might not be the "officially desired" approach but I know several people who have been using to great success for years. The reality is, unfortunately, that particularly those of us who use Linux machines for work and order the most recent & powerful Thinkpads or Dells they can get their hands on, often realize later on (when the machine arrives) that the default settings handicap our machine to such a degree that we can barely work. Unfortunately, not everyone is a kernel developer, though, or knows how these things work, so quick fixes are often welcome, even if they limit the hardware's lifetime (after all, we'll buy a new device in a few years anyway).
What exacerbates this problem is that it's all very intransparent: The "official" way to solve these issues (which, as far as I understand you, is installing thermald?) is not really communicated anywhere, nor does thermald come preinstalled on any of the major distributions AFAIK[0]. What's worse, thermald often doesn't even solve the throttling issues without installing further patches. On top of that, BIOS updates by the manufacturers also seem to play a major role as manufacturers like Lenovo introduce different performance modes and things like "lap mode" etc. To be honest, to this day I haven't quite understood how these things interact and whose responsibility it is to fix things.
In my particular case, I have been using a Thinkpad X1 Carbon Gen9 (which Lenovo says "supports" Linux) and at some point, after installing numerous BIOS updates and working my way through hundreds of posts on the Lenovo forums, I just gave up: My machine still regularly throttles down to 800 Mhz per core and 16W under medium load until I hit the secret Fn + H key chore to tell the BIOS to switch back to high performance mode and set the thermal limit back to the maximum.
Do you happen to have a recommendation for me as to where I should start looking (again) for a solution? Does thermald fix these issues these days? (I know that when I last looked into it, it didn't.)
[0]: (EDIT) I take that back, it looks like thermald does come preinstalled on Fedora and Ubuntu these days. At least it's present on my new Ubuntu 22.04.2 installation. Unfortunately, that doesn't really help me since (and now I remember reading this last time I looked into thermald) according to the changelog[1] for v2.3:
> - thermald will not run on Lenovo platforms with lap mode sysfs entry
Great, so I still have nowhere to go from here it seems.
(Essentially we're back again to the situation I described: It's all very intransparent to me.)
I installed thermald on my Lenovo T480 with Debian Bookworm and I get 20% better results in stress-ng. The fans are a bit louder now under high load and off under low load.
Without thermald:
$ stress-ng --matrix 0 -t 3m --metrics-brief
stress-ng: info: [3755113] setting to a 180 second (3 mins, 0.00 secs) run per stressor
stress-ng: info: [3755113] dispatching hogs: 8 matrix
stress-ng: info: [3755113] stressor bogo ops real time usr time sys time bogo ops/s bogo ops/s
stress-ng: info: [3755113] (secs) (secs) (secs) (real time) (usr+sys time)
stress-ng: info: [3755113] matrix 2278812 180.00 1437.43 0.27 12660.06 1585.04
With thermald: $ stress-ng --matrix 0 -t 3m --metrics-brief
stress-ng: info: [3755550] setting to a 180 second (3 mins, 0.00 secs) run per stressor
stress-ng: info: [3755550] dispatching hogs: 8 matrix
stress-ng: info: [3755550] stressor bogo ops real time usr time sys time bogo ops/s bogo ops/s
stress-ng: info: [3755550] (secs) (secs) (secs) (real time) (usr+sys time)
stress-ng: info: [3755550] matrix 2791272 180.00 1404.32 0.57 15507.06 1986.83
I just installed it using apt and did no extra configuration. My system was anyway configured for balanced power mode.
Why is thermald not installed on desktop installations by default?The thermald man page says this:
> In some newer platforms the auto creation of the config file is done by a companion tool "dptfxtract". This tool can be downloaded from "https://github.com/intel/dptfxtract". It is suggested as parts of the install process, run dptfxtract.
The dptfxtract gibthub project (https://github.com/intel/dptfxtract) says Intel discontinued the project.
> Thermald version 2.0 and later has in built parser for thermal tables. So this utility is not required. Make sure that thermald "--adaptive" option is used.
If you try to do this to your laptop, well... there's a reason you can't legally sell laptops that heat up beyond 40-45℃. Expose yourself to that all you want, but be prepared for hardware damage, overheated skin, or decreased sperm count due to putting an overheated laptop in your lap.
I wouldn't call this a fix in the same way I wouldn't call throwing out your smoke alarm a fix for the constant flat battery beeping.
But thanks to turbo boost, sometimes my laptop is hot playing a youtube video but cool when compiling code or the other way around. There is no predictability on how long a compilation will take or how long the battery will last, since it would depend on N thermal and power factors.
At least to me, this feels like when marketing designs products instead of product managers. I recently bought an Intel 12th gen i5-1240p laptop (asus zenbook) and this processor boosts from 1.7Ghz to 4.4Ghz i.e. more than twice the base frequency. That's absurd? I rather have a stable ~2Ghz than have the processor boost up to ~4Ghz while surfing the web.
Hence we wouldn't need tools like this if at-least on laptop, Intel released chips with no or smaller turbo boost range.
echo "75000000" | sudo tee /sys/class/powercap/intel-rapl/intel-rapl\:0/constraint_1_power_limit_uw
to cap my i7-10700 to prevent it from overpowering the system fan by peaking to 200+ watts.- Liquid metal TIM
- Thermal pads + heat pipes connected to chassis to dissipate heat (Yes this means the bottom chassis heats up a lot)
- Disable the intel_rapl_msr linux driver + disable BD_RPOCHOT via MSR
Laptop has worked like a charm since. I really don't want a super thin laptop. I want a small laptop. I wouldn't mind 2 cm thick 13 inch laptop. But I can't handle a 15 inch laptop. I just find it way to large to be seriously portable.
e.g. ThinkPad T14 Gen 3 AMD, Ryzen 7 pro 6850U, 32 gb LPDDR5-6400MHz for around 1000 EUR
Having used an XPS 13 and XPS 15 I was underwhelmed and none of Dell's laptops hit the sweet spot for me.
The benchmarks do not lie.
I like such generalised statements. You can read about xeon v3 hack and ThrottleStop PowerCut. Each is just "writing MSRs" with a funny side-effect of your CPU taking more current in.
Yeah. It's that bad. I have a Thinkpad P14s.
What's worse, these things have an accelerometer that causes the same type of throttling if you move your laptop.
Fuck Intel-based clothes-iron laptops so hard.
Why is Intel not providing the documentation? And what is it so difficult to reverse engineer?
Is this tool correctly reading the DPTF data and correcting for it?
It requires parsing multiple undocumented binary file formats, making sense of how the information in each is interlinked, and writing code that keeps track of system state, compares it against the firmware policy, and then imposes the appropriate constraints.
> Why is Intel not providing the documentation?
I have no idea.
> And what is it so difficult to reverse engineer?
https://github.com/mjg59/thermal_daemon/compare/028bde5bf0f1... was my initial implementation of this (remember to click "Load diff" for anything that's too large for github to display by default). There's a fair amount of complexity here!
> Is this tool correctly reading the DPTF data and correcting for it?
Thermald reads the DPTF data, throttled doesn't. I can't promise that thermald reads it correctly given the lack of a spec, but to the best of my knowledge it does.
Of course, this only works if the OS knows how to do this, and Intel never publicly documented it so I had to reverse engineer it instead.
This is not the only area where Intel doesn't really support Linux, some of their GPU models also come to mind, like the PowerVR based ones in the past.
It's all the fault of manufacturers who want to both save cost with inadequate heatsinks and impose arbitrary restrictions on their products. The software in this article looks like the Linux equivalent of ThrottleStop, a Windows application that was the first to expose the truth behind it all.
It's certainly a good idea if you realise just how much they're fleecing you.
In the sense of "You can install thermald and it will be corrected", yes. In the sense of "The only reason this works on Linux is that I reverse engineered the Intel spec because Intel refuses to publish it", then I'd disagree with the characterisation that it shouldn't have been too difficult, because it was really pretty difficuly.
As noted by the author:
> ===== Notice that undervolt is typically locked from 10th gen onwards! =====
I can't even modify the BIOS due to BootGuard and the keys burned into the CPU.
Hopefully there will be a way to leak/extract the keys someday, as this create real e-waste for fake security.
Right now I'm fighting with nohz_full and rcu_nocbs to limit the wakes per second, with irqaffinity on top to isolate to one core what must happen so that the others can stay in PC8 when I'm not compiling.
I'm down to about 350 on a 12th gen Alder Lake with E and P cores running Wayland with a few terminals, Thunderbird and Edge) but I wish I had the ability to also undervolt to go beyond 4W
253 W max turbo power is not that crazy by today's standards.
> top of the line case, very good fans / circulation, and a large AIO
I think you'll find that what people consider good cooling for a desktop has changed somewhat in the last decade. My first GPU didn't even have a fan, but today it's fairly common for enthusiast builds to have an external radiator. I dunno what you consider large, but most AIOs only have slightly more surface area than large air coolers so they really aren't worth it for sustained workloads like gaming or ML training. Custom loops have always been the go-to solution.
It benchmarks really well and I’ve never seen it over 50*C, the fans are really quiet, and I haven’t changed any of the configuration for it.
On the flip side I’ve got a i9-12900k in a different PC with air cooling and a more compact case and between that and the graphics card, the smaller machine runs super hot and noisy.
I was using Cinebench for benchmarking. I haven't seen any performance hits, in benchmarks or typical usage, so I'm comfortable with all of it.
I decided to undervolt the thing based on about a dozen or so Reddit threads worth of conversation about the thermal properties of these 13th generation Intel chips.
Consumers: "Why would Intel do this?"
Laptops shouldn't be using boost anyways, because their form factors and CPU coolers just can't handle the heat output.
Laptops shouldn't be using boost anyways, because their form factors and CPU coolers just can't handle the heat output.
On the other hand, if it's plugged in much of the time, then let it boost as much as it can, with speed only thermally limited. Otherwise you're not getting the true performance you paid for.
Linux does grant the user that flexibility, so if someone actually wants that, they can have it.
The max non-boost frequency is usually the sweet spot for performance and efficiency.
> On the other hand, if it's plugged in much of the time, then let it boost as much as it can, with speed only thermally limited. Otherwise you're not getting the true performance you paid for.
If the user wants to live with a potentially reduced laptop lifespan, sure thing. But it's just not worth it for a laptop, frankly, given their limited thermal cooling capacities. That CPU will degrade over time when run at that level of heat.
If Intel warrants their CPUs to be at TjMax 24/7, it's a good sign that it shouldn't be a problem. I have not heard of overheating killing CPUs since the days when AMD's didn't have any thermal protection[1], and I've cleaned out machines which were heavily clogged with dust and thermally throttling all the time for many years (the service prompted by their owners complaining about their computers being slow.) In one memorable case the push-in heatsink pins must've been originally not fully inserted, since they came out at some point and the heatsink was not even touching the CPU anymore, yet the CPU kept running for years in that state.
[1] There's a famous TomsHardware video about that: https://www.youtube.com/watch?v=y39D4529FM4
It certainly does work. I was working on some manufacturing equipment in 2018. The 2010 release 1st Gen i3 had a centimeter gap between the IHS and the HSF. The Intel HSF thermal compound had not been touched, it was like new. The CPU had run thermal throttled to about 700MHz for eight years, continuously. Properly attached the HSF, the slowness and thermal throttling went away.
I overvolted and overclocked pretty much every chip I've owned from my 20 year old Athlon 64 to my 0 year old RTX 4090. None of them have degraded. If you watch overclocking livestreams you'll see just how much abuse it takes to get any sort of reaction from silicon.
That's quite a sweeping statement. The adequacy of cooling seems to depend a lot on the device and its configuration.
I've had two small form-factor ThinkPads at default configuration over the last nine years, and there have been zero problems with heat. The CPUs have conservative TDP limits, and the cooling seems adequate for that.
One of the laptops ended up with a broken keyboard after ~seven years, but if that hadn't happened, it would probably still be in daily (and not always particularly light) use, as it had been until then.
I'm sure some manufacturers and models choose their parts less conservatively, and put too powerful CPUs or GPUs (or set their cTDP too high) in a chassis that can't really handle it. For them, the maximum turbo allowed by their CPU/configuration might be too much over prolonged periods. Some of those devices might end up failing due to thermal issues within some years.
But for more conservatively configured laptops (such as business ones), disabling turbo would probably quite needlessly limit their performance. Unless you're aiming for a much, much longer lifespan than almost anybody uses their devices.