Memory Compatibility Error When Using nvurisrcbin and nvstreammux on Different GPUs

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) two 3090 RTX
• DeepStream Version 9.0
• JetPack Version (valid for Jetson only)
• TensorRT Version deepstram installation guide
• NVIDIA GPU Driver Version (valid for GPU only) 590
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

I am running a DeepStream pipeline on a system with two GPUs. My intended configuration is:

  • GPU 1: nvurisrcbin and hardware decoding
  • GPU 0: nvstreammux and the remaining downstream elements

However, the pipeline stops with the following error:

Memory Compatibility Error: Input surface gpu-id doesn't match with
configured gpu-id for element. Please allocate input using unified memory,
use the same gpu-ids, or, if the same gpu-ids are used, ensure appropriate
CUDA memory types are used.

gstnvstreammux.cpp(390): blit_buffer():
/GstPipeline:deepstream-pipeline-.../
GstNvStreamMux:nvstreammux-...-stream_muxer

According to the attached DOT graph, the source is configured as follows:

nvurisrcbin:
    gpu-id=1
    cudadec-memtype=memtype_unified
nvstreammux
nvbuf-memory-type=nvbuf-mem-cuda-unified

I also found the internal nvv4l2decoder0 element and manually set its cudadec-memtype to unified memory. However, the same GPU-ID mismatch error still occurs.

The memory type setting is not complete with nvurisrcbin. The element is open source in /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvurisrcbin, please modify the code to add memory type setting with “nvvideoconvert” element in the bin too. Then you can use the modified nvurisrcbin to set all hardware related elements to use unified CUDA memory type.

The sample of the modified nvurisrcbin:
/opt/nvidia/deepstream/deepstream/sources/include/gst-nvdscommonconfig.h
/opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvurisrcbin/gstdsnvurisrcbin.h
/opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvurisrcbin/gstdsnvurisrcbin.cpp
gstdsnvurisrcbin.cpp (96.8 KB)
gstdsnvurisrcbin.h (3.9 KB)
gst-nvdscommonconfig.h (4.5 KB)

thanks for your reply,
replacing your 3 files with my source codes and build it will fix the problem?
i can’t see it’s property in gst-inspect-1.0 nvurisrcbin

You need to set the memory type by the new added property in your app. You can compare the code to the original code to get the actual name of the new property.