I am working with Nvidia Deepstream in docker and I have a problem with visualizing output on some of my machines.
Hardware
- Machine1
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.113.01 Driver Version: 535.113.01 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA RTX A4000 Laptop GPU Off | 00000000:01:00.0 Off | N/A |
| N/A 53C P0 N/A / 90W | 7MiB / 8192MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
- Machine2
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.113.01 Driver Version: 535.113.01 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 3090 On | 00000000:01:00.0 On | N/A |
| 53% 44C P8 28W / 350W | 325MiB / 24576MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
Both use Ubuntu and have configured nvidia container toolkit.
Reproduction
Run deepstream container (and let it opening windows)
xhost +local:
docker container run --rm --net host --runtime=nvidia --gpus=1 -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -it nvcr.io/nvidia/deepstream:6.2-devel bash
Copy deepstream examples and compile deps
apt update
apt install -y apt-transport-https ca-certificates \
python3-gi python3-dev python3-gst-1.0 python-gi-dev git python-dev \
python3 python3-pip python3.8-dev cmake g++ build-essential libglib2.0-dev \
libglib2.0-dev-bin libgstreamer1.0-dev libtool m4 autoconf automake libgirepository1.0-dev libcairo2-dev
update-ca-certificates
cd /opt/nvidia/deepstream/deepstream/sources && \
git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps --branch v1.1.6 --depth 1 && \
cd deepstream_python_apps && \
git submodule update --init && \
cd 3rdparty/gst-python/ && \
./autogen.sh && \
make -j$(nproc) && \
make install && \
cd /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/bindings && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
pip3 install ./pyds-*.whl
Run example app
cd /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-test3
./deepstream_test_3.py -i file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
Results
On Machine 2 everything works, I get window with red rectangles and see detections in terminal.
On Machine 1 pipeline breaks (window quickly appears and disappears) :
root@WBEC832l:/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-test3# ./deepstream_test_3.py -i file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
{'input': ['file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4'], 'configfile': None, 'pgie': None, 'no_display': False, 'file_loop': False, 'disable_probe': False, 'silent': False}
(gst-plugin-scanner:8942): GStreamer-WARNING **: 09:13:43.275: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmpg123.so': libmpg123.so.0: cannot open shared object file: No such file or directory
(gst-plugin-scanner:8942): GStreamer-WARNING **: 09:13:43.285: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenmpt.so': libmpg123.so.0: cannot open shared object file: No such file or directory
(gst-plugin-scanner:8942): GStreamer-WARNING **: 09:13:43.308: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmpeg2dec.so': libmpeg2.so.0: cannot open shared object file: No such file or directory
(gst-plugin-scanner:8942): GStreamer-WARNING **: 09:13:43.316: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstchromaprint.so': libavcodec.so.58: cannot open shared object file: No such file or directory
(gst-plugin-scanner:8942): GStreamer-WARNING **: 09:13:43.331: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmpeg2enc.so': libmpeg2encpp-2.1.so.0: cannot open shared object file: No such file or directory
(gst-plugin-scanner:8942): GStreamer-WARNING **: 09:13:44.725: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so': librivermax.so.0: cannot open shared object file: No such file or directory
(gst-plugin-scanner:8942): GStreamer-WARNING **: 09:13:44.726: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libtritonserver.so: cannot open shared object file: No such file or directory
Creating Pipeline
Creating streamux
Creating source_bin 0
Creating source bin
source-bin-00
Creating Pgie
Creating tiler
Creating nvvidconv
Creating nvosd
Creating EGLSink
Adding elements to Pipeline
Linking elements in the Pipeline
Now playing...
0 : file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
Starting pipeline
libEGL warning: MESA-LOADER: failed to retrieve device information
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1487 Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/sources/deepstream_python_apps/apps/deepstream-test3/../../../../samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine open error
0:00:03.100905144 8941 0x32fc360 WARN nvinfer gstnvinfer.cpp:677:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1897> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.2/sources/deepstream_python_apps/apps/deepstream-test3/../../../../samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine failed
0:00:03.159279151 8941 0x32fc360 WARN nvinfer gstnvinfer.cpp:677:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2002> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.2/sources/deepstream_python_apps/apps/deepstream-test3/../../../../samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine failed, try rebuild
0:00:03.159458063 8941 0x32fc360 INFO nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1923> [UID = 1]: Trying to create engine from model files
WARNING: [TRT]: The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag whenever possible.
0:00:21.578526957 8941 0x32fc360 INFO nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1955> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine successfully
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0 INPUT kFLOAT input_1 3x368x640
1 OUTPUT kFLOAT conv2d_bbox 16x23x40
2 OUTPUT kFLOAT conv2d_cov/Sigmoid 4x23x40
0:00:21.644598881 8941 0x32fc360 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-inference> [UID 1]: Load new model:dstest3_pgie_config.txt sucessfully
Decodebin child added: source
Decodebin child added: decodebin0
**PERF: {'stream0': 0.0}
Decodebin child added: qtdemux0
Decodebin child added: multiqueue0
Decodebin child added: h264parse0
Decodebin child added: capsfilter0
Warning: gst-stream-error-quark: No decoder available for type 'audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)119056e500, rate=(int)48000, channels=(int)2'. (6): gsturidecodebin.c(920): unknown_type_cb (): /GstPipeline:pipeline0/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin
Decodebin child added: nvv4l2decoder0
In cb_newpad
gstname= video/x-raw
features= <Gst.CapsFeatures object at 0x7fb785695640 (GstCapsFeatures at 0x2433b80)>
Frame Number= 0 Number of Objects= 14 Vehicle_count= 8 Person_count= 6
Frame Number= 3 Number of Objects= 11 Vehicle_count= 6 Person_count= 5
cuGraphicsGLRegisterBuffer failed with error(219) gst_eglglessink_cuda_init texture = 1
Frame Number= 4 Number of Objects= 14 Vehicle_count= 7 Person_count= 7
Frame Number= 7 Number of Objects= 11 Vehicle_count= 7 Person_count= 4
Frame Number= 12 Number of Objects= 9 Vehicle_count= 6 Person_count= 3
0:00:21.834477776 8941 0x3286800 WARN nvinfer gstnvinfer.cpp:2369:gst_nvinfer_output_loop:<primary-inference> error: Internal data stream error.
0:00:21.834486445 8941 0x3286800 WARN nvinfer gstnvinfer.cpp:2369:gst_nvinfer_output_loop:<primary-inference> error: streaming stopped, reason not-negotiated (-4)
Error: gst-stream-error-quark: Internal data stream error. (1): gstnvinfer.cpp(2369): gst_nvinfer_output_loop (): /GstPipeline:pipeline0/GstNvInfer:primary-inference:
streaming stopped, reason not-negotiated (-4)
Exiting app
Frame Number= 13 Number of Objects= 10 Vehicle_count= 7 Person_count= 3
But when I launch this example with flag --no-display
everything works.
How to make display work on Machine 1?