Using glXCopyImageSubDataNV to transfer texture data between processes?

It seems several people online suggest that glXCopyImageSubDataNV should be able to provide texture data access between glX contexts in different processes, but I can’t find any actual mechanism to do the copy. Most people seem to suggest you can transfer the XID between processes to get the context and then do the copy, however I can’t get this to work, since the contexts are direct rendering contexts. As soon as I try to perform a glXGetContextIDEXT, it returns null.

Additionally I’ve tried making an indirect context on the transmitting side, however, any attempt to create an indirect rendering context there generally results in a null handle being returned by glXCreateContext.

I’ve heard rumors this should be possible by marshaling the objects through Vulkan but I can’t find any information on this and much less an actual example. This would be nonoptimal since both my sender and receiver are already opengl and not vulkan.

Any help or pointers with this that are actionable? Lots of people seem to have vague notions but no clear paths forward.

Ok. That’s interesting given NV_copy_image says:

So it would seem that the NV_copy_image verbiage means that either:

  1. Direct rendering is being used and the contexts are used in threads of the same process, or
  2. Indirect rendering is being used and the contexts are both contexts connected to the same X server.

I gather that you don’t care about #1, just #2.

Makes sense given that GLX_EXT_import_context says:

Are you getting an GLX or X errors when you try to do this?

I believe indirect implies using GLX protocol to communicate with the X server. Most distros have GLX support in the X server disabled by default for security reasons (in fact, the NVIDIA Linux graphics driver README.txt says “-iglx is the default in [X.Org X] server 1.17 and newer” [NOTE: -iglx disables indirect GLX protocol]). Have you enabled it? Note also the AllowIndirectGLXProtocol NVIDIA driver option which must not be set to false.

And have you allowed X server access to both apps?

It might be useful if you detailed the methods you tried. There are a number of possibilities here.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.