Problem with CUDA on 2012 Macbook Pro with Retina Display

I am working with CUDA for my graduate degree and would like to be able to use it on my new laptop but for some reason I am unable to get it to work properly. I have an older mid-2009 MBP that has a working version of CUDA. I installed XCode from the App Store and then installed the 3 different files from NVIDIA needed to work with CUDA (CUDA Device Driver, CUDA toolkit, and Computing SDK). After installing all of these and making sure my path variables are correct in the .bash_profile file, I tried running the deviceQuery only to find that I can’t. Here is the error message that I get.

[deviceQuery] starting…

./deviceQuery Starting…

CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
[deviceQuery] test results…

exiting in 3 seconds: 3…2…1…done!

I’m not sure what the problem is. I have tried downloading CUDA 4.2 and 4.0 and both give the same result. If anyone has run into this problem will you please share with me what you did to solve it? Thanks.

This section from the release notes might apply to your problem:

Considering you know how to install CUDA using Xcode 4.3, I think you have just to turn of “Automatic graphics switching” in “System Preferences”->“Energy Saver”. I’m running CUDA in my Mac Retina smoothly.

hello, have you solved the problem? I meet the same question recently. Could you tell me how to solve it? Thanks very much!

It’s still broken. It’s because the GPU is totally shut down. Really shut down. So when CUDA asks “is there a GPU”, it doesn’t see one!

So you have to trick the GPU to wake up first. You can do this by issuing some GL calls just to force the GPU to turn on. You can also use GfxCardStatus to manually control it which is easiest if it’s just your machine. If you’re writing deployable apps for others, the GL-in-your-code method is probably best.