TJM-Tom wrote:
This a smaller iMac - 21inches(?) The only time I hear the fan is when I've run the hardware test. The machine does not run hot. Since my original post, I ran the extended hardware test with no problems showing.
The problem has re-occurred a couple of times since 12/27. I can run for days and not see it, and then ...
I am currently connected to a MacBook Pro using the iMac screen via Thunderbolt. Connecting (Command-F2) and the screen is fine. Switching back (Command-F2) the display is still messed up.
This eliminates the LCD Panel as the problem.
Shouldn't the problem show up in the hardware test?
Not necessarily. Diagnostics try to access the hardware in various ways to try and detect a failure, but the programmers cannot account for the infinite number of possibilities. The only time a diagnostic is useful in troubleshooting is when it reports an error. A passing test just means the diagnostic didn't detect a problem at that time.
And why is the display okay when I switch back and forth between native mode and as display for the MacBook?
The GPU, memory, and most of the Logic Board functionality is not being used when using the iMac as a display. As @BDAqua mentions it sounds like a GPU or memory issue. From what you describe GPU would be my first guess, but without actually seeing the issue it is hard to say.
You can run a more thorough memory test with Memtest86. Create a bootable Memtest86 USB drive using Etcher. Option Boot the USB drive and select the orange icon labeled "EFI".
You should take the computer to an Apple Store to be examined and have them run their more advanced diagnostics. Even if their service diagnostics do not detect a problem, seeing the issue first hand they may be able to tell which part is defective. I've seen some other contributors mention the Apple Store does not charge anything to examine your computer even out of warranty. However, this computer is considered "Vintage" so Apple may not be able to repair it.