Linux Developers Discussing Possible Kernel Driver for Intel CPU Undervolting
phoronix.com
phoronix.com
I'm just saying that linux does not do a great job of gracefully limiting CPU power to avoid a lower BIOS level limiter kicking in and performing worse than if it just throttled down a bit earlier.
If there's an error in e.g. floating-point unit, it would just cause random errors in the output, but the game would probably keep running. That might be completely fine, if it's rare and you could undervolt just that unit a lot. Especially in somewhere in the graphics pipeline, where it would just generate visual noise. Also, I think energy consumed / heat is proportional to voltage squared, so it has a big effect.
The processor circuitry does not only consist of transistors dedicated to the datapath, a significant amount of transistors are used to control the datapath. If control transistors are faulty there is no guarantee about the processor behavior.
Also, I don't know about Intel cpu protections, but in modern secure hardware we include dedicated circuits for power/clock glitch detection. The glitch detection circuit is designed with a higher sensibility to power/clock fault than the rest of the circuit, this way its avoids that clock/power faults affect the integrity of the circuit output.
Not x86, but in college a series of courses used a battery powered embedded system with a Motorolla 68HC11. When the batteries ran low, conditional branches would never branch, which was very confusing. Everything else seemed to work fine though.
I had a Surface Book 2 that was particularly bad for this, I think because it uses the same connector as older versions, and it could not supply enough power. Undervolting seemed to help quite a bit.
Within that envelope, the CPU can boost up to its max turbo frequency when needed.
The only result of undervolting on modern CPUs is lower temperature; performance actually goes up as the processor still aims to hit its set TDP/TPL limits.
Lower voltage = higher clocks for longer on all Intel CPUs that can be undervolted. I believe it's the same for new AMDs, but I haven't had the chance to test one.
You're basically fine tuning your pet rock - some silicon is higher quality and can do better than the stock voltages that were set for thousands/millions of units out of the factory.
If CPU was used too much, it instantly reach the temperature threshold, then forced down clock and stall kicks in to save the CPU, repeat the cycle.
Which way do you prefer? endless cycle of 60fps for 10 seconds followed by shuttering for 10 seconds, OR stable 20fps.
If the silicon doesn't need the voltage, more voltage is only harmful. I can run my skylake alike laptop at -170mV offset (which is borderline golden chip), stable at prime 95 and whatnot. Prime95 runs below 70C.
Less voltage means less waste heat. If you can lower voltage without lowering clock speed, you'll be able to maintain turbo boost longer instead of constantly thermal throttling.
Not my first recommendation but it is a valid strategy.
Overvolting is also useful for overclocking; at a point it can help increase stability. But generally I think you want to hit a point at which you are getting the highest clocks with the lowest voltage that is still stable.
If it has less internal resistance it will generate less heat for the same amount of work. Semiconductors are constrained by the maximum junction temperature[1], and CMOS logic chips like modern processors primarily consume power when switching.
So there's a thermal limit to how fast they can switch. Thus having lower internal resistance can allow you to clock higher (switch more often) before reaching the thermal limit.
However, when switching they act as varying resistors, and the amount of power dissipated in any resistor depends on the square of the applied voltage (P = V^2/R).
So if you can run your chip on a lower voltage, it will dissipate a lot less energy when switching, thus allowing you to switch faster before being thermally limited.
When overclocking, you ask the transistors to switch faster. To turn a MOSFET[3] transistor on or off, you need to transfer a certain amount of charge (aka electrons) into or out of the gate. The faster you can transfer the charge (more electrons per second ie the higher the current) the quicker the transistor turns on. And the way to do that is to increase the voltage[2]. So overclockers tend to bump up the voltage when going for the super-high clocks. But as you see from above that causes a massive increase in heat, thus requiring significantly more cooling.
I'm no semiconductor expert though, so I might got some of this wrong, but I hope I got the essence right. Also I'm not sure if the impurities and such that lead to the variability of the internal resistance is related to the ones affecting the ability to undervolt. Is it mainly the threshold voltage or?
There are other aspects as well though, I assume the parasitic elements[4] play a role as well, especially when overclocking.
[1]: https://en.wikipedia.org/wiki/Junction_temperature
[2]: https://en.wikipedia.org/wiki/Ohm%27s_law
[3]: https://en.wikipedia.org/wiki/MOSFET
[4]: https://techweb.rohm.com/knowledge/si/s-si/03-s-si/4873
[4]: https://techweb.rohm.com/knowledge/si/s-si/03-s-si/4873
Well, i915 is certainly a completely different story than nouveau. Otherwise I would not be so optimistic. From the anecdotal evidence of listening to less than a handful of Intel colleagues I happen to have my hopes are not that high. According to them Intel is a horrible organization where high walls and secrecy making is more common than helping another part of the organization.
Perhaps this digs into sales of new chips, which is why it's so hard to do.
I made a different sacrifice - that of frequency. I vastly reduce temperature cycling by [disabling TurboBoost](https://wiki.archlinux.org/index.php/CPU_frequency_scaling#D...) and the absolute temperature by using the "powersave" governor.
"The dynamic power consumed by a CPU is approximately proportional to the CPU frequency, and to the square of the CPU voltage:" https://en.wikipedia.org/wiki/CPU_power_dissipation
ps. You can also undervolt, lower frequency of AMD CPUs.
Undervolting lowers voltage, but the processor will now stay at higher clocks for a longer time, hitting the same TDP/power limits.
You'd need to undervolt and either reduce Turbo Power Limit or cap the clocks at something lower.
No,at the same power, but for shorter amount of time, because now it is able do a lot more work per unit of time. So no, you'll definitely use less energy, although dissipate same amount of power. Keeping in mind, that your will be idling 90% of time, if not more, your savings will be even bigger.
As long as it's only TDP limited, voltage going down means amperage/current will go up in order to hit the power limit.
I've never done this, but lately it sounds like there's sometimes quite a lot left on the table, even after part binning. Performance is so high now that I wouldn't bother doing this for an extra 5-10%, but for an extra hour of battery life, it's certainly tempting...
If Linux gets undervolting support, that will help a bunch of laptops without highly configurable BIOSes.
Linux also has utilities for this, using the same MSRs, although support for a lot of processors is lacking.
So I had a couple of profiles made that I could switch between when gaming and not, which would adjust the RAM speed.
I’m an economist and I’m fascinated by this statement.
Surely if something (‘performance’, in this case) is ‘high’ then getting a 5-10% proportion of it is better than getting the same proportion increase in performance on a lesser level (the bigger the baseline, the bigger that 5-10% extra performance is). So it’s apparently irrational: being willing to incur effort (cost) to get something that is worth a smaller amount and being unwilling to do it when the same effort/cost gets you more isn’t what one would expect.
But maybe it’s satisficing: maybe formerly the experience was endurable only when running at 110% of maximum, but now there’s no need to redline to get a decent experience?
Or maybe it’s the law of diminishing returns, utility approaching some kind of asymptote.
For instance I run my computing on a TR 1950X and I could probably undervolt or overclock the chip but, to be honest, it's not worth the perceived "risk". Undervolting could break specific instructions in undetectable ways and the only way to be sure things haven't broken would be to run something like sandsifter [0] multiple times. Because I, and many others who would have the technical know how, write software on these systems it's not very much worth the headache. If I had a seperate system I built just for gaming or doing a specific task and I wanted to reduce how much I spent, or the power usage, etc undervolting would then shift out of headache -> super worth it.
The last thing I want to have to do is run every piece of code I need through godbolt and pray there's no AVX instructions that "may" be fishy.
I think this is largely why cloud providers don't do things like this as aggressively. They do it to some extent with custom off-roadmap chips but not controlled dynamically in userspace. If we can get something like this original post into the kernel that would be a massive win for everyone.
It's exactly this. Many things have sublinear utility (Money is often assumed to have a log or square-root utility).
speed often has this effect magnified because what people actually care about is time and time is the inverse of speed. Lets say that doing task Z takes X + Y time. At some point increasing the performance of Y has no measurable gain in utility because X dominates.
That is, it's easy to build an airplane that flies at 90 knots. You can then clean up the aerodynamics a bit, burn a bit more fuel to get a bit more power to fly 110 knots. If you want to fly 130 knots, you probably need to add fairings and wheel pants and put in a bigger engine that burns even more fuel. It's very hard to get to 150 knots without retractable landing gear, a massive engine, or removing seats. To get to 200 knots you need 50% more cylinders or a turbocharger. To go past that you usually start looking at a turboprop at 10x the cost and 4x the fuel burn, then jets (...etc.)
Back to computers... doubling your power consumption and heat output for a 100% speed improvement is a perfect, linear improvement. If you need more performance, it's a fair trade. Even if you care about battery life, you should still make the trade, because drawing half as much power for twice as long still burns the same amount of total energy, so you don't gain anything by slowing down.
But would you double your power consumption and heat output for a 50% speed improvement? What about a 20% improvement?
It's the same idea. If the chip makers are setting voltages near the high-end, exponential cost, diminishing returns side of the curve, then you'll get more total "value" back by going back to the linear part of the curve, assuming you care about all of the variables, and not just "more speed at any cost."
I guess it's a question of whether you want drivers to be in the kernel source tree with supported interfaces, where interactions with other drivers can be mediated, or in userspace, where they can iterate without the kernel release process, which takes a long time to get to distros and end-users.
As this Intel MSR is not well documented, I would not argue strongly either way.
https://lore.kernel.org/lkml/20200907094843.1949-1-Jason@zx2...
Processor governors change the clock speed of the CPU (how many dishes you're washing). Dynamic voltage control is changing how hard you're pushing electrons through the CPU to let it stably operate at a given frequency (opening/closing the faucet as your scrubbing your dishes).
By doing this we can lower the amount of Power (water) we use while getting the same amount of work done (dishes washed).
If you use a more conservative governor you lower performance and power consumption both linearly; this means that e.g. the total energy used for running a long batch job is roughly constant. If you lower the voltage, you don't decrease performance at all, but still lower the power consumption. It's a free lunch, right up until your CPU starts silently generating the wrong results and possibly corrupting your entire system.
On top of this, CPUs now often will (internally, or with the help of the motherboard chipset) dynamically alter their clock based on the temperature. So undervolting reduces the power consumed at a given temperature, which will increase the speed your CPU runs at, if you are thermally limited. This means a setup with poor cooling will use the same amount of power before but run faster.
the CPU has different ACPI P-States, different power level modes that the governor will switch between.
but each of those states has an assigned voltage to it. you can tell a governor to keep using lower power states, but those states may still be supplying more voltage/power than the CPU requires to run.
under-volting is about adjusting the power level for a given state. there's a very broad ranging article on AMD Zen architecture[1] that i love, from Matt Dillon, creator of DragonflyBSD, and it talks some to undervolting & how it can be useful for their big build-servers & others. [edit: wait no, wrong link: it was THIS other huge thread from Dillon[3] that included low power musings, but still no explicit undervolting, just setting the thermal limit lower].
[1] https://github.com/kevinlekiller/amdctl
After all, the voltage regulators for the CPU core are off-chip on the motherboard...
For a glorious short time with Haswell, the VRM was fully integrated onto the processor die. It led to increased heat, obviously, but if you properly cooled the processor, you could stop worrying about your VRM failing.
MSRs can also be added by microcode update as we saw with MSR_IA32_SPEC_CTRL, which was used to mitigate Spectre (among other things).
Disclaimer: I work on Linux at Intel, and I was one of the ones posting in that LKML thread quoted in the article.
Speculation being that it was just non-K cpu owners.
:(
And if you didn't want that, well surprise, Windows 10 did it for you anyway! At least it's not permanent, it just loads on boot.