DeepStream inference not working on Jetson AGX Orin

Hi Balena team!

We’re crossing a problem when trying to perform neural network models inference on DeepStream with the Jetson AGX Orin Devkit.

The simple DeepStream pipelines to play or store the video stream are running fine, but as soon we add an inference node (NVIDIA DeepStream’s nvinfer gstreamer plugin) the execution fails with the following error:

23.02.23 16:25:10 (+0000) 2023-02-23T16:25:10.126541Z WARN subprocess::subprocess: Pipeline stopped during startup: PipelineStopped(GstError(GstError { domain: Resource, code: 1, description: “Failed to set buffer pool to active” }))

Additionaly we can find those errors when nvinfer is present in the pipeline:

23.02.23 16:25:10 (+0000) nvbufsurftransform: Could not get EGL display connection
23.02.23 16:25:10 (+0000) nvbuf_utils: Could not get EGL display connection
23.02.23 16:25:10 (+0000) nvbuf_utils: Could not get EGL display connection
23.02.23 16:25:10 (+0000) nvbufsurface: Could not get EGL display connection
23.02.23 16:25:10 (+0000) nvbufsurface: Can’t get EGL display

Based on this NVIDIA doc we confirmed that DISPLAY is not set as environment variable on BalenaOS, neither in our container.
We want to use the Balena gateways as “headless” systems. The same approach was used to create our Balena Jetson Xavier NX image were we don’t even install X11, and the inference works great.

Did some attempts with and without monitor attached to the Orin AGX, and also tried to install the X11 in the image but that doesn’t solves the problem.

We used your sample Dockerfile for Jetson AGX Orin Devkit, and additionally installed the following packages that are dependencies of our product:

RUN install_packages
build-essential
cmake
curl
iproute2
gstreamer1.0-libav
gstreamer1.0-plugins-bad
gstreamer1.0-plugins-good
gstreamer1.0-tools
libgstreamer-plugins-base1.0-dev
libgstreamer1.0-0
libgstreamer1.0-dev
libgstrtspserver-1.0-0
libjansson4
libpython3.8
libpython3.8-dev
libssl1.1
python3-dev
python3-gst-1.0
python3-numpy
python3-pip
python3-requests
python3-setuptools
python3-wheel

RUN install_packages deepstream-6.1