I’ve looked at the sample, and mapping the surface in read mode like the sample code actually works:
NvBufSurfaceMap(surface, -1, -1, NVBUF_MAP_READ);
But I need to map it in NVBUF_MAP_WRITE mode, which causes the memory type error I specified earlier.
Should I map the surface in Read, then create a new nvbufsurface infer_buf and map it in read-write mode, modify it, then copy its content into the original with NvBufSurfTransform (inter_buf, surface, &transform_params); ?
from the error, NvBufSurfaceMap failed because memory type (2) not supported on dgpu.
please refer NvBufSurfaceMap sample opt\nvidia\deepstream\deepstream-6.2\sources\gst-plugins\gst-dsexample\gstdsexample_optimized.cpp, NVBUF_MEM_CUDA_UNIFIED is supported on dgpu.
No problem, yes it is an issue with the deepstream plugin Gst-nvvideoconvert whereby if the input format/resolution of the plugin is the same as that of the output the memory-type conversion won’t take place.
Currently, a workaround for this changing either the resolution or the format of the output. You can mark this issue as resolved but this still needs to be fixed in Deepstream.