Not an expert but I’ve had similar issues
It’s might just be the monitor crashing because a memory issue. Have you ever tried to put your pc into sleep mode when this happens and turning it back on to find a flurry of colors?
What are you using as a monitor , perhaps some kind of tv?