I work at an electronics repair store where I repair Macbooks that has died from water damage or just died on their own. (I'm writing this on my Macbook Air that I bought cheaply because it was dead after the seller spilled water on it. Using my skills and the equipment at work I repaired it and is now fully functioning.) I often get 15/17 inch models that has the same issue as you. There's no permanent fix for it. Even if you did have skills and the $10 000 machine required to do the work, you can't even buy a new graphics chip anywhere as no one is selling it. I've been on the phone with customers who have gotten angry when they figure out all that can be done is to throw their Mac away.
Even if you did go to Apple and paid $500-900 to replace the motherboard, they'd most likely give you a "refurbished" motherboard that will most likely have the same issue in a couple of months. Apple say "a small percentage" is affected, but I'd say most of the models I mentioned are affected. These things are dying like flies.
The best way to fix it, and that's only a temporary fix, is to heat the GPU. As I said, it's just a temporary fix, and it will die again. But it might fix it for a while.
Macbook pro 2012 graphics issue - YouTube