Gstreamer gst-lanch quits abnormally after running for a while

gstreamer( gst-lanch 1.0) quits abnormally after running for a while, restarts the service (systemctl restart nvargus-daemon.service)and it works fine.
eg1.
gst-launch-1.0 \ nvarguscamerasrc sensor-id=0 \ ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=(fraction)30/1' \ ! nvvidconv ! 'video/x-raw,width=768, height=432' \ ! fpsdisplaysink text-overlay=1 video-sink=xvimagesink sync=0 -v

eg2.
def gstreamer_pipeline(vc, display_width=768, display_height=432):
return (‘nvarguscamerasrc sensor-id=%d !’
‘video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=(fraction)30/1 !’
'nvvidconv ! ’
'video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! ’
'videoconvert ! ’
‘video/x-raw, format=(string)BGR ! appsink’
% (vc, display_width, display_height))
cmd = gstreamer_pipeline(self.vc)
print(cmd)

    self.cap = cv2.VideoCapture(cmd, cv2.CAP_GSTREAMER)

,

One other question, how do I use fpsdisplaysink in opencv and how does it work with appsink?

What’s the BSP version?

cat /etc/nv_tegra_release

yt2@yt2mipi:~$ cat /etc/nv_tegra_release

R35 (release), REVISION: 3.1, GCID: 32827747, BOARD: t186ref, EABI: aarch64, DATE: Sun Mar 19 15:19:21 UTC 2023

Boost the clocks to try.

sudo jetson_clocks
sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate