iMac login screen a mess. Logging in crashes the machine. Able to go into safe mode IMac 27" late 2009, replaced DVD drive with 256Gb SSD, replaced original failed drive with a 2Tb drive. Lived happily ever after for 3 years.

So this is started a few days ago. All of a sudden (usually when playing a video from youtube) my machine would completely freeze, except for the cursor which would magically acquire eight horizontal grey lines. 

A reboot would fix it, I could happily work and multitask until I play another video (I'm pretty sure every time this happened I was playing something from Youtube). A reboot fixed it. And then one day a reboot produced this sort of screen:



The screen is legible enough to be able to select my account and enter my password. Either of two things happen: either the machine simply crashes to black screen and reboots, or it spins a little and then issues me with a multi-language error message saying my Mac has been restarted due to a problem. Then it restarts, and we're back to square one. 

I am able to get into safe mode. Screen works fine (slow refreshes, but no artifacts), the mouse still has the lines. 

I can't get into diagnostics by holding D - the computer simply boots normally. In safe mode, when trying to fix permissions on SSD I get an error message. Doing sudo diskutil repairPermissions / results in:


  error -69789 permissions verify or repair failed underlying error 10
  posix reports no child processes


So what can I try doing before dragging my iMac to the curb?
So the fugly screen was the result of a burned out video card. I found a replacement (same exact model) online, and performed the surgery on my iMac. The patient lived and video problems went away. Repairing permissions on my SSD drive still don't work, but that's another problem.