cudaGLGetDevices always returns unknown error on OS X

Hi, I’m writing a program that needs some interop with OpenGL on a MBPr with an GTX 650M.

I have tested the examples, including the ones with OpenGL interop, they all works fine.

The problem begins when I try to register a texture in a OpenGL 3.2 context, the cudaGraphicsGLRegisterImage always returns invalid value error while it’s ok when using a OpenGL 2.1 context.

Then I try to use cudaGLGetDevices to check the available cuda devices interop-able with OpenGL, then I find no matter using which OpenGL context, it returns an unknown error.

I have tested using both cuda 5.0 and 5.5.

Is there any successful example of cudaGLGetDevices and/or cudaGraphicsGLRegisterImage with 3.2 context on OS X 10.8?