That’s almost identical with the simpleGL example from the SDK. All error codes are cudaSuccess but after this code is executed my computer hangs for a few seconds. No interaction at all possible. Then I get back control for a moment but shortly after it hangs again. Also my OpenGL viewport (interactive 3D walkthrough) is totally messed up. My scene is rendered with flickering artifacts or not all. When I comment out cudaGLMapBufferObject and cudaGLUnmapBufferObject everything works fine. Also the SDK samples run perfectly good. I’m really desperate and out of ideas. Is there any way to find out what’s going wrong?
Thanks for any help in advance.
Best regards,
Marco
My system:
Intel Core2 Duo
4 GB RAM
8800 GTX
CUDA 1.0
MS VS 2005
The register and unregister calls are just for showing the sequence of events. I actually don’t call any kernel right now, it’s really just mapping and unmapping. But I also had a dummy kernel running and the same thing happened too. The problem is in EmuDebug as well as in Debug the same.
I just looked at the OpenGL states with GLIntercept in my application and compared them with the simpleGL sample. There are some interessting differences that I don’t understand.
In simpleGL there seem to be more calls like glGpuSyncGetHandleSizeNVX for the same peace of code. It also looks like it doesn’t use the wglGetProcAdress call for getting the ARB extensions. Could there be a problem?
I have found the problem. The OpenGL error flag in my application was set to GL_INVALID_OPERATION somewhere else in my code. cudaGLRegisterBufferObject seems to check the flag and is interrupted. Unfortunatelly it doesn’t return an error itself but GLIntercept logged it. I just called glGetError() before registering/mapping my VBO and thereby cleared the flag. Now everything runs smooth.