Download numpy image after a queue: possible concurrent access to the same memory?

Hello,

I am working with DS 6.0 and its Python bindings. I am running a primary detector on multiple streams. After that I have a nvstreamdemux element that split the batched data into individual stream’s data.

I want to retrieve the numpy image of each stream frame. I know how to do that using a probe. This works fine but it slows down the pipeline since the probe is blocking.

I was thing to add a queue after nvstreamdemux and right before the probe that retrieves the numpy frame. It is my understanding that the queue would create a new thread therefore avoid blocking the pipeline because of the subsequent slow probe.

However, is there any risk to encounter synchronization issue? Does the queue perform a deep copy of the data or does it just store the pointer to the data? If there’s no deep copy, I am afraid that there could be two concurrent access to the same memory location:

  • My probe retrieving the numpy frame
  • Nvstreammux (or another component) replacing the frame with a new one

What would happen?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• 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 the code on a Tesla T4 within the DS6.0 Triton Server container.

queue will work fine without issue. But maybe queue can’t fix your probe slow issue.

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