NvBufSurfTransform failed with error -1

Please provide complete information as applicable to your setup.

• Hardware Platform GPU
• DeepStream Version 6.3
• TensorRT Version8.6.1
• NVIDIA GPU Driver Version (valid for GPU only) 535.104.05
• Issue Type ** questions, new requirements, bugs)

Using new nvstreammux the nvbufsurftrasnform library fails with error -1:

gst-stream-error-quark: NvBufSurfTransform failed with error -1 while converting buffer (1): gstnvinfer.cpp(1463): convert_batch_and_push_to_input_thread (): /GstPipeline:inference_pipeline_0/GstNvInfer:detector

When the pgie tries to do preprocessing on the video-src.

• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

We have a decodebin that will read streams from a udpsrc like:

udpsrc ! queue ! application/x-rtp,encoding-name=H26X ! rtph26Xdepay ! h26Xparse ! nvv4ld2decoder ! nvvideoconvert flip-method=90 ! videorate ! video/x-raw(memory:NVMM), format=NV12, width={width}, height={height}, framerate={framerate}/1, gpu-id={gpu_id}, nvbuf-memory-type=nvbuf-mem-cuda-device ! queue

Some streams will have rotation so the widht and height properties are updated accordingly.

eg:

rotation_map = {
            0: "none",
            90: "clockwise",
            180: "rotate-180",
            -90: "counterclockwise",
            270: "counterclockwise",
        }
rotation_value = rotation_map.get(rotation, 0)

if rotation in [90, -90, 270]:
    height, width = width, height

Then this is attached to a new nvstreammux and goes to a nvinfer element that resizes the frames to 640x640

m.pad ! nvstreammux ! nvinfer ! fakesink

When running with multiple streams (reproduced with 60) the nvinfer will failed with the mentioned error, and will start logging [ERROR push 353] push failed [-5] disabling all inferring.

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Also there is a lot of warnings on the nvvideoconvert:

0:03:00.742824249 349371 0x7552a82fc060 WARN          nvvideoconvert gstnvvideoconvert.c:1962:gst_nvvideoconvert_fixate_caps:<decoder_nvvidconv_043c13c9-5771-494c-8829-481d18b9c3f8> gpu-id property is set based on SRC caps. Property config setting (if any) is overridden!!
0:03:00.743702496 349371 0x75513404be40 WARN          nvvideoconvert gstnvvideoconvert.c:1957:gst_nvvideoconvert_fixate_caps:<decoder_nvvidconv_605267f6-3b7a-4633-b0ec-6e7cb8f193cf> nvbuf-memory-type property is set based on SRC caps. Property config setting (if any) is overridden!!
0:03:00.743714036 349371 0x75513404be40 WARN          nvvideoconvert gstnvvideoconvert.c:1962:gst_nvvideoconvert_fixate_caps:<decoder_nvvidconv_605267f6-3b7a-4633-b0ec-6e7cb8f193cf> gpu-id property is set based on SRC caps. Property config setting (if any) is overridden!!

The following pipeline works well with DeepStream 6.3

gst-launch-1.0 udpsrc ! rtph265depay ! h265parse ! nvv4l2decoder ! nvvideoconvert flip-method=1 nvbuf-memory-type=2 ! videorate ! 'video/x-raw(memory:NVMM), format=NV12, width=1280, height=576, framerate=18/1' ! queue ! m.sink_0 nvstreammux name=m batch-size=1 ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_infer_primary.txt ! fakesink

Do you mean the error happens when the input sources number reach to 60?
What is the nvinfer configuration when you work with the 60 sources?

What is your GPU? A100? RTX6000?..
Can you measure the GPU loading and CPU loading when run with 60 sources?

On your single stream test, do you see the nvvideoconvert caps warnings?

Don’t you need to set the width and height swapped?

Does your model require a fixed size (scaling preprocessing) I am using a Yolo variant that scales the input to 640x640.


Your questions:

  • I mean the batch size is 60 (number of streams, live=1) not all streams are rotated, and the resolution is not the same for all streams.
  • Am able to reproduce the issue on A2, RTX A2000, and RTX3080 ti
  • This can be reproduced on both low level usage (~30%) and high level usage. (>85%)

No.

The nvvideoconvert can do scaling while flip.

The gst-nvinfer will do such thing. Please check the nvinfer configuration file /opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_infer_primary.txt

New nvstreammux does not support input sources with different resolutions. You need to scale them to the same resolution before the new nvstreammux.

Is the pipeline I post the same as your case? If not, please tell us what is the difference or just give us a pipeline which can run.

I am running some tests, just posting to keep the topic open.