Using `nvarguscamerasrc` within a docker container

Hello,

I’m using Jetson Orin NX, with Jetpack 5.1.2.
I’m trying to run a Gstreamer pipeline that fetches camera frames using nvarguscamerasrc with this simple pipeline:
gst-launch-1.0 nvarguscamerasrc ! fakesink

When running this pipeline from the host, everything works just fine.
When I try to run a docker container which is based on nvidia/cuda:11.8.0-runtime-ubuntu22.04 I’m getting the following errors:

(Argus) Error NotSupported: Failed to initialize EGLDisplay (in src/eglutils/EGLUtils.cpp, function getDefaultDisplay(), line 77)`
(Argus) Error BadParameter: (propagating from src/eglstream/FrameConsumerImpl.cpp, function initialize(), line 89)`
(Argus) Error BadParameter: (propagating from src/eglstream/FrameConsumerImpl.cpp, function create(), line 44)`
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadInitialize:320 Failed to create FrameConsumer`
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:241 (propagating)`
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, waitRunning:203 Invalid thread state 3`
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:806 (propagating)`

@guyda

Thank you.
Omer

hello omer,

there’s an error reported regrading to Failed to initialize EGLDisplay.
although you’re running with fakesink, please also check you’ve setup display environment correctly.

Thank you for your reply.
What if I don’t have any displays connected?
And what does it actually mean to setup the display environment correctly? I mean I know there’s the DISPLAY variable but what else?

Thank you.
Omer.

Hi,
Please refer to the posts and give it a try:
Nvbuf_utils fails to establish EGL display connection in Docker - #6 by DaneLLL
Nvbuf_utils fails to establish EGL display connection in Docker - #8 by DaneLLL
Nvbuf_utils fails to establish EGL display connection in Docker - #13 by DaneLLL

1 Like

Thank you very much.
It turns out that what caused the issue was that I mounted the /tmp/.X11-unix directory & /usr/sbin/nvargus-daemon into my container. Also I used --cap-add SYS_PTRACE and --ipc=host. Not sure why but when I removed it, the issue was solved.
What lead me there was that when I defined the DISPLAY environment, I still had issues, but when I removed it, it suddenly worked.

So I began reviewing exactly what is mounted in my container and finally got to the answer.

Thank you very much

1 Like

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