Extra memory usage in GPU0 when testing deepstream-segmentation-app in GPU1

it is a reproducible bug, nvinfer plugin is opensource, please use this workaround:

  1. modify /opt/nvidia/deepstream/deepstream-6.1/sources/gst-plugins/gst-nvinfer/gstnvinfer.cpp, like this:
    static gpointer gst_nvinfer_input_queue_loop (gpointer data)
    {
    GstNvInfer *nvinfer = (GstNvInfer *) data;
    cudaSetDevice (nvinfer->gpu_id);

    }
  2. compile, then copy libnvdsgst_infer.so to /opt/nvidia/deepstream/deepstream/lib/gst-plugins, backup old libnvdsgst_infer.so first.