Deepstream app cannot be executed from docker image on Jetson

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU): Jetson Nano 4gb Dev Board
• DeepStream Version: nvcr.io/nvidia/deepstream-l4t:6.0.1-base
• JetPack Version (valid for Jetson only):

cat /etc/nv_tegra_release 
# R32 (release), REVISION: 7.1, GCID: 29818004, BOARD: t210ref, EABI: aarch64, DATE: Sat Feb 19 17:05:08 UTC 2022

• TensorRT Version: NA
• Issue Type( questions, new requirements, bugs): questions/bug
• 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)
I build the deepstream_lpr_app based on the steps from:

for build I was using the ‘nvcr.io/nvidia/deepstream-l4t:6.0.1-samples’. As I was using the deepstream docker image I could skip the corresponding step in the ’ Prerequisition’ chapter, to be able to build the app I only needed to install the following packages:

  • libgstreamer1.0-dev
  • libgstreamer-plugins-base1.0-dev

dokcer command:

docker run --rm -ti\
    --net=host -e DISPLAY=$DISPLAY -w '/sources/tmp/deepstream_lpr_app-master/deepstream-lpr-app' -v /tmp/.X11-unix/:/tmp/.X11-unix\
    -v /home/pettair/sources:/sources\
    nvcr.io/nvidia/deepstream-l4t:6.0.1-base\
    bash

After this I tried to execute the build binary from ‘deepstream-l4t:6.0.1-base’:

docker run --rm -ti\
    --net=host -e DISPLAY=$DISPLAY -w '/sources/tmp/deepstream_lpr_app-master/deepstream-lpr-app' -v /tmp/.X11-unix/:/tmp/.X11-unix\
    -v /home/pettair/sources:/sources\
    nvcr.io/nvidia/deepstream-l4t:6.0.1-base\
    bash

but I get the following error:

./deepstream-lpr-app 1 1 0 /sources/input.mp4 /sources/output.mp4
nvbuf_utils: Could not get EGL display connection
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 205)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 106)
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
nvbuf_utils: Could not get EGL display connection
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 205)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 106)
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection

(gst-plugin-scanner:48): GStreamer-WARNING **: 19:07:25.218: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so': librivermax.so.0: cannot open shared object file: No such file or directory
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection

(gst-plugin-scanner:54): GStreamer-WARNING **: 19:07:25.665: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libtritonserver.so: cannot open shared object file: No such file or directory
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
One element could not be created. Exiting.

The output is the same if I try to execute it from the container that I used for the build.

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

I expected that I would be able to run the application in a base container. Im very new to the topic so it is possible that im doing something wrong, my perception was that i would have a “fat” docker image with all the dependencies what I can use for building and a “slim” which is only used in execution. Can you help me what im missing here?

Thanks!

Peter

1 per the error log “One element could not be created. Exiting”, please check if you got nvinfer installed
$ gst-inspect-1.0 nvinfer, please refer to this links:

2 did you install jetpack correctly? docker container need jetpack’s support. please refer to this link: Quickstart Guide — DeepStream 6.0.1 Release documentation

Hi

I installed the the Jetpack on the Nano host using flashing SD card image also on the host I installed the Deepstream SDK follwing the steps Install Jetson SDK components

If I execute this “gst-inspect-1.0 nvinfer” on the host the inspect displaying the plugin info, moreover on the Jetson Nano host the application can be started and working properly

But if I execute it in ‘nvcr.io/nvidia/deepstream-l4t:6.0.1-base’ docker container i get this:

gst-inspect-1.0 nvinfer
No such element or plugin 'nvinfer'

The issues happens when executing the deepstream-lpr-app from a docker container.

My plan is to build and run the application using docker containers and I expected in that way I could decouple the configuration of the host from the docker container.

please do " xhost +" before starting docker, you can refer to Run the container
it will be ok if “gst-inspect-1.0 nvinfer” can output plugin 's infomation.

Hi,

I missed this ‘xhost +’ before, but this not helps either. Maybe its connected with that Im running the Jetson in headless mode?

I get the following outputs:

$ xhost +
xhost:  unable to open display ""

I started the container with this:

sudo docker run -it --rm\
    --net=host --runtime nvidia  -e DISPLAY=$DISPLAY\
    -w /sources/tmp/deepstream_lpr_app-master/deepstream-lpr-app\
    -v /tmp/.X11-unix/:/tmp/.X11-unix\
     -v /home/pettair/sources:/sources\
    nvcr.io/nvidia/deepstream-l4t:6.0.1-base\
    bash

and the output:

# gst-inspect-1.0 nvstreammux

nvbuf_utils: Could not get EGL display connection
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 205)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 106)
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
nvbuf_utils: Could not get EGL display connection
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 205)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 106)
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection

(gst-plugin-scanner:19): GStreamer-WARNING **: 11:54:06.447: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so': librivermax.so.0: cannot open shared object file: No such file or directory
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection

(gst-plugin-scanner:25): GStreamer-WARNING **: 11:54:06.956: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libtritonserver.so: cannot open shared object file: No such file or directory
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No such element or plugin 'nvstreammux'

“xhost +” failed, please do as follows:
1 execute “xdpyinfo | grep name”, will get a number, for example: name of display: :1
2 execute "export DISPLAY=:1 ",
3 execute "xhost + ", correct output is “access control disabled, clients can connect from any host”.

Hi,

when I execute the it gives me an error:

$ xhost +
xhost:  unable to open display "localmachine:0.0"

Sorry copied the wrong output… so the proper one:

xdpyinfo | grep name
xdpyinfo:  unable to open display "".

1 to narrow down this issue, please don’t use headless mode, which have some display limitation, then try the command above.
2 please use native terminal to execute “xdpyinfo | grep name”.

Hi,

I reinstalled my nano with GUI, this way it works from the native terminal (starting the docker container from a terminal on the Jetson GUI)

If I try trough an SSH connection (disconnected the HDMI display and restarted the nano) the “xdpyinfo | grep name” command still fails, but if I set the “export DISPLAY=:0” (I got the the 0 display id from the session where I used the native terminal) both the “xhost +” command and the deepstream application execution succeeds from the container. So it seems like it can be executed without a physical screen attached.

What would be the solution to make it work in headless mode?

1 please setup xserver in headless mode.
1 after SH connection , execute "export DISPLAY=:0 " and “xhost +” ,
if there is no “access control disabled, clients can connect from any host”, try num 1, execute “export DISPLAY=:1” and “xhost +”, “name of display” always be 0 or 1.
2 start docker, and try your app.

Hi,

I reinstalled my nano in headless mode, did the prerequisites and the installation of the deepstream package.

Checked the xserver package installation, but those were already installed:

$ sudo apt install xorg xserver-xorg  xserver-xorg-core
Reading package lists... Done
Building dependency tree       
Reading state information... Done
xorg is already the newest version (1:7.7+19ubuntu7.1).
xserver-xorg is already the newest version (1:7.7+19ubuntu7.1).
xserver-xorg-core is already the newest version (2:1.19.6-1ubuntu4.10).
0 upgraded, 0 newly installed, 0 to remove and 121 not upgraded.

But still no luck:

$ export DISPLAY=:0
$ xhost +
No protocol specified
xhost:  unable to open display ":0"
$ export DISPLAY=:1
$ xhost +
xhost:  unable to open display ":1"

and executing the app from the container is still failing.

What is the exact process what you referred as: “please setup xserver in headless mode”? Maybe thats what I missed

1 please check if xserver is started , for example, execute “ps -ef|grep X”, check if there is Xorg.
2 if no Xorg, please start X, for example, startx. then try again.

I saw this:

$ ps -ef|grep X
root      5933  5929  0 07:00 tty1     00:00:07 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/120/gdm/Xauthority -background none -noreset -keeptty -verbose 3
pettair   23603  7317  0 16:49 pts/0    00:00:00 grep --color=auto X

I guessed it was already running, but the application still failed in the container. So I tried to execute “startx” from a second SSH session, after this the “export DISPLAY=:1” and “xhost +” executed without any error and the application was executed successfully from the container.

I think this is a great success story :D Thanks for the lot of help! You are awesome!

However with this command it started a the GUI and a full fetched Ubuntu screen appeared, which I would like to get rid off. I mean we would like to use the Nanos as edge devices, where we do not need any GUI and it would take precious resources from other computation. This is why we used Nanos in headless mode in the first place.

Is there any chance that I could get the best of both world? To not have any GUI to save resources while running containerized deepstream apps? Or is it an absolute necessity for the deepstream to have a display? Maybe what I would like to achieve is not available and would be a new feature?

No better method, please refer to DeepStream | NVIDIA NGC, need to execute “xhost +” before start docker.

I use docker without a UI and Jetson nano running in a headless mode. My docker run commands look like this.

docker run -it \
    --rm \
    --runtime nvidia \
    --privileged \
    --tty \
        -v /dev:/dev \
        -v /etc/localtime:/etc/localtime \
        -v $PWD:/usr/src/app/ \
        -w /usr/src/app/ \
        --net=host \
        <docker image name>\
        /bin/bash -c "python3 main.py"

I clean the jetson using a similar script to this.

I have four remote units running in headless using docker container.

1 Like

Thanks curious_cat!

I tried to modify your docker command with my variables and it worked right away! I started to locate which param solves or which one causes the issue. Finally I was able to find that the “DISPLAY” env variable caused my issues.

So this works:

sudo docker run -it --rm\
    --runtime nvidia \
    -w /sources/deepstream_lpr_app//deepstream-lpr-app\
    -v /home/pettair/sources:/sources\
    nvcr.io/nvidia/deepstream-l4t:6.0.1-base\
    bash -c '/sources/deepstream_lpr_app/deepstream-lpr-app/deepstream-lpr-app 1 1 0 /sources/honda_civic_2018_purple.mp4 /sources/output_docker.h264'

and this is not:

sudo docker run -it --rm\
    --runtime nvidia \
    -e DISPLAY=$DISPLAY\
    -w /sources/deepstream_lpr_app//deepstream-lpr-app\
    -v /home/pettair/sources:/sources\
    nvcr.io/nvidia/deepstream-l4t:6.0.1-base\
    bash -c '/sources/deepstream_lpr_app/deepstream-lpr-app/deepstream-lpr-app 1 1 0 /sources/honda_civic_2018_purple.mp4 /sources/output_docker.h264'

Thank you all for helping debunk this issue! Amazing community!

1 Like