You can not. As far as I know you can not change the graphics card in an iMac.
(Edit: I meant to an NVIDIA card. I think it's a connector and physical size thing)
I thought the same as Rick, above. But apparently, post-2009 iMacs can have their GPUs replaced, but this is not sanctioned by Apple and will void any warranty you still have.
Here's a guide at iFixit:
Rick and Andrew
Thanks for the helpful comments. I guess I'll have to do without CUDA. For the imac that I have the Apple company has a imac 27 inch AMD Radeon 6970M video card replacement program.
I read an artical somewhere (I can't find it now) that Apple will replace the AMD Radeon card with the Nvidia card for free if your 27 inch imac meets the criteria specified by Apple which mine does (except for the failing of the graphics card).