CUDA pinned memory to NvBuffer

We’re currently developing something based on the following example:

So we want to transfer video over PCIe, but now my question is how I would get the result of this into an NvBuffer? Our goal is to create a gstreamer node we can pass to other nodes using NVMM, and from what I can see in the gst source code provided this would require us to put this into an NvBuffer.
So how do I put the pinned memory result from the PCIe transfer into an NvBuffer and assign it the correct parameters?

Thanks in advance,

Are you able to get frames through v4l2? If yes, you can check 12_camera_v4l2_cuda to capture data into NvBuffer directly. Or use NvBuffer APIs to get CUDA pointer of the buffer and copy data to the buffer through CUDA APIs.

Hello Dane,
Thank you for the response, we could theoretically push the frames through v4l2 but the framework doesn’t exactly suffice for as we’re also looking to push video back into the FPGA (or even compressed streams) so our FPGA does much more than just being a framegrabber and v4l2 doesn’t really seem suited for that as we’d like more granular control over the flow.
The NvBuffer and getting the CUDA pointer there and copying data directly into it sounds much more what we’re looking for, is there any example on how I’d go about that?


Please refer to cuda_postprocess() in 12_camera_v4l2_cuda, and HandleEGLImage() in


I think that’s exactly what I’m looking for, this can get me started on figuring out the rest.
Thanks Dane.

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