I am using JetPack 4.4 on Jetson Nano with DeepStream 5.
I am trying to copy a frame from
NvBufSurface to conventional device memory.
As described in DeepStream ds-example plugin, one can access buffer data in CUDA using CUeglFrame:
CUeglFrame egl_frame; CUgraphicsResource p_resource = NULL; cuGraphicsEGLRegisterImage(&p_resource, ip_surf.surfaceList.mappedAddr.eglImage, CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE); cuGraphicsResourceGetMappedEglFrame(&egl_frame, p_resource, 0, 0);
Having a frame in YUV NV12 format in buffer, I successfully get
cudaArray pointers to planes (
egl_frame.frame.pPitch for the luma (Y) plane and
egl_frame.frame.pPitch for UV plane). Using texture-related function (
tex2D<uint8_t>(tex_obj, x, y) in copy kernel) I can copy luma component completely, but when I try to copy UV plane I could n’t get fully colored image. It seems like only one component either U or V is copied. Could someone please give a hint on a way to do this?