from the log. the earliset failure log is log below, seems the CUDA conext is destroyed when the CUDA task is still running, could you check why & where CUDA conext is destroyed?
(python3:23215): GStreamer-CRITICAL **: 13:34:21.452: gst_buffer_get_sizes_range: assertion 'GST_IS_BUFFER (buffer)' failed
nvbufsurftransform.cpp(2369) : getLastCudaError() CUDA error : Recevied NvBufSurfTransformError_Execution_Error : (709) context is destroyed.