V4L2 bayer data to Native Buffer

How can we capture mipi bayer data by DMA mode ?
The nvv4l2 samples using dma fd created by Native buffer, But NV Buffer can not support Bayer 10bit.

What should we do?

Thanks for your help!!

You can refer to


There is gpuConvertYUYVtoRGB() in the sample, for your usecase, you would need to replace it with debayering function.

Thank you!

The v4l2cuda sample using MMAP or USERPTR , Do they have difference with DMABUF?
In my opnion, DMABUF offer less latency。Am I right?

You can set -u -z to have raw data in CUDA buffer, and use CUDA programming for debayering. If you need to utilize hardware engine such as converter or encoder, you can create NvBuffer and copy the data to NvBuffer. For supported format, please refer to


Ok,I see.

For bayer sensor, I can’t using DMA buffer to capture V4L2 image.
Meanwhile, I can using userptr and cuda managed memory to avoid memory copy between cpu & gpu.

Thank you!