1) Flash it with compatible ROM. You need another machine to remote control the iMac with K4100m installed, and boot from a special made USB to Linux. Go to the first post on the famous thread 2011 iMac GPU upgrade to find necessary info and files to build the Linux USB.
2) Check if the iMac is still functioning with a stock GPU.
3) if both 1) & 2) are OK, your should get the screen showing boot screen when pressing Option on boot.