• Hardware Platform (Jetson / GPU)
Jetson, NVIDIA Xavier NX 8GB • DeepStream Version
DeepStream 6.3 • JetPack Version (valid for Jetson only)
JetPack 5.1.3-b29 • TensorRT Version
8.5.2.2 • Issue Type( questions, new requirements, bugs)
questions
At a certain point in my Deepstream pipeline, I periodically need to retrieve a frame and check its average pixel value. To accomplish this, I decided to use the nppiMean_8u_C1R function inside the osd_sink_pad_buffer_probe(GstPad *pad, GstPadProbeInfo *info, gpointer u_data) callback.
At this point, I have a pointer d_img to the frame’s pixel data.
However, when I try to use d_img as the first argument in the nppiSum_8u_C1R function, I encounter a cudaErrorIllegalAddress error.
From what I understand, the issue is that d_img points to data with memType == NVBUF_MEM_SURFACE_ARRAY, while nppiSum_8u_C1R doesn’t seem to support this memory type.
My questions are:
Are NPP functions able to work with memType == NVBUF_MEM_SURFACE_ARRAY?
If YES, why am I getting this error?
If NO, what are my options:
Can I use NvBufSurfTransform() to convert the frame object from NVBUF_MEM_SURFACE_ARRAY to another memory type?
Can I use cudaMemcpy() to store the frame object in a compatible memory type?
I mean you can try to set the compute-hw=1 and nvbuf-memory-type=3 to the nvvideoconvert plugins in your pipeline. Then use this mem-type to see if your code runs properly.
OK. Since the npp cannot support the NVBUF_MEM_SURFACE_ARRAY type directly. You can map the buffer out first.
About how to map the buffer out from the nvbufsurface, you can refer to our source code sources\gst-plugins\gst-dsexample\gstdsexample_optimized.cpp.