I was fighting with my iMac until last week, when the only thing i could try was installing Yosemite Developer update (now on number 4)
The Yosemite could manage better the machine, but the squares and locks on machine wouldn't stop, but minimize.
Observing the machine, i could see that it freeze more when cool then when in heavy use. Everyday i start to use it, it lock some times, even moving a window on screen, then, after some warm up, it turn into usable.
So, today i try something different and unusual.
I put a mp4 video (720p one, with around 150mb) into loop playback. so, the GPU never goes unused 100%. (never could down enough)
And it works. No more square dots, no more lock on, until now.
The thing i think is the problem, is a bad manufacture and a soldering problem, so, when it is cold, the parts retracts and this soldering get with contacts problem. But when it is hot, the things expand because, and then this bad soldering keep connected.
Until i have a new machine, and then i can put this one to recall/change to another new video board, this will solve my problem.
I hope that could help you all.
Cheers