225 points · by franzb · 6y ago · 194 comments
Most (all?) Intel server CPUs in fact decrease clock speed when executing AVX2 (and some other) instructions to keep things a bit more sane. Vlad from Cloudflare wrote about this, more specific to AVX-512 back in 2017: https://blog.cloudflare.com/on-the-dangers-of-intels-frequen...
Then there is PROCHOT signal. Which is supposed to protect the CPU from getting too hot but keeps getting raised in lopsided AVX2 loads not because CPU is too hot but voltage regulation gets whacked.
You may wonder: what is an example of AVX2 heavy load. RSA multiplication is a good candidate. AES constructions or modes (CBC with SHA, GCM) are implemented in AVX2-BMI2 as well.
I debugged this problem over a number of years... I replaced the RAM, I replaced the motherboard, I eventually replaced the CPU... still happened no matter what I did. Even if I underclocked the machine and kept the voltages the same, instant crash. It was maddening.
Exasperated, I eventually busted out an oscilloscope and looked at the waveform on the 12V supply to the CPU. When starting the AVX benchmark, there was a huge brownout. That basically explained everything; my power supply essentially turned off when the CPU started drawing a ton of power. I replaced the power supply and got lucky -- it handled it fine and I could run the benchmark. I even got some overclock out of it.
After this whole experience, I've never looked at computers the same way again. You can buy high-spec brand-name components, and it's all just a crapshoot. Maybe your computer won't crash in the middle of an important task. Maybe it will. There isn't much you can do but cross your fingers.
I overbuy power supplies because I think, but have not tested, that it will convince them to run the fan at lower speed. This strategy has resulted in quiet, for sure, but I'm not sure that it gets you reliability.
Spending days trying to chase down an intermittent reboot just to find that your 750W PSU is actually shitting the bed around ~350W is a terribly unsatisfying journey.
Test the RAM in a known stable machine. If it passes an overnight memtest, then replace the flaky machine's PSU.
Gaming hardware has larger economies of scale which leads to more people running the hardware and submitting RMAs. Gamers are also more likely to overvolt their hardware, leading to most consumer components being overspec'ed for heat and power.
As such, the second revision of a gaming board imo is more refined than a workstation/server board that almost never gets a new revision.
On a more practical level, consumer CPUs usually have higher clockrates and newer architectures and gaming NVidia GPUs are so much cheaper than the enterprise product lines that you can buy multiple. My workflow is faster with the cheap stuff, sometimes twice as fast.
https://rog.asus.com/articles/usa/rog-overclocking-guide-cor...
It also does not test all parts of the processor equally, it really just is slamming the cache and the AVX units. You can be "Prime95 stable" and still crash in other things. It's just not a good test anymore in multiple respects.
Same thing for Furmark on GPUs. And nowadays GPUs are actually smart enough to realize they're running a power virus and the power management pulls back the power. So again, it doesn't demonstrate anything. Zen2 is supposed to work the same way, if it realizes you're redlining the chip then it should be clocking down somewhat.
Would you buy a GPU that you could safely run Furmark on 24/7 if it was limited to, half or 3/4 of the clocks? That's basically what you're proposing. I seriously doubt that you would actually lay money down for that shit. The market as a whole certainly wouldn't, they would buy the card that's faster under actual real-world workloads and/or didn't require manual overclocking to achieve its potential in real-world workloads.
The good news is that you can have it both ways. Modern power management is smart enough to figure out when you're running a power virus and it will downclock to those safe levels, while us normies can get competitive clocks when running our real-world code. It works pretty well most of the time.
So what you are really saying is Intel made another defective product.
AMD is subject to electromigration as well. I've seen a couple guys on Reddit already degrade their Zen2 chips from pushing 1.4V through them just during normal usage, not even Prime95. Literally weeks of usage.
Anti intel circlejerk ahoy.
Nice contrarianism.
Yes, you can run it, and it should run successfully. Yes, sustained testing will rapidly damage your processor and cause notable performance degradation (reduced maximum overclocks/increase in required voltages) within a matter of days, and yes, you can still crash in Aida64 or other stress tests because it's not testing the whole processor very well.
It's far outside the normal current draw, even compared to other AVX2 loads like video encoding. It's an AVX load that fits entirely inside instruction cache and will hammer the AVX2 units nonstop at the maximum possible rate with absolutely no other instructions going to any of the other units. That's not how any other workload behaves, even video encoding. CPUs are not designed around that, they're designed for some reasonably normal mix of instructions.
Yes, it's a good idea to stress your processor a bit more than normal to prove it's stable, but if you make your 'proof charge' too large you will still damage the firearm.
Nowadays it's just "up to XX GHz", and people expect it to run at those clocks.
AVX really pushes the CPU, an Intel Core/Xeon will hit the power draw limit pretty fast. They don't decrease clock speed as much as fall back to base clocks. The ones you paid for. Anything above that is just a bonus.
That said, you should never trigger PROCHOT even under full stress load with AVX! If you do, you need better cooling.
It's a last resort throttling feature for when your processor is hot enough to boil water :/
I still don’t understand what it is about avx2 that results in these kinds of issues - is it really just a matter of increased number of execution units running at once causing weird power and heat issues?
That's been the root cause of all the previous AVX weirdness I'm aware of. It's probably the case for these Threadrippers, too. Modern CPUs have very high power density and run at pretty low voltage, which results in insane current delivery requirements.
A normal multiply does 1 number at a time (32 bit for simplicity). AVX2 can do up to 8 multiplications at a time. That's a huge amount more transistors firing all at once and that causes the voltage to start to droop.
AVX-512 takes that even further and now it's 16 multiplications per unit, oh and Intel moved from 1x256-bit unit per core on Haswell/Broadwell to 2x512-bit units on Skylake-X, so it's potentially 32 multiplications at a time - 4x as much as AVX2.
Basically to prep for that much power being drawn all at once, the chip has to switch to a higher-voltage mode to account for the voltage droop caused by all those transistors switching at once in one place. It takes time for the regulator (on-chip Fully Integrated Voltage Regulator or motherboard VRM) to wind up the voltage far enough.
https://travisdowns.github.io/blog/2020/01/17/avxfreq1.html
https://travisdowns.github.io/assets/avxfreq1/fig-volts256-1...
At this level behavior is intensively analog and thermals/voltage both significantly affect transistor current draw and switching time, which feeds back into thermals and power consumption/voltage droop.
This gets even more problematic on 7nm/10nm type nodes and especially in GPUs where you are doing a huge amount of vector arithmetic all the time. Essentially it is no longer possible to design processors that are 100% stable under all potential execution conditions, or even under normal operating conditions, so you have to have power watchdog circuitry that realizes when it's getting close to brownout/missing its timing conditions and slows itself down to stay stable. That's why AMD introduced clock stretching in a big way with Zen2 (despite the fact that it's nominally been around since Steamroller). NVIDIA piloted this with Pascal, AMD piloted it with Vega and brought it to CPU with Zen2. You simply cannot design the processor to be 100% stable at competitive clocks anymore. You have to have power management that's smart enough to withstand small transient power conditioning faults.
https://semiengineering.com/managing-voltage-drop-at-107nm/
https://semiengineering.com/power-delivery-affecting-perform...
Edit: To be clear, the i5 9600k is sold as 3.7ghz with boost up to 4.6 on a single core. So there is a difference with the AMD case in that this doesn't happen on the setting Intel sell it at.
At some point it does stop being worth it though, because the power/voltage implications of 5 GHz AVX are so severe/potentially damaging to the chip. It is a lot of current and current kills chips. SiliconLottery does all their validation with a 200 MHz offset.
But yes, if you can get higher clocks at least some of the time then you might as well.
The other other downside is that flipping between power states can cause problems/crashes too. It shouldn't but it can.
Either a slight background workload (Windows seems to be trying to use half a core for an OS update) resolves this, or this board does not have a broken power design?
If you look at just the list of issues fixed in v29.x series there is more than one that is close to the code path that is problematic here:
https://www.mersenneforum.org/showpost.php?p=508842&postcoun...
I'm on a 3900X.
It seems to be a power delivery issue, and fortunately fixable if you disable all spread-spectrum and VRM power-saving options, but the Zen series seems a tricky beast.
I've had machine crashes triggered by using the "wrong" CPU scheduler under Linux. It's amazing, in a horrible way.
To my knowledge, AMD hasn't implemented any proactive measures that are as severe as Intel's AVX512 strategy, where the instructions get split and handled by the narrower vector units for a surprisingly long time while powering up the full-width vector units (and dropping CPU clocks). This AMD instability is only using AVX2: 256-bit SIMD rather than 512-bit. But spread across so many cores, that's still a lot of FPUs to be lighting up.
(Ok, it actually ramps up frequencies slower rather than lock out cores, but the effect is the same.)
https://www.youtube.com/watch?v=HMUWzDSAS9c
A very interesting watch if you're interested in electronics in general and in power delivery in particular (the whole YouTube channel is awesome to be honest).
Do they just not believe in compiler authors to be able to emit these kinds of hints? Is there too much legacy code that would come without the hints for it to be worthwhile? Would it just not be worth it given how often OS context switches could drop the CPU directly from regular code in one process to AVX2 code in another process?
> I observed an interesting phenomenon when executing 256-bit vector instructions on the Skylake. There is a warm-up period of approximately 14 µs before it can execute 256-bit vector instructions at full speed. Apparently, the upper 128-bit half of the execution units and data buses is turned off in order to save power when it is not used. As soon as the processor sees a 256-bit instruction it starts to power up the upper half. It can still execute 256-bit instructions during the warm-up period, but it does so by using the lower 128-bit units twice for every 256-bit vector. The result is that the throughput for 256-bit vectors is 4-5 times slower during this warm-up period. If you know in advance that you will need to use 256-bit instructions soon, then you can start the warm-up process by placing a dummy 256-bit instruction at a strategic place in the code. My measurements showed that the upper half of the units is shut down again after 675 µs of inactivity.
https://www.agner.org/optimize/blog/read.php?i=628
Agner also notes that previous generations would just flatly stall all instructions (including non-vector) once they saw 256-bit instructions, which is probably why there is no "warmup" instruction. If there is an explicit stall of all instructions then there are very few reasons to incur that until the last possible second.
But, if such "hint" ops were seen as the only viable way to get correct, high-performance behavior in these cases, and there was a commercial case to be made for it, I could see processor vendors adding them to the IA.
But I wonder if this is a Gigabyte issue who have a history of playing around with the power delivery and using "fake phases" (to the point where they now have to advertise their boards as having 16 "real phases"). As far as I can tell many (most?) reviewers benchmarked the board with 24 core CPUs and most likely skipped on the power intensive tests.
Everything in computer science is such a rabbit hole, great field to be in.
If these are on by default, are they required for FCC certification conformance? Presumably the device has not been EMI/EMC tested in the mode where spread-spectrum was disabled.
The frequencies are up in the microwave band, so I can't imagine there's much range.
If it was designed well ;)
But that's only effective for addressing radiated emissions, not conducted ones.
Or is it simply that delivering 200+W at load through a CPU socket can't be reliably done at consumer prices?
Anyone has had this problem with less high end CPUs? Something at 95-65 W?
The "CPU defective by design" in the title might be a bit misguided since the suggested workarounds do not address a CPU issue but a motherboard one.
My motherboard is the highest end consumer motherboard GIGABYTE has ever built (as far as I know), and I wouldn't say that they tried to keep costs down (it's listed at $849 on PartPicker, and it was introduced at $999) and the power delivery stage is insane. Here's BuildZoid's _in-depth_ review and analysis of its VRM: https://www.youtube.com/watch?v=HMUWzDSAS9c
I now literally go out of my way not to get the flagship motherboard models, even if it means holding off on a purchase until a lower-spec'd model comes out, and have never regretted it since. (I also will never again buy Gigabyte motherboards, either.)
Just because it's high end doesn't mean they won't cut corners or fail to test properly. My ROG motherboard was (at the time) the most expensive motherboard for the socket. Yet it behaved overall worse than many mid/low-end motherboards I owned, an experience shared with other owners of the same board. Even if this is a problem with the CPU that is mitigated by changing parameters of the motherboard it should have been caught during the motherboard design and testing. I can't imagine Gigabyte's engineers noticing this stuff and saying "just ship it like that, nobody will notice". So the best interpretation I can have is that they missed it during testing (the worst is that the marketing department said "we have to put it out there fast, all else be damned", and all else was damned).
Google's stressapptest runs fine for long durations, building a kernel with make -j32 succeeds (and can boot it), every parallelized archiver like 7z,pbzip2,pigz,xz is ok, and even gaming on a Windows VM using 8c/16t + GPU passthrough works well.
This is my first Ryzen system so I chalked it up to a possible carry over of DDR4 issues from earlier generations. I didn't investigate further since the 3950x had just been released and I couldn't find any other reports of prime95-only instability until now. And just to reiterate, it is perfectly stable otherwise.
Heavy AVX2 workload breaking things fits better so will have to try to collect more data.
Then we get the R480 melting cables for the same reason... and so on.
In this case, AMD wanted to keep using 6pin cable despite it not being approprite, on the 380 it just slowed it down.
On 380X, it is unstable, it still don't draw enough to melt things, but you need hackery to make the GPU useable
The 480 they outright made a GPU that used more power than the cables specs would allow, and insisted in using the same power delivery design the 380 had... Their "fix" to the issue was make patches that would just make the GPU run slow, and make it misbehave like the 380X does.
RX480 wasn't melting cables, it was melting motherboards. The stock VBIOS was pulling more power than the PCIe spec allowed you to pull from the slot. It was pulling over 100W, vs the 75W spec, not massive but probably enough to push some older/weaker boards over the edge (most of which were just ready to fail anyway and were going to fail from a solid 75W draw too).
https://www.tweaktown.com/news/52871/amds-radeon-rx-480-draw...
It's pretty hard to melt a cable. You can overdraw the connectors by roughly twice their rated power safely, and the cables will do more than that as long as you're not using splitters or some other hack.
The 295x2 pulled almost 500W through a pair of 8-pins and the slot (nominally that's 375W rated) while overclocking.
It could be that the spike is the problem not the end load. The scenario in play here is going from entirely idle to maximum load in an instant. So the CPU is going to shoot straight from ~20-30w usage to 280w (or even higher if the power management is a bit sluggish at reducing the clocks). That's a pretty drastic swing if anything isn't entirely up to spec, assuming the spec even handles this properly.
In theory the 3970X could even spike all the way up to 430w. The individual cores top out at 13.5w, so if they all end up running at single-core turbo frequencies even for a split second that's going to be brutal.
> Anyone has had this problem with less high end CPUs? Something at 95-65 W?
My 3700X in an old X370 board has been flawless. As has many others, Ryzen 5/7/9 are _widely_ recommended and have been for a while. Any systemic issues in the "regular" consumer end would have cropped up by now.
https://www.phoronix.com/scan.php?page=article&item=new-ryze...
> AMD has confirmed this issue doesn't affect EPYC or Threadripper processor
The CPU Michael was using was a Ryzen 7, not a Threadripper. But I don't know if TRs were later found to have the same problem, which wouldn't surprise me.
EPYC was on a different stepping entirely and didn't share dies with the consumer or HEDT processors. I suspect they likely had the tighter cache timings although I'm not sure on that.
Regardless, it's also possible that they were just binned out, or nobody ever encountered it. EPYC was not a very high-volume product, most people did test installations and said "yeah, we'll wait for Rome". Quad-numa on a package and lower-than-Intel IPC on a pretty poor node was not a winning formula.
Once the problem was realized, desktop Ryzen processors started getting binned for it as well. A few slipped through here and there, so it wasn't a manufacturing change, I think binning is the most likely explanation.
With AVX2 enabled, Prime95's torture test is only stable when I use 3 workers or less. With 4 workers one of them will abort due to an error within 20 seconds. The more workers, the sooner a crash; with 5 workers it happens within 10 seconds, and with 6 workers it happens within 2-3 seconds.
If I play with the tests on and off for a while, seemingly increasing the quiescent temperature of the CPU, the whole experience and testing actually becomes a bit more stable. My motherboard uses the B450M chipset.
https://forum.level1techs.com/t/3970x-prime95-stability/1532...
I know air coolers can be competitive, but it says right on the outside of the 2950X box that you should use liquid cooling.
I have a machine running a 1950X and I get random ffmpeg segfaults anywhere from six to eight hours in to an encoding session with all 16 cores fully loaded, but the machine is prime95 stable for a week+, so I suspect it's an AVX/AVX2 issue.
Not the easiest one to configure though.
https://www.majorgeeks.com/files/details/intelburntest.html
https://www.techpowerup.com/download/intelburntest/
(Not sure which is the canonical source...)
I've ran it for 5 hours (20 iterations) at the maximum stress level but it passed. In my limited experience, it's less punishing than Prime95.
To be clear, I'm not the one who plugged a scope to my motherboard, another 3970X owner did. I wish I had a scope! (The Rohde & Schwarz RTB2000 is my dream!)
Either way, you might consider bringing this to the attention of the ffmpeg developers [0]. If they don't have a fix already, that may appreciate your help in root-causing the bug.
For everything else, though, there doesn't seem to be any cause for concern. It's currently a single stress test in a single very specific configuration that's failing.
For reference the tests that pass:
MemTest86 v8.3, 4 passes (~8 hours), RAM at 3466 MT/s [PASS]
MemTestPro 7.0 (paid version of HCI MemTest), 700% (~5 hours), RAM at 3466 MT/s [PASS]
AIDA64 6.20.5300 System Stability Test (full system test except local disks) [PASS]
IntelBurnTest v2.54 (based on Intel Linpack), maximum stress level, all available RAM, 20 runs [PASS]
OCCT 5.5.3 test, large data set, 64 threads, AVX2 [PASS]
Google stressapptest 1.0.9, all available RAM [PASS]
Prime95 v29.8 build 6 torture test, 64 threads, min/max FFT = 4K, in-place FFTs, AVX2 (~1 hour) [PASS]
Prime95, min/max FFT = 8K, in-place FFTs, AVX2 [PASS]
Prime95, min/max FFT = 16K, in-place FFTs, without AVX2 [PASS]
The tests that fail: Prime95, min/max FFT = 16K (in-place FFTs or not), with AVX2 [INSTANT FAIL]
Note that an AVX2 workload is both in the passing & failing camp. So it's not as clear cut as "AVX2 doesn't work"Read DerAlbi’s (recent) reply on thread:
https://forum.level1techs.com/t/3970x-prime95-stability/1532...
I.e. if an AMD CPU suits your needs, you should get one (unless you are doing Prime95 as a load!), and perhaps avoid a MoBo with that VRM. Or wait a couple of days for the truth to percolate up through the murk.
Based on oscilloscope analysis of the VRM output in a linked thread elsewhere in the comments it looks like the board’s VRM design, or its configuration by the board’s BIOS, may be the most likely suspect.
But there are less-researched reports of similar issues on other boards as well, which makes things a bit more murky.
Given the uncertainties there it may put some people off from buying into the TR/sTRX40 platform in general. But to offer a blanket recommendation to avoid is a bit premature.
It could even be an uncorrectable flaw in the device design, in which case AMD will likely do as they did in 2017: replace the parts.
Shouldn't these devices have been tested by AMD and motherboard manufacturers for months before they were released? Including on workloads like Prime95 which are well known to uncover system instabilities.
Keep in mind also that this is not the first time in the Zen/Zen2 history that AMD has shipped buggy products: there was the segfault bug, the random number generator instruction bug, and the unbootable Threadripper on recent (at the time of release) Linux kernel. The worst part, to me personally, is that they were all "surface bugs" that could have been detected by AMD with a little bit of testing.
I've been wondering why Supermicro isn't releasing any Threadripper motherboards (while they do for Xeon-W). Maybe this explains it: the consumer CPU business at AMD is a circus and Supermicro wants none of it?
There's only a couple of datapoints. No official confirmation of an issue. This could be the fault of the CPU, Chipset, specific motherboard, or a bad batch.
It appears to be a VRM issue, either a design flaw or incorrect setup by the BIOS.