Trying to access frame using "pyds.get_nvds_buf_surface(hash(gst_buffer), frame_meta.batch_id)" but instead encountering with Segmentation fault

Hi I am working on python application test 1. I want to save bounding box region in memory. I am trying to access frame using below code inside
def osd_sink_pad_buffer_probe(pad,info,u_data):

n_frame=pyds.get_nvds_buf_surface(hash(gst_buffer), frame_meta.batch_id)
#convert python array into numy array format. frame_image=np.array(n_frame,copy=True,order=‘C’)
#covert the array into cv2 default color format

But I am facing segmentation fault error after processing of few frames. The same configuration and app file is working fine if I am not accesing frames.

• Hardware Platform (GPU)–> Tesla k40m
• DeepStream Version 5.0
• NVIDIA GPU Driver Version (valid for GPU only) -->440.100
• Issue Type( bugs)

Hey, we have a demo , have you checked it?

Hi , bcao. I have worked on this demo. But it works for me for few frames then stops, showing “bus error”. On changing some conditions the pipeline stops at starting. The code I have mentioned earlier was taken from this example only.

So the demo can work for you, right?
If yes, can you share all your code for debug?

Yes it is working , but in unreliable way, sometimes it runs to thousands of frames, sometimes just in hundred and stops abruptly.
something like this…

I am using rtsp stream.

My script is– (16.0 KB)

I think there is problem while integration of Opencv with gst plugin in my pipeline. I have added below in deepstream reference app after pgie , this is also generating bus error for me

Hi, I have found this stament in -
“On NVIDIA Tesla T4 with driver 450.51, using NVENC sometimes results into a CUDA
error. An alternative is to use software encoder for file and RTSP output.”

And I am using Tesla k40m. is this the reason for me getting bus error???

Sry for the delay,

Just to confirm, so the original demo which doesn’t include your own modification also stops abruptly and prints a bus error, right?

Yes it ends, when it tries to create the buffer to access the frame
i.e when the conditions satifies to run –

Sometimes it saves few frames with bboxes, but eventually stops with bus error.

Any reason you need to use the old nvidia driver, we suggest to use:

You must install the following components: - Ubuntu 18.04 - GStreamer 1.14.1 - NVIDIA driver 450.51 - CUDA 10.2 - TensorRT 7.0.X