Using Cuda Memory type in Deepstream on Jetson Xavier

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson Xavier
• DeepStream Version 5.1
• Issue Type( questions, new requirements, bugs) Questions, New Requirements

For the last two weeks, I have been trying to get frames from deepstream into cv::cuda::GpuMat. I tried to do this with Eglimage, it was successful, but too slow. I have an open issue regarding this here.

In the mean time, I decided to use this approach. However, this approach requires CUDA memory type for the NvDsBufSurface. As I checked, the NvDsBufSurface that I obtain from buffer has the NVBUF_MEM_SURFACE_ARRAY type. So I decided to change it in my pipeline. I tried to set nvbuf-memory-type in both my nvstreammux and my nvvideoconvert. Neither did work. Both resulted in incompatible surf types (as if the pipeline did not expect them to have this type). I got errors like this:

i/p buffer mismatch ip_surf 4 mixer 1

or mixer 2, 3 based on the mem-type.

In the nvstreammux documentation here, it is mentioned that all of the cuda types are for dGPU.

Is there any way to have CUDA memory type (device, pinned, or unified) in DeepStream pipeline running on Jetson? Any sort of conversion? Or, perhaps, having the entire pipeline using this type.

I also found out that the mem-type conversion cannot be done on VIC. Given that it is the only acceptable compute mode for Jetson, I guess doing a conversion with nvvideoconvert cannot be a solution.

I appreciate any comment/suggestion on this, regardless of how old this issue gets.

Best.

No. CUDA memory is for dGPU only. No way to get it in Jetson.

NVBUF_MEM_SURFACE_ARRAY can also be access by CUDA. You don’t need to transform it to other types.

this approach has mentioned:

In Jetson platform, if memory of NvBufSurface is not in CUDA you must convert it to CUDA through CUDA-EGL interop before accessing it in OpenCV. Refer to sources/gst-plugins/gst-dsexample/gstdsexample.cpp to access the NvBufSurface memory in OpenCV matrix (cv::Mat).

Please check the get_converted_mat function code in gstdsexample.cpp

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