Deepstream-app failing on dGPU when creating output file (works on jetson xavier nx)

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
RTX 2080 Ti
• DeepStream Version
5.0
• JetPack Version (valid for Jetson only)
• TensorRT Version
7.0
• NVIDIA GPU Driver Version (valid for GPU only)
450.57
• CUDA Version
10.2

Hi I am executing following deepstream-app command but failing as trying to save to file (please note converted engine file for xavier nx works fine for both EglSink and file).

On RTX 2080 Ti if I set output to fakesink then application run is successful.

LD_PRELOAD=TensorRT-7.0.0.11/lib/libnvinfer.so ./deepstream-app -c …/…/…/objectDetector_Yolo/deepstream_app_config_yoloV4.txt
Unknown or legacy key specified ‘is-classifier’ for group [property]
0:00:01.552490637 30292 0x55c7c3c09300 INFO nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1701> [UID = 1]: deserialized trt engine from :/home/deepstream-5.0-demos/sources/objectDetector_Yolo/yolov4_1_3_608_608_dynamic_fp16.engine
INFO: …/nvdsinfer/nvdsinfer_model_builder.cpp:685 [FullDims Engine Info]: layers num: 3
0 INPUT kFLOAT input 3x608x608 min: 1x3x608x608 opt: 4x3x608x608 Max: 8x3x608x608
1 OUTPUT kFLOAT boxes 22743x1x4 min: 0 opt: 0 Max: 0
2 OUTPUT kFLOAT confs 22743x80 min: 0 opt: 0 Max: 0

0:00:01.552581373 30292 0x55c7c3c09300 INFO nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1805> [UID = 1]: Use deserialized engine model: /home/deepstream-5.0-demos/sources/objectDetector_Yolo/yolov4_1_3_608_608_dynamic_fp16.engine
0:00:01.576335591 30292 0x55c7c3c09300 INFO nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus:<primary_gie> [UID 1]: Load new model:/home/deepstream-5.0-demos/sources/objectDetector_Yolo/config_infer_primary_yoloV4.txt sucessfully

Runtime commands:
h: Print this help
q: Quit

p: Pause
r: Resume

** INFO: <bus_callback:181>: Pipeline ready

** INFO: <bus_callback:167>: Pipeline running

ERROR from sink_sub_bin_encoder1: Device ‘/dev/nvhost-msenc’ failed during initialization
Debug info: gstv4l2object.c(4070): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstBin:sink_sub_bin1/nvv4l2h264enc:sink_sub_bin_encoder1:
Call to S_FMT failed for YM12 @ 1920x1080: Unknown error -1

Same spec files for xavier nx works fine.

Regards,
Ghazni

deepstream-app-config-yolov4.txt

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5

[tiled-display]
enable=1
rows=1
columns=1
width=1280
height=720
gpu-id=0
nvbuf-memory-type=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=3
uri=file://…/…/samples/streams/sample_1080p_h264.mp4
num-sources=1
gpu-id=0
cudadec-memtype=0

[sink0]
enable=1
type=3
sync=0
source-id=0
gpu-id=0
nvbuf-memory-type=0
container=1
codec=1
output-file=yolov4.mp4

[osd]
enable=1
gpu-id=0
border-width=1
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0

[streammux]
gpu-id=0
live-source=0
batch-size=1
batched-push-timeout=40000
width=1920
height=1080
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
model-engine-file=yolov4_1_3_608_608_dynamic_fp16.engine
labelfile-path=labels.txt
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
interval=2
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary_yoloV4.txt

[tracker]
enable=0
tracker-width=640
tracker-height=384
ll-lib-file=/opt/nvidia/deepstream/deepstream-5.0/lib/libnvds_mot_klt.so

config-infer-primary-yolov4.txt

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-color-format=0
model-engine-file=yolov4_1_3_608_608_dynamic_fp16.engine
labelfile-path=labels.txt
network-mode=2
num-detected-classes=80
gie-unique-id=1
network-type=0
is-classifier=0
cluster-mode=2
maintain-aspect-ratio=1
parse-bbox-func-name=NvDsInferParseCustomYoloV4
custom-lib-path=nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so
engine-create-func-name=NvDsInferYoloCudaEngineGet

[class-attrs-all]
nms-iou-threshold=0.3
pre-cluster-threshold=0.7

HI,
Did you run within docker or without docker on 2080 Ti?

Outside docker

I can run success for encoding to file on T4.
Can you check if you can met this issue after disable nvinfer?

Did you mean nvtracker or nvinfer?

I don’t know how to disable the nvinfer. Please let me know how to disable nvinfer? Thanks.

[primary-gie]
enable=1

change to

[primary-gie]
enable=0

Yes the error is still present after disabling nvinfer.

Can you find
ll /usr/lib/x86_64-linux-gnu/libnvidia-encode.so*
lrwxrwxrwx 1 root root 21 6月 11 13:05 /usr/lib/x86_64-linux-gnu/libnvidia-encode.so -> libnvidia-encode.so.1*
lrwxrwxrwx 1 root root 29 6月 11 13:05 /usr/lib/x86_64-linux-gnu/libnvidia-encode.so.1 -> libnvidia-encode.so.450.36.06*
-rwxr-xr-x 1 root root 104384 6月 11 13:05 /usr/lib/x86_64-linux-gnu/libnvidia-encode.so.450.36.06*
your driver version different, then the file name will have some difference.

I see following

lrwxrwxrwx 1 root root 26 Aug 14 07:19 libnvidia-encode.so.1 -> libnvidia-encode.so.450.57
-rwxr-xr-x 1 root root 104544 Aug 13 08:21 libnvidia-encode.so.450.57

I have double checked there is no “libnvidia-encode.so” (means softlink is missing). Do you want me to create softlink?

Please create one softlink and try again.

Many thanks. Significant progress. After creating the softlink, application works for type 1 and 3.

#Type - 1=FakeSink 2=EglSink 3=File
type=2

However when I set type=2 then see following errors:

KLT Tracker Init
cuGraphicsGLRegisterBuffer failed with error(304) gst_eglglessink_cuda_init texture = 1

**PERF: FPS 0 (Avg)
**PERF: 181.88 (181.79)
ERROR from tiled_display_queue: Internal data stream error.
Debug info: gstqueue.c(988): gst_queue_handle_sink_event (): /GstPipeline:pipeline/GstBin:tiled_display_bin/GstQueue:tiled_display_queue:
streaming stopped, reason not-negotiated (-4)
Quitting
ERROR from sink_bin_queue: Internal data stream error.
Debug info: gstqueue.c(988): gst_queue_handle_sink_event (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstQueue:sink_bin_queue:
streaming stopped, reason not-negotiated (-4)
App run failed

Did you install cuda driver or display driver? for display, you need to install nvidia display driver.
another option you can use type 4 RTSPStreaming, then you can view the output via vlc.

I have installed the driver using file NVIDIA-Linux-x86_64-450.57.run (from link https://www.nvidia.co.uk/Download/index.aspx?lang=en-uk).

Where do I get display driver? Is it straight forward to install nvidia display driver (means does not corrupt other installations e.g. cuda etc.)?

I am not sure this version, i used deb version. did it promote something like “install nvidia opengl” or similar like “setup nvidia x server”?

it didn’t say install nvidia opengl

however during installation it did say about writing xorg.conf or similar which I said yes. perhaps it is better to follow the rtspstreaming path. thanks for your time.

I run within docker on 1080TI, with deepstream4.0,

0:00:15.554805222 30613 0x7fb014002320 ERROR               NVDS_APP deepstream_app.cpp:191:bus_callback: ERROR from sinkbin_encoder0: Device '/dev/nvhost-msenc' failed during initialization
0:00:15.554857531 30613 0x7fb014002320 ERROR               NVDS_APP deepstream_app.cpp:194:bus_callback: Debug info: gstv4l2object.c(4050): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline/GstBin:encoder_0/nvv4l2h264enc:sinkbin_encoder0:
Call to S_FMT failed for YM12 @ 1920x1080: Unknown error -1
0:00:15.554935866 30613 0x7fb014002320 ERROR               NVDS_APP deepstream_app.cpp:191:bus_callback: ERROR from sinkbin_encoder0: Device '/dev/nvhost-msenc' failed during initialization
0:00:15.554953536 30613 0x7fb014002320 ERROR               NVDS_APP deepstream_app.cpp:194:bus_callback: Debug info: gstv4l2object.c(4050): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline/GstBin:encoder_0/nvv4l2h264enc:sinkbin_encoder0:
Call to S_FMT failed for YM12 @ 1920x1080: Unknown error -1

Please move to latest version 5.0