I'm trying to mod a few cuda sample programs to learn the concepts. In my current test, I'm trying to mod the fluidsGL example into a shared library (.so) that's loaded in as a plugin by another application.
- The plugin launches it’s own window, using the glutCreateWindow(…) call.
- Subsequently focus on the window is lost to the host application. I presume this means the OpenGL context is no longer current.
- Focus is brought back by using the glutSetWindow(…) call.
- The advectParticles(…) kernel launch function fails on cudaGraphicsMapResources(…) call. The reported error is invalid OpenGL context, and the application crashes.
I haven’t been able to find any documentation on cudaGraphicsMapResources(…) in depth enough to figure out what information it actually needs. Does anyone have any ideas what may be causing this function to fail? and how I might fix it?