Jetson Nano: Deepstream Plugin Memory Management for OpenVX

Hello @DaneLLL ,
thank you for your time, I have figured it out thanks to one of your older posts. For those who come across the same issue here is the proper way to create vxImage from NvBufSurface.

First comes the convertion from NvBufSurface to EGLImage. Original code is from DaneLLL’s older post

1->NvBufSurfaceMemSet ();
2->NvBufSurfaceMapEglImage ();
3->cuGraphicsEGLRegisterImage();
4->cuGraphicsResourceGetMappedEglFrame);
5->cuCtxSynchronize();

then;

vx_image vxInp = vxCreateImageFromHandle(context, VX_DF_IMAGE_RGBX, &vx_imagepatch_addressing, eglFrame.frame.pPitch, NVX_MEMORY_TYPE_CUDA);

After this NvBufSurface should be accessible by OpenVX properly for processing without any need of CPU access or OpenCV convertion.

1 Like