I have frames in GPU memory and I am trying to push them into Gstreamer for nvvidconv and omxh264enc without copying them to CPU space first. To simplify the discussion, I have created a simple program where the appSrc creates grayscale frames, feeds them to nvvidconv (converts to I420) then omxh264enc, h264parse, qtmux and filesink. If I allocate the frames in CPU space, fill with vales (white, black, etc) everything works correctly.
However, when I set my appSrc with the following caps: “video/x-raw(memory:NVMM), format=(string)GRAY8, width=(int)2048, height=(int)1536, framerate=(fraction)30/1”, then I allocate GPU memory (using cudaMalloc, nppiMalloc_8u_C1, cv::gpu::Mat, etc), fill the memory using nppsSet_8u or cudaMemcpy2D etc then create a GstBuffer (using gst_buffer_new_wrapped_full and the gpu memory pointer), I get a message for every frame: “NVMAP_IOC_WRITE failed: Bad address”
I have increased GST_DEBUG up to include errors and warnings, but do not see any obvious errors. Even if I increase the output to Debug, I cannot get any information about who is sending the error message (likely nvvidconv).
I am basically looking to do the exact opposite of this guy:
I have looked at the NVXIO FrameSource and I see how they can pull NVMM frames out of Gstreamer, but the NVXIO Render doesn’t seem to have an example where frames are pushed into Gstreamer from GPU space (only CPU).
I have no doubt I am missing something obvious about Gstreamer memory access to gpu memory (specifically nvvidconv) or how to create a correct GstBuffer for GPU memory, but I cannot find any information on how to work with NVMM memory. Are there any examples of appSrc that allocates NVMM frames for nvvidconv?