Trying to figure out GL texture interop with CUDA driver API

I’m a bit confused as to what is the full workflow for the right way to get a CUDA kernel to write data to a GL texture. There are GL interop samples but none of them are for the Driver API.

The manual has large sections of GL interop marked as deprecated. For example the function “cuGLCtxCreate” is deprecated. Is there a new function to call to create a GL sharing CUDA context? Is this information somewhere?

Thanks
Russell

I have no experience with OpenGL interop whatsoever, but I would understand these two facts in combination as a pretty strong message that OpenGL interop using CUDA’s driver API should be avoided for forward-looking software development (deprecation means this feature is scheduled to be removed eventually; that could possibly happen many years into the future, of course). Other people may have a different interpretation.

My understanding of the CUDA driver API is that it’s a lower level entry to the CUDA hardware. On that basis, I would expect that it provides all of, if not more flexibility than the runtime API (albeit requiring mode lines of code).

I was under the impression that GL interop itself is not deprecated, just the method has changed but there isn’t enough documentation showing the new intended usage pattern.

Note that these forums are primarily for user-to-user communication, and that NVIDIA never comments publicly of future product plans as far as I have observed. However, again based on observation, when NVIDIA marks a feature deprecated, they will remove it eventually, although removal has at times happened only several years after deprecation.

The following is all speculation on my part. For an authoritative answer, you might want to contact NVIDIA directly.

From observation, the vast majority of CUDA programmers appears to use the runtime API. A relatively small number of CUDA programmers use OpenGL interop. That leaves a tiny number of CUDA programmers who use OpenGL interop with the driver API. Maintaining dual APIs means additional work, and that extra effort may not be warranted for the small number of OpenGL+Driver API users. There may also be technical aspects, in that the runtime API can easily carry a lot of information under the hood.

I would think that for as long as NVIDIA supports OpenGL, there will also be support for OpenGL interop in CUDA. That is needed for professional CUDA-accelerated visualization products, in science and elsewhere. But the information you presented above leads me to believe that OpenGL interop with the CUDA driver API may be on the way out.