These issues are no fun to deal with.
Understatement of the year.
What might be my biggest heartache with PCs in about fifteen to twenty years specifically came from troubleshooting this exact issue around half a year ago (WHEA error 18, "cache hierarchy" type). During all of my research, I found basically everything suggested as a possible resolution. Some had success with changing the CPU, some with RAM, some with the motherboard, some with the PSU, and some with the video card.
The last might seem like the least likely given the error type. I also presumed it was also a CPU or maybe platform side issue (RAM or maybe even motherboard/power related). But in my case, the error showed up when changing the video card. And it only happened when the GPU was under light-medium or higher loads. It would be be working fine, only to lose video signal, and then some seconds later it would restart (power was never off in the entire process so the PC never shut down but simply restarted). No BSODs at all. Just event viewer logs (ID 18) and Windows WHEA logs (generic 0x124 for WHEA, and paired with them, four different video related Watchdog logs).
I was lost as to whether the video errors were happening as a result of whatever the real issue was, or the other way around. The big clue was it started after changing the video card, but I wanted to rule out what may have been a possible hidden issue with my existing hardware that the video card change somehow brought about, before sending back a possibly good video card.
I tried just about everything under the sun from updating BIOS multiple times, changing no end of BIOS settings, changing driver versions, even reinstalling Windows. No change from any of it.
I tried swapping the CPU from a 5800X3D to my old 3700X to see if it was a CPU-side issue. No change.
I tried running with half the RAM (unfortunately, I didn't have different RAM to test). No change.
I tried disabling RAM profile speeds and running at default.
It got worse somehow. Things that didn't cause the restart before (League of Legends for example), now did. Things that did cause the restart, now did so more often. This part in particular made me cry because this suggested a platform-side issue, but the issue didn't exist on my old video card so I gave up platform troubleshooting for the time being and finally gave in to doing an RMA on the new video card since that where it started. I figured if the issue remained with an RMA (or if Sapphire said they found no issue), then I'd continue efforts on the platform at least knowing the GPU "should be" fine. These "Black screen restarts" were apparently very common on the 7800 XT from feedback online anyway despite the card being a mere two months old at the time, so... maybe there was something to it being the cause of all this afterall?
After the RMA, it was "almost entirely" resolved. I've had one reproducible case that still causes it (a particular version of Minecraft, and a modded one at that) and it seems... weird a game would cause a machine check exception if the hardware wasn't faulty to begin with, but... everything else that was doing it stopped. I'm still fearful the issue may return one day, but so far it hasn't. To say I'm still clueless as to what went on is an understatement.
So my main question to the thread starter would be this;
have you changed anything recently?
If not, do you have spare parts you can swap as a test? In my case, this helped me rule things out. I swapped everything but the PSU (no spare), RAM (no spare), and motherboard (I did have my old one as a spare, which as an RMA return itself due to the original having a separate issue, but it'd be time and effort intensive to test that one so I relegated it to after trying the video card RMA since that's where the issue showed up).