I encountered this same issue a month ago with my 27” Mid 2011 3.4gig I7 iMac 6970M 2Gig video card, 32gig ram, with a split FusionDrive( 2TB HDD/250 Samsung Evo850 SSD ). I tried everything that others have tried( PRAM/SMC reset, Disk Utility from Recovery, erasing the SSD drive, reinstalling the OS, RAM modules, Power Supply from iFixit was ordered in hopes that was it.
I upgraded the RAM from 20gig to 32, that didn’t help. I replaced HDD..still didn’t fix it. I replaced the power supply with the one I bought from iFixit, but that didn’t work either. For some strange reason, this only made my fans spin at full blast, and my computer would go to sleep every 27 seconds on the nose, very annoying, but the restarts were more intermittent and not as repetitive. Then I replaced the SDD drive, but it still didn’t solve the problem..which got me thinking a video card re-bake may help. Or maybe something to do with the power button, because when the computer shut down to restart, it would make the same sound it makes when the power goes out.
I took my iMac apart, and as I was removing the plugs for the power button and the IR sensor, I noticed that they came out easier than I remember..maybe that was causing some kind of feedback error which caused the computer to shut down and restart. I removed the video card, baked it( 400F/200C for 8 minutes-middle rack ). I replaced the thermal paste, on the i7 processor as well, put it all back together making sure that all the plugs were seated correctly, and now it runs like new again..it’s been 24 hours with zero issues. What a headache this has been..I love this machine and don’t need a new one.
The video card problem is because of the crappy heat sink tolerances..there’s a 3-4mm gap between the heatsink and all the chips on the card..thermal paste has to be blobbed on to the chips for it to make contact with the heatsink, which defeats the purpose. I used some thin aluminum plates, cut to the same size as the protrusions on the heatsink, and used thermal paste on both sides of the aluminum plate between the chips and the heatsink, so now most of the chips are making contact with the aluminum for better heat transfer. Temps are good, and I expect the video card will last longer before the next burn.
I hope this helps someone else out and maybe saves them a buck or two, but most of all saves them some TIME!