copying frames to opencv matrix causes segmentation fault even after following faq 5?

Here is the exact error I get,

Cuda failure: status=700
nvbufsurface: Wrong plane index(0)
GPUassert: an illegal memory access was encountered src/modules/cuDCF/cuDCF.cu 841
nvbufsurface: NvBufSurfaceMemSet: failed to set memory
nvbufsurface: Error(-1) in releasing cuda memory
(../inc/nvcudautils) Error ResourceError: e: an illegal memory access was encountered (cudaErrorIllegalAddress) (propagating from /vpi/ext/nvcudautils/src/AllocMem.cpp, function freeMem(), line 283)
(../inc/nvcudautils) Error ResourceError:  (propagating from /vpi/ext/nvcudautils/inc/nvcudautils/detail/../AllocMem.h, function operator()(), line 45)
(../inc/nvcudautils) Error ResourceError: e: an illegal memory access was encountered (cudaErrorIllegalAddress) (propagating from /vpi/ext/nvcudautils/src/AllocMem.cpp, function freeMem(), line 283)
(../inc/nvcudautils) Error ResourceError:  (propagating from /vpi/ext/nvcudautils/inc/nvcudautils/detail/../AllocMem.h, function operator()(), line 60)
(../inc/nvcudautils) Error ResourceError: e: an illegal memory access was encountered (cudaErrorIllegalAddress) (propagating from /vpi/ext/nvcudautils/src/AllocMem.cpp, function freeMem(), line 283)
(../inc/nvcudautils) Error ResourceError:  (propagating from /vpi/ext/nvcudautils/inc/nvcudautils/detail/../AllocMem.h, function operator()(), line 60)

Right now I’m trying to access frames from buffer and perform an action on the image. I am able to continuously access the frames for around 15-25 min and then it crashes reporting the above error. Any help would be appreciated. Thanks.

Hi,

Are you trying to create a gpumat from Deepstream?
If yes, please check this comment for the sample to create opencv gpumat from the Deepstream:
https://devtalk.nvidia.com/default/topic/1047620/deepstream-sdk/how-to-create-opencv-gpumat-from-nvstream-/post/5397368/#5397368

Thanks.