P2P DMA into GL Buffer


is there a way to directly P2P DMA into a GL Texture Buffer, without the need to cudaMemcpy?


Using CUDA? There is not.

Are there any ways you can imagine, which could be used to reduce memcopies? Basically now I have 2 copies

  • DMA into cuda buffer
  • cudaMemcpy into GL Pixel Buffer (1. memcopy)
  • GL Pixel Buffer Texture (2. memcopy)

Is there a way to use eglimagekhr or something to do a direct p2p memory?

There might be, and in that case that is not a CUDA question, and you are asking in the wrong place. I don’t know the correct forum offhand for that question.

Using CUDA and OpenGL, the method I know of is to start with a GL resource (such as a PBO) and map it into CUDA space using CUDA/OpenGL interop, for which there are sample codes showing how. There is then no need to cudaMemcpy anything into a GL Pixel buffer (your 2nd bullet). Whether or not you can DMA into such a buffer, I don’t know. Based on the “P2P DMA” I am somewhat familiar with (GPUDirect RDMA), my guess would be no. GPUDirect RDMA generally requires a buffer acquired using the defined method. I won’t be able to provide detailed assistance here, and its not even clear to me what you are doing. Your usage of “P2P DMA” suggest to me transfer of data from a 3rd party device (i.e. not a CUDA GPU). But maybe you mean something else.