NvMapMemCacheMaint Bad parameter - Unable to draw rectangles

• Hardware Platform Jetson
• DeepStream Version 6.3
• JetPack Version 5.1
• TensorRT Version 5.1

Hello, I have application that has primary (YoloV5) and secondary (LPRNet) gie, that detects license plates on two cameras and sends image and processed data to S3. Sometimes the application crashes due to this error:

2023-12-22 06:24:59.770 | INFO | utils.aws_util:put_object_to_s3:75 - Putting image to S3
NvMapMemCacheMaint Bad parameter
nvbusurface: NvBufSurfaceSyncForCpu: Error(4) in sync
libnvosd (121):(ERROR) : Cache sync failed
2023-12-22 06:24:59.776 | ERROR | utils.bus_call:bus_call:33 - Error: gst-resource-error-quark: Unable to draw rectangles (1): /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvdsosd/gstnvdsosd.c(559): gst_nvds_osd_transform_ip (): /GstPipeline:pipeline0/GstNvDsOsd:onscreendisplay
2023-12-22 06:24:59.777 | WARNING | utils.alert_utils:on_error:56 - ------> onscreendisplay: err: gst-resource-error-quark: Unable to draw rectangles (1), debug message: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvdsosd/gstnvdsosd.c(559): gst_nvds_osd_transform_ip (): /GstPipeline:pipeline0/GstNvDsOsd:onscreendisplay
2023-12-22 06:24:59.779 | INFO | main:main:337 - Exiting app
2023-12-22 06:24:59.806 | INFO | utils.probe_util:sgie_src_pad_buffer_probe:330 - Detected license plate NG7422
2023-12-22 06:24:59.807 | ERROR | utils.probe_util:sgie_src_pad_buffer_probe:334 - This license plate was in previous frame, skipping upload.
2023-12-22 06:24:59.807 | INFO | utils.probe_util:sgie_src_pad_buffer_probe:330 - Detected license plate NG7422
2023-12-22 06:24:59.807 | ERROR | utils.probe_util:sgie_src_pad_buffer_probe:334 - This license plate was in previous frame, skipping upload.
0:00:29.310992568 2656008 0x40bfa000 WARN nvinfer gstnvinfer.cpp:2397:gst_nvinfer_output_loop: error: Internal data stream error.
0:00:29.311022904 2656008 0x40bfa000 WARN nvinfer gstnvinfer.cpp:2397:gst_nvinfer_output_loop: error: streaming stopped, reason error (-5)
2023-12-22 06:25:00.168 | ERROR | utils.probe_util:on_success_img:26 - buffer closed!
libnvosd (390):(ERROR) : Error in nvll_osd_draw_rectangles_cpu[NvMultiObjectTracker] De-initialized
2023-12-22 06:25:00.503 | INFO | main:main:341 - Detection started at 06-24-29 22-12-2023
2023-12-22 06:25:00.504 | INFO | main:main:342 - Detection ended at 06-25-00 22-12-2023
2023-12-22 06:25:00.504 | INFO | main:main:343 - Detection time: 0:00:31
FATAL: exception not rethrown
Aborted (core dumped)

My pipeline:

        streammux.link(queue1)
        queue1.link(pgie)
        pgie.link(queue2)
        if nvdslogger:
            queue2.link(nvdslogger)
            nvdslogger.link(tracker)
        else:
            queue2.link(tracker)
        tracker.link(queue3)
        queue3.link(sgie)
        sgie.link(queue4)
        queue4.link(nvvidconv)
        nvvidconv.link(queue5)
        queue5.link(nvosd)
        nvosd.link(queue6)
        queue6.link(sink)

What confuses me the most is the message about drawing rectangles, but I have disabled all rectangle drawings and I use fakesink.
How can I debug this issue?

How can we reproduce the failure? There is no clue with your log

Hi, is there a way for me to collect better logs you can analyze? The application is complex and it wouldn’t be easy for me to share it here.

The gst-nvdsosd is open source, you can debug with your code to find the cause of the failure.
/opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvdsosd

I solved the problem. In case anyone ends up reading this topic, the issue was that I was calling unmap_nvds_buf_surface at wrong time in osd sink probe (within frame_user_meta_list while loop), so the solution was to move the call right before the end of the frame_meta_list while loop, like this:

        if is_aarch64():
            pyds.unmap_nvds_buf_surface(hash(gst_buffer), frame_meta.batch_id)

        try:
            l_frame=l_frame.next
        except StopIteration:
            break

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