CPU utilization using deepstream on Jetson AGX

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson
• DeepStream Version 6.2
• JetPack Version (valid for Jetson only) 5.1
• TensorRT Version 8.5
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)

I am using deepstream python to build inference pipeline on Jetson AGX board. The CPU utilization keeps increasing all the time exceeding 100%. The issue is cause by frame copy in probe function.

            frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)
            frame = pyds.get_nvds_buf_surface(hash(gst_buffer), frame_meta.batch_id)
            frame_copy = np.array(frame, copy=True, order='C')
            frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_RGBA2BGR)

I have tried to add :
pyds.unmap_nvds_buf_surface(hash(gst_buffer), frame_meta.batch_id)

but still have the same issue.

The function of this code is to transfer memory from the GPU to the CPU, and then all the data is processed on the CPU by OpenCV. This puts a heavy load on the CPU.

Is there any way to copy the frame without that heavy load. The CPU utilization keep increasing without stop.

You may refer to our demo to use cupy deepstream_imagedata-multistream_cupy.py.

1 Like

Thank you the issue was because of frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_RGBA2BGR) function and using numpy to convert the color format solved it.
Thanks

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