Calling cudaGraphicsGLRegisterBuffer twice for the same buffer object

Hi there,

I’m using OpenGL-Cuda Interop, in order to directly display the computed data. I generate a vbo and use its ID to get the device pointer like this.

cutilSafeCall( cudaGraphicsGLRegisterBuffer(&cudaGR[0], vboID, cudaGraphicsMapFlagsNone));
cudaGraphicsResourceGetMappedPointer((void**) &d_ptr, &Size, cudaGR[0]);


cutilSafeCall(cudaGraphicsUnmapResources(1, &cudaGR[0]));

Everything works fine. Now, there is another place in the code where a cuda kernel needs the data that is stored in the VBO. So basically, I used the same code as above and it also worked. Now, I did a driver update from 280.26 to 285.62 and calling cudaGraphicsGLRegisterBuffer the second time for the same vbo id results in a “Runtime API error 10208: unspecified driver error”.

I did not find any information if it is illegal to call cudaGraphicsGLRegisterBuffer twice for the same id or if it is a bug in the latest driver. Any ideas?

Thank you!

I’m having a similar problem attempting to register multiple pixel buffer objects that have the same ID - due to OO instancing (multiple concurrent instances of the same class resulting in identical bufferId()'s ).

Why register GL buffers more then once? In my ray tracing code I use 2 buffers that are mapped GL resources. They are registered only once in the initialization code and then used every frame, in a number of kernel calls per frame (mapped at the frame beginning and unmapped at the end of course). What is diffrent in my code is that I use driver API not runtime one, but this should not be a problem.

MK