How to tranfer yuv422 dma_buf fd from one process to another process

In order to get a better performance ,we want to send yuv422 dma_buf fd which was captured from driver to another process.i have read many blogs in nvidia developer forum,but i did not get good solution to resolve my question:
1.in some blog, they suggest to use sendmsg/recvmsg to pass fd, but,during my experiment,we can use sendmsg/recvmsg to send shm fd, it is not work for dma_buf fd of yuv422 image data
2.in some blog,they suggest to use eglstream and cuda interops, but it still have memory copy,it is not memory zero copy
is there any high performance solution(zero memory copy) to resolve my problem
thanks for your help

my orin box is jetson orin
jetpack version is R35.1.0

Please check the MMAPI sample code v4l2cuda/12_camera_v4l2_cuda if match your request.

Thanks

thanks,but in my solution,i want to transfer dmabuf_fd from A process to B process,

Have a check below topic if help on you.

/usr/src/nvidia/graphics_demos/eglstreamcube/x11
/usr/src/nvidia/graphics_demos/ctree/x11
yes,these samples can demonstrate that shm fd and eglstream fd can be transfered from one process to another process using sendmsg/recemsg, but cannot demostrate dmabuf_fd could be transfered from one process to another process, could you please help to charify that whether dmabuf_fd could be transfered from one process to another process or not?

Hi,
This is not supported on Jetpack 5.0.2. It is under development.
Now the possible solution on Jetpack 5.0.2 is to use EGLStream. Or convert YUV422 to YUV20, encode to h264/h265 stream and send out to another process through UDP.

the possible solution may be like this, is it right?
A process: dmabuf_fd → EGLImage->EGLStream->export eglstream fd → sendmsg
B process: recemsg → get eglsteam fd->EGLStream->cuda buffer

Hi,

Yes, this should work on Jetpack 4 and 5.

1 Like

ok,thank you very much