I have a Xavier NX dev board with jetpack 4.6.1 (deepstream 6.0.1) I’ve pulled the nvcr.io/nvidia/deepstream-l4t:6.0.1-samples
and built a dev environment on top of it (installed gcc, cmake, cuda enabled opencv, ros2 and a few other libraries). I don’t have a keyboard / monitor connected to the jetson. Typically there are two ways I connect to the container–with vscode (via ssh) to build code or over VNC (to run programs or otherwise interact with the desktop). In the dev container I’ve also added a non-root user with sudo privileges. I start the container via
docker run -it -d --restart unless-stopped \
--name=dev_container \
--group-add video \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-v ${HOME}/dev:/workspaces/vscode \
-v ~/.ssh/id_rsa:/home/vscode/.ssh/id_rsa:ro \
-v ~/.gitconfig:/etc/gitconfig:ro \
--env="DISPLAY" \
-p 8022:22 -p 9001:9001 \
my_dev_image:latest /bin/bash
(it’s configured to start in /workspaces/vscode with the non-root user using nvidia as the default runtime). The non-root user is also configured to have the same uid / gid as me or whoever is using the container (so all the permissions work out how they should). I can run the program xeyes
fine to show that X11 forwarding from the container and gui apps at least appear to be working, however when I run the deepstream sample app (from a terminal on the vnc desktop):
vscode@dd9f3c74e486:/workspaces/vscode ()
$ rm -rf ~/.cache/gstreamer-1.0/
vscode@dd9f3c74e486:/workspaces/vscode ()
$ deepstream-app -c /opt/nvidia/deepstream/deepstream-6.0/samples/configs/deepstream-app/source30_1080p_dec_infer-resnet_tiled_display_int8.txt
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)
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
(gst-plugin-scanner:1790): GStreamer-WARNING **: 08:15:21.222: 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
nvbufsurftransform: Could not get EGL display connection
(gst-plugin-scanner:1791): GStreamer-WARNING **: 08:15:21.267: 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
nvbufsurftransform: Could not get EGL display connection
(gst-plugin-scanner:1792): GStreamer-WARNING **: 08:15:21.323: 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
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
nvbufsurftransform: Could not get EGL display connection
** ERROR: <create_multi_source_bin:1424>: Failed to create element 'src_bin_muxer'
** ERROR: <create_multi_source_bin:1517>: create_multi_source_bin failed
** ERROR: <create_pipeline:1326>: create_pipeline failed
** ERROR: <main:688>: Failed to create pipeline
Quitting
App run failed
If I run the same command outside of the dev container, the app runs as expected. I’ve been through
and
as well as a few others which seem very similar. If I run the base container directly in host mode, i.e.
vscode@nx02:~ ()
$ xhost +
access control disabled, clients can connect from any host
vscode@nx02:~ ()
$ docker run -it --rm --net=host --runtime=nvidia -w /opt/nvidia/deepstream/deepstream-6.0 -v /tmp/.X11-unix:/tmp/.X11-unix:ro --env="DISPLAY" nvcr.io/nvidia/deepstream-l4t:6.0.1-samples /bin/bash
root@nx02:/opt/nvidia/deepstream/deepstream-6.0# echo $DISPLAY
:0
root@nx02:/opt/nvidia/deepstream/deepstream-6.0# deepstream-app -c /opt/nvidia/deepstream/deepstream-6.0/samples/configs/deepstream-app/source30_1080p_dec_infer-resnet_tiled_display_int8.txt
It also works. Narrowing things down, I have also gotten it to work with my development container if two conditions are met–I’m in host networking mode and I’m the root user, both of which are not ideal (host networking makes it so I can’t ssh into the container, so I can’t get to the container from vscode, running as root is generally not good practice and also messes with the permissions of the mounted dev directory).
Is there a way to run the apps (and still see the annotated output) while not in host mode or running as root?