Cuda OpenGL Interoperability Issues

I’m trying to write some code to get a frame from a pbuffer to CUDA and having issues successfully calling the cudaGL functions.

I generate a buffer with a call to glGenBuffers() then cannot get cudaGL to go.
When I call cutilSafeCall(cudaGLRegisterBufferObject(buffer)); I get the following output

Calling cudaGLRegisterBufferObject()…cudaSafeCall() Runtime API error in file <pbwin.cpp>, line 636 : invalid resource handle.

I’ve been all over the web and I’m doing it the same way as everyone says but don’t seem to have the same results.

Thanks in advance for any help

Do the SDK samples work for you?

Yeah, thats why I’m so confused by this, everything about the buffer i am doing is the same as the examples and the examples work fine on my computer.