Hello.
When I try to run many indepent gst pipelines in parallel using nvinfer and running inference on the same model file, the more cameras I add the bigger the inference time is.
For example: with one camera inference time is around 10ms, with two cameras it goes up to 18ms, with 3 cameras it goes up to 26ms. It roughly adds 8 ms of inference time for each new independent pipeline running in parallel.
I thought I could fix this issue by using nvstreammux and batching all frames of the cameras and running inference on all frames at the same time. Instead of having multiple independent gst pipelines, I have a single gst pipeline with many source branches that feed to a single nvstreammux element, which in turn feeds the nvinfer element.
Example: the cameras are all triggered at the same time. I get N frames and I set the batch-sizeproperty of both nvinfer and nvstreammux to N. So what happens is that the mux element will batch all N frames and then run inference on the batch of N frames at the same time. What I noticed is that the bigger the batch gets, the inference time also goes up, so it looks like the infernece is not running in parallel for each frame.
How can I obtain true parallel behaviour, meaning that the inference time will not go up as more cameras are added? If that’s possible, I believe that in this case I would be limited only by how many instances of my model can fit on the GPU at the same time, since they would all run in parallel.
Thanks!
Jose


