Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU) Jetson ORIN NX 16GB
• DeepStream Version 6.2
• JetPack Version (valid for Jetson only) 5.1.2-b104
• TensorRT Version TRT 8.5.2.2
• NVIDIA GPU Driver Version (valid for GPU only) N/A
• Issue Type( questions, new requirements, bugs) Bug
• 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) Running the pipeline for a few hours will lead to the bug.
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)
I’m having trouble with the bug below:
nvbufsurface: Wrong buffer index (1)
get_nvds_buf_surface: Failed to sync buffer to CPU
Those two messages keep popping up at 2 different times, once at startup but at this time it does not break/crash the pipeline, but once it appears another time the pipeline does crash, I’m using python bindings and I cannot upgrade to newer versions of deepstream either, as re-flashing the device for newer versions of jetpack is not an option at this time.
The code below is how I’m handling the buffer:
def handle_buffer_safely(self, gst_buffer, source_id):
try:
if gst_buffer is None:
logger.warning("GST buffer is None, cannot proceed.")
return False, None
if source_id < 0 or source_id >= self.target.number_of_inputs:
logger.error(f"source_id {source_id} out of range.")
return False, None
raw_frame = pyds.get_nvds_buf_surface(hash(gst_buffer), source_id)
if raw_frame is None:
logger.warning(
f"Failed to get buffer surface for source_id {source_id}."
)
return False, None
frame_copy = np.array(raw_frame, copy=True, order="C")
converted_frame = cv2.cvtColor(frame_copy, cv2.COLOR_RGBA2BGRA)
return True, converted_frame
except Exception as e:
logger.error(f"Exception in buffer handling for source_id {source_id}: {e}")
return False, None
finally:
try:
pyds.unmap_nvds_buf_surface(hash(gst_buffer), source_id)
except Exception as e:
logger.error(f"Failed to unmap buffer for source_id {source_id}: {e}")
It is worth mentioning that this bug occurs with all sources, not at the same time but from the 3 cameras I have all 3 of them have already fallen into the wrong index and then the failure to sync, I’m taking the source id from the frame meta being returned from pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer)), so it should be correct and no logs from the function to handle the buffer are printed so they are running without problems.
If I remove the calls to get_nvds_buf_surface and unmap_nvds_buf_surface it does not crash my pipeline, but I need it to extract the frames.
So I would like to know how to solve this, or workaround it.