Why is my Blender UI glitchy when using rendered preview?
I just found this thread on reddit (https://www.reddit.com/r/blenderhelp/comments/6h7aoh/blender_constantly_crashing_and_freezing_on/), where somebody asked a similar question. And the answer was to turn off nvidia shadowplay, or instant replay or whatever it's called. And it worked!

Case closed!