Using CSI Camera with Docker on Jetsons

Hi all,

I’m currently working on running DL algorithms inside docker containers and I’ve been successful. However, I can only get it running by passing --net=host flag to docker run command which makes container use host computer’s network interface. If I don’t pass that flag it throws the following error:

No EGL Display 
nvbufsurftransform: Could not get EGL display connection
No protocol specified
nvbuf_utils: Could not get EGL display connection

When I do

echo $DISPLAY

it outputs :0 which is correct.

But I don’t understand what Gstreamer, X11 or EGL has to do with full network feature. Is there any explanation for this or any workaround except --net=host flag? Because of this reason I can’t map different ports for various containers.

Hi,

Do you run the docker with similar config like this?

$ sudo docker run --runtime nvidia --network host -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r32.2

Here is a tutorial for docker on Jetson for your reference:
https://github.com/NVIDIA/nvidia-docker/wiki/NVIDIA-Container-Runtime-on-Jetson

Thanks.

Hi,

Yes, I am using the same command. My question is can I use CSI cameras within the container without specifying --network host flag?

Hi,

Suppose yes.

A possible reason is that local display should be :1 in Ubuntu18.04.
https://unix.stackexchange.com/questions/491344/ubuntu-18-04-1-lts-default-display-value

Not sure if the DISPLAY=:0, which is not the local display, request for the network connection.
Could you try to update the DISPLAY port to :1 see if helps?

Thanks.

Hi,

Sorry for the late reply. I just had the chance to try it out. However, when I do

export DISPLAY=:1

and then run the container without specifying the –network host, it still throws:

nvbuf_utils: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
nvbuf_utils: Could not get EGL display connection
No EGL Display 
nvbufsurftransform: Could not get EGL display connection
nvbuf_utils: Could not get EGL display connection
nvbuf_utils: Could not get EGL display connection
Setting pipeline to PAUSED ...

Using winsys: x11 
ERROR: Pipeline doesn't want to pause.
Setting pipeline to NULL ...
Freeing pipeline ...

Hi,

Do you execute any application to cause this error?

nvbuf_utils: Could not get EGL display connection
No EGL Display

We can enable the container without setting network successfully:

sudo docker run --runtime nvidia -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r32.2

Thanks.

Hi,

Yes, I am trying to start a python script for let’s say object detection. There is no problem with enabling the container without setting network, the main question is why can’t I get the CSI camera output from inside of the container if I do not set the network setting?

Thanks.

Hi,

Sorry for the delay.

The path can work correctly with fakesink like this:

sudo docker run -it --rm --runtime nvidia -v /tmp/.X11-unix/:/tmp/.X11-unix [container]

Thanks.