Adding my experience here. I had a 2011 27 iMac’s GPU go bad with the pink vertical lines. I’m in rural South Korea, so there weren’t a lot of options.
I considered baking, but longevity was an issue. This discussion and others like it helped me along. I got this Dell/Alienware GPU from Ebay (below, Apple on the left; new card on the right, note the two silver squares that have “R22” printed on them … those are too high for the heatsink and it’s not a perfect fit) and installed that with iFixit instructions (although there are no instructions specifically for a GPU swap on this model, the dual-drive install instructions got me where I needed to go.
The card is the correct size, but two parts on the card were too tall and left a big gap when the heatsink was put back on (below).
I salvaged two copper squares from the heatsink of an Apple laptop and used them as spacers with a generous helpings of Arctic Silver between each layer.
After that, I screwed the heatsink on tightly. It sits a degree or two off-straight, but works fine (below).
I got everything back together and booted to a black screen and waited (remember, this is the result of no Apple ROM). It all worked perfectly once the iMac reached the login screen. I installed Brightness Slider to adjust the display brightness and it works well enough.
After about 3 hours, the iMac went to sleep and when I woke it back up, the right half of the screen was about 50% darker. On a dead cold boot (e.g. after the weekend), the screen was normal, but then after a short period, the right half of the screen would darken.
I could still see things and get work done, so I put up with this for a few weeks until I had time to deal with it. The iMac itself was running just fine. When I had time to open it and lift the LED, my diagnosis was confirmed: the display data cable was getting too hot. There is tape to prevent, but it was worn/melted slightly (below).
I used more parts salvaged from the laptop to raise the display data cable up more than it had been. You can see in Step 10 of these instructions how the foam is strong and probably does the job right, but mine computer wasn’t like that, it was smushed down quite a bit.
I salvaged tape and the foam from the laptop. I didn’t need it to do much other than keep the heat off of the cable. I assume that because the heatsink didn’t fit properly and I didn’t pack all the chips with thermal compound (I didn’t have any), that excess heat is coming off of the wrong side of the GPU. This is something to deal with later.
The cable got the height needed when I lowered the screen back down.
The iMac works flawlessly now. I’m running High Sierra with the CUDA and web drivers suggested in this post. I did not need to have the drivers installed before swapping the GPU cards. YMMV.