I see some documentation about some of the CUDA-GL interop being depreciated.
I guess that the cudaGL* (runtime) and cuGL* (driver) calls were depreciated at 3.0.
I’m starting a new project (AND I’m new to CUDA), and I’d like to know what set of calls
I should be using. I see some cudaGraphicsGL* calls… are those intended
for use going forward?
I’m a bit confused by them. The seem to set up some sort of resource pointers.
What are the calls dealing with these resource pointers that I need to use
in order to get pointers to GL buffers into my cuda kernels?
Will I be able to register a buffer only once, then just map and unmap it
as I use it? The old calls said I needed to unregister a buffer to allow
GL to render to it when I’m done with it.
Will I need some sort of cudaGLsetGLDevice () call… this call messes things up for me now.
So far, my best guess is something like…
// GLint bufID is the GL ID of the buffer I want to read.
static struct cudaGraphicsResource *rp = 0;
float *dp; // device pointer for data in GL buffer bufID
// call my kernel, with dp as a parameter here<<< >>>
… when I shut down:
Is this close? Any documentation or tutorials on what is the
suggested/current/modern way to access a GL buffer from CUDA?