If your 2011 iMac is failing to boot, has pink vertical lines on the screen or is otherwise showing unusual behaviour on the display, you may have a failing (or failed) GPU.
27 inch iMac models sold between May 2011 and October 2012 could have faulty graphics cards. This could show itself in a number of ways, the two most common are as follows:
1) The iMac starts booting MacOS, gets to roughly half way through the grey bar, freezes, and then suddenly shuts down.
2) The iMac boots, but displays pink or blue vertical lines, evenly spaced across the entire display.
Apple has stated that models with serial numbers ending in the following combinations could be affected:
DHJQ, DHJW, DL8Q, DNGH, DNJ9, or DMW8
DPM1, DPM2, DPNV, DNY0, DRVP, DY6F, F610