How to set up Deepstream 6.3 in a docker container

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Nvidia Geforce RTX 2050
• DeepStream Version 6.3
• NVIDIA GPU Driver Version (valid for GPU only) 535.146.02

The following is my Dockerfile:
**•

FROM nvcr.io/nvidia/deepstream:6.3-triton-multiarch

RUN apt-get update &&
apt-get install -y python3.8 python3.8-distutils &&
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 &&
update-alternatives --set python3 /usr/bin/python3.8 &&
apt-get install -y python3.8-venv python3.8-dev &&
apt-get install -y python3-pip libgstreamer1.0-dev

RUN apt-get update &&
apt-get install -y
python3.8
python3.8-distutils
libssl1.1
libssl-dev
libgstreamer1.0-0
gstreamer1.0-tools
gstreamer1.0-plugins-good
gstreamer1.0-plugins-bad
gstreamer1.0-plugins-ugly
gstreamer1.0-libav
libgstreamer-plugins-base1.0-dev
libgstrtspserver-1.0-0
libjansson4
libyaml-cpp-dev

RUN pip3 install opencv-python
RUN pip3 install torch
RUN pip3 install Pillow
RUN pip3 install torchvision

COPY . /app

WORKDIR /app

RUN pip3 install pyds

ENTRYPOINT [“python3”, “emotion.py”, “file:////home/isham/projects/deepstream_imentiv/stock1-short-wxsabew8_ttDDk6ra.mp4”, “frames_1”]

**

And when i run this, iam getting an error :

**•
Frames will be saved in frames_1

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.069: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstde265.so’: libde265.so.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.082: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstx265.so’: libx265.so.179: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.189: 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:23): GStreamer-WARNING **: 07:14:03.193: 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:23): GStreamer-WARNING **: 07:14:03.193: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvpx.so’: libvpx.so.6: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.245: 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:23): GStreamer-WARNING **: 07:14:03.258: 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:23): GStreamer-WARNING **: 07:14:03.284: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so’: libavcodec.so.58: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.297: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_ucx.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.300: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libcustom2d_preprocess.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.308: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.318: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_deepstream_bins.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.323: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_ofvisual.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.326: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libgstnvvideo4linux2.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.327: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_multistreamtiler.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.329: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libgstnvvideoconvert.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.330: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_tracker.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.331: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_segvisual.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.653: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_dsexample.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.655: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_xfer.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.656: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_infer.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.657: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_dewarper.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.658: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_multistream.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.659: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_videotestsrc.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.660: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_jpeg.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.660: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.661: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_preprocess.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.663: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_nvblender.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.673: Failed to load plugin ‘/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_eglglessink.so’: libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:23): GStreamer-WARNING **: 07:14:03.715: 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
Creating Pipeline

Creating streamux

Unable to create NvStreamMux
Traceback (most recent call last):
File “emotion.py”, line 578, in
sys.exit(main(sys.argv))
File “emotion.py”, line 434, in main
pipeline.add(streammux)
TypeError: Argument 1 does not allow None as a value

**

Iam able to run the same in deespstream without docker and getting required output,but when i tried this in Docker method it doesn’t work.

1.install nvidia-container-toolkit in host via the following link

https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-apt

2.Modify the dockerfile as follows

RUN apt-get install --reinstall -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libavresample-dev libavresample4 libavutil-dev libavutil56 libavcodec-dev libavcodec58 libavformat-dev libavformat58 libavfilter7 libde265-dev libde265-0 libx264-155 libx265-179 libvpx6 libmpeg2encpp-2.1-0 libmpeg2-4 libmpg123-0
RUN apt-get install -y python3-gi python3-dev python3-gst-1.0 python-gi-dev libglib2.0-dev libglib2.0-dev-bin libgirepository1.0-dev libcairo2-dev

RUN wget https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/releases/download/v1.1.8/pyds-1.1.8-py3-none-linux_x86_64.whl && \
    pip3 install ./pyds-1.1.8-py3-none-linux_x86_64.whl

  1. run docker with --gpus all, Here is a general way.
docker run --gpus all -it --rm --net=host --privileged -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY "your image"

sorry, i didnt get you. what will be my image in the last command:

docker run --gpus all -it --rm --net=host --privileged -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY "your image"

Did you specify the tag when building the image?

You can use the docker images command to view.

If not, you can replace image name with IMAGE ID

i think this method worked partially.
when i run

(base) isham@aspire5:~/projects/imentiv_deepstream$ sudo docker run --gpus all -it --rm --net=host --privileged -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY deepstream

===============================
DeepStreamSDK 6.3.0

*** LICENSE AGREEMENT ***
By using this software you agree to fully comply with the terms and conditions
of the License Agreement. The License Agreement is located at
/opt/nvidia/deepstream/deepstream/LicenseAgreement.pdf. If you do not agree
to the terms and conditions of the License Agreement do not use the software.

=============================
== Triton Inference Server ==

NVIDIA Release 23.03 (build 56086596)
Triton Server Version 2.32.0

Copyright (c) 2018-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

Various files include modifications (c) NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:

root@aspire5:/app# nvidia-smi
Fri Dec 29 12:29:00 2023
±--------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.146.02 Driver Version: 535.146.02 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 2050 Off | 00000000:01:00.0 Off | N/A |
| N/A 50C P0 N/A / 30W | 7MiB / 4096MiB | 0% Default |
| | | N/A |
±----------------------------------------±---------------------±---------------------+

±--------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
±--------------------------------------------------------------------------------------+

root@aspire5:/app# python3 emotion.py file:////app/stock1-short-wxsabew8_ttDDk6ra.mp4 stock
Frames will be saved in stock

(gst-plugin-scanner:124): GStreamer-WARNING **: 12:30:30.785: 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
Creating Pipeline

Creating streamux

Creating source_bin 0

Creating source bin
source-bin-00
Creating Pgie

Creating nvvidconv1

Creating filter1

Creating tiler

Creating nvvidconv

Creating nvosd

Creating EGLSink

Adding elements to Pipeline

Linking elements in the Pipeline

Now playing…
1 : file:////app/stock1-short-wxsabew8_ttDDk6ra.mp4
Starting pipeline

Authorization required, but no authorization protocol specified
Authorization required, but no authorization protocol specified
Authorization required, but no authorization protocol specified
Authorization required, but no authorization protocol specified

**PERF: {‘stream0’: 0.0}

**PERF: {‘stream0’: 0.0}

**PERF: {‘stream0’: 0.0}

**PERF: {‘stream0’: 0.0}

**PERF: {‘stream0’: 0.0}

**PERF: {‘stream0’: 0.0}

after this, it freeze.

There is no update from you for a period, assuming this is not an issue anymore.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Allow external applications to connect to the host’s X display:

xhost +

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.