Direct video frames copy from PCIe FPGA to NVMM memory

Hello,
we use Jetson Xavier, JetPack 5.1.2.

I have the following question: we have FPGA with PCIe and want to transfer video frames directly to NVMM memory such that no data copies on host are involved.

The process looks like this: nvv4l2camerasrc allocates NVMM memory using nvidia’s nvbufsurface APIs. The pointer to these buffers is then passed to the ptv4l2 kernel driver. The FPGA writes directly to this memory.

My questions are:

  1. is it true that in this case no additional data copies will happen and host is not involved? Does the host involvment and performance depend on memType of allocated NVMM buffers where we get data to? May it be that, for example, if memType is ““NVBUF_MEM_CUDA_UNIFIED” then the direct data copy happens, but if memType of the NVMM buffer is “NVBUF_MEM_SURFACE_ARRAY“, then some additional data copies happen?
  2. is this approach with the correct implementation of the FPGA driver as efficient as RDMA?

With the best wishes,
Valeriy

Hi,
If you use v4l2 interface to capture frame data, you can try nvv4l2camerasrc plugin in gstreamer or the jetson_multimedia_api sample:

/usr/src/jetson_multimedia_api/samples/12_v4l2_camera_cuda

So that frame data is captured into NvBufSurface(named NVMM buffer in gstreamer) directly.

yes, we use “nvv4l2camerasrc“ as I wrote in my question. But the topic of my question was different: is it true that in the case as I described above, the frames will come to the NVMM memory directly without the host involvment and with no intermediate data copies?

Does it depend somehow on the memType of the NVMM buffer which is allocated by the plugin?

Hi,
It doesn’t depend on memType, Either NVBUF_MEM_CUDA_UNIFIED or NVBUF_MEM_SURFACE_ARRAY can be v4l2 DMA buffers and frame data is captured to the buffers directly. You may refer to jetson_multimedia_api 12 and 18 samples. The nvv4l2camerasrc plugin is also public. You can download the source code and take a look.

Thank you very much for your answer.

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