High cpu usage with Zed-X-Mini connected on Z-Box (gmsl)

just running zed.grab() in a loop uses a lot of cpu (~30% of 8 cores).
Why is simply grabbing images taking so much cpu.
As there a way to use physical-to-virtual memory mapping to reduce cpu usage?
Is there a way to use pre-allocated buffers ?
The Mipi interface does some DMA directly to memory. Why is zed.grab() taking almost 2.5/8 cpu cores to execute?

Hi, are you encountering this with our tutorials ? Or can you share your code ?

I am using Stereolabs’s c++ Tutorial #2. The simple image capture one.

Tutorial 2 just takes 50 frames. Maybe what you see is a very short overhead that occurs during warmup. Or did you change it so that it runs for a while ? Can you share your code ?

Hello, I made a minor adjustment to tutorial#2 by adding a ‘while(true)’ loop. The CPU usage at the program’s start is as anticipated. However, it’s the CPU consumption during the program’s operation that worries me.

Also, as a new user I cannot upload an attachment. How would you like to the source file?

If that helps, the modified code of tutorial#2:

int i = 0;
sl::Mat image;
while (true) {
    // Grab an image
    returned_state = zed.grab();
    // A new image is available if grab() returns ERROR_CODE::SUCCESS
    if (returned_state == ERROR_CODE::SUCCESS) {

        // Get the left image
        zed.retrieveImage(image, VIEW::LEFT);
        // Display the image resolution and its acquisition timestamp
        cout<<"Image resolution: "<< image.getWidth()<<"x"<<image.getHeight() <<" || Image timestamp: "<<image.timestamp.data_ns<<endl;

Hi, if you just changed this line it should be fine. But I don’t encounter this issue. Can you try with the latest ZED SDK (4.0.7) ? What hardware are you using ?


We reproduce this issue internally. Thank you for reporting it ! We are investigating and will find a fix quickly.

Hi, any updates on this? This is slowing down our other inference workload on the same AGX Orin.