We have a late 2012 27 inch iMac. It has a 2.9 GHz i5 processor and a 1 TB fusion drive along with 8 GB of RAM. I recently upgraded it to El Capitan.
A couple of months ago it randomly started to not wake up after being asleep. We would have to unplug it and plug it back in to get it back on. It also would just randomly shut off while we were using it. If we had music playing, the screen would go black and the music would stop so it's not a display issue.
I took it in to our local Apple store and talked to them about it and they said the first thing they would do would be to reinstall OS X. So I decided to do that myself but that still did not fix the issue.
I then lugged it back into the Apple store about 2 weeks ago and left it with them for a few days to get to the bottom of it. They repaired OS X and then put it through a battery of tests to see if there were any issues with memory or the hard drive but everything came back fine. They then left it plugged in with a bunch of graphics programs and videos playing and still had no issues.
At this point, I was thinking it was a power issue with the plug we were using. When I brought it home, we left it plugged in and running in our dining room for a few days and did not have any issues. I gradually loaded programs back on and still did not have any issues. I then moved it back upstairs but the other day it started acting up again on my wife. I moved it back to our dining room thinking it was the outlet up there, but it's exhibiting the same behavior there now.
After doing some searching online, I found this post http://samwize.com/2013/10/13/imac-shutdown-suddenly-and-randomly/. It seems to describe the issue we are having.
I was able to check the Console and it says the cause for shutdown is 0. I'm pretty sure the Apple store ran the hardware test and memtest while it was there. I have repeatedly reset the SMC, which the Apple store employee informed me is basically what I'm doing every time I have to unplug it and plug it back in.
The only thing I haven't done yet is a PRAM reset.
So, now I'm not sure what to do next. According to that post, his logic board needed to be replaced. The Apple store quoted me $583.32 to replace the logic board if that was what was needed. But I only want to do that if I know definitively that's the issue.
So sorry for the long post, but does anyone have a suggestion on how to root cause this?