Headless mode fails with EGL error

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
Jetson AGX Orin 64G

• DeepStream Version
7.0

• JetPack Version (valid for Jetson only)

R36 (release), REVISION: 3.0, GCID: 36923193, BOARD: generic, EABI: aarch64, DATE: Fri Jul 19 23:24:25 UTC 2024

• TensorRT Version
6.0+b106 / 8.6.2.3-1+cuda12.2

• NVIDIA GPU Driver Version (valid for GPU only)
N/A

• Issue Type( questions, new requirements, bugs)
Question

• 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)

Issue: when running GST_DEBUG=3 deepstream-app -c setup2.txt we’re getting EGL display error:

nvbufsurftransform: Could not get EGL display connection
...
nvbufsurface: Could not get EGL display connection
nvbufsurface: Can't get EGL display
0:00:06.118061411  1453 0xaaaac4f57470 ERROR       nvinferallocator gstnvinfer_allocator.cpp:107:gst_nvinfer_allocator_alloc: Error: Could not map EglImage from NvBufSurface for nvinfer
0:00:06.118086019  1453 0xaaaac4f57470 WARN              GST_BUFFER gstbuffer.c:958:gst_buffer_new_allocate: failed to allocate 88 bytes
0:00:06.118104035  1453 0xaaaac4f57470 WARN              bufferpool gstbufferpool.c:318:do_alloc_buffer:<bufferpool0> alloc function failed
0:00:06.118114147  1453 0xaaaac4f57470 WARN              bufferpool gstbufferpool.c:351:default_start:<bufferpool0> failed to allocate buffer
0:00:06.118121955  1453 0xaaaac4f57470 ERROR             bufferpool gstbufferpool.c:572:gst_buffer_pool_set_active:<bufferpool0> start failed
0:00:06.118133699  1453 0xaaaac4f57470 WARN                 nvinfer gstnvinfer.cpp:1008:gst_nvinfer_start:<primary_gie> error: Failed to set buffer pool to active
0:00:06.143608591  1453 0xaaaac4f57470 WARN                GST_PADS gstpad.c:1141:gst_pad_set_active:<primary_gie:sink> Failed to activate pad
** ERROR: <main:706>: Failed to set pipeline to PAUSED
Quitting
ERROR from primary_gie: Failed to set buffer pool to active
Debug info: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(1008): gst_nvinfer_start (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie
App run failed

But:

  1. This’s going to run in a docker w/o display.
  2. DISPLAY is unset - confirmed:
root@b06176e75a5a:/test# env | grep DISPLAY
root@b06176e75a5a:/test#
  1. the config file (setup2.txt) is minimal and does not even involve OSD/EGLSink:
[application]
enable-perf-measurement=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
uri=file://./test.mp4
num-sources=1
gpu-id=0
cudadec-memtype=0


[sink0]
enable=1
gpu-id=0
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
sync=0
#iframeinterval=10
bitrate=2000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
# set profile only for hw encoder, sw encoder selects profile based on sw-preset
profile=0
output-file=out.mp4
source-id=0

[streammux]
gpu-id=0
##Boolean property to inform muxer that sources are live
live-source=0
batch-size=1
##time out in usec, to wait after the first buffer is available
##to push the batch even if the complete batch is not formed
batched-push-timeout=40000
## Set muxer output width and height
width=1920
height=1080
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=0
nvbuf-memory-type=0
## If set to TRUE, system timestamp will be attached as ntp timestamp
## If set to FALSE, ntp timestamp from rtspsrc, if available, will be attached
# attach-sys-ts-as-ntp=1




# config-file property is mandatory for any gie section.
# Other properties are optional and if set will override the properties set in
# the infer config file.
[primary-gie]
enable=1
gpu-id=0
model-engine-file=model_b1_gpu0_fp32.engine
#Required to display the PGIE labels, should be added even when using config-file
#property
batch-size=1
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
interval=0
#Required by the app for SGIE, when used along with config-file property
gie-unique-id=1
nvbuf-memory-type=0
config-file=bin2.txt


[tests]
file-loop=0

Any help?

some more info. I’ve tried to use the sample config:
source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt

after modifying its sink to use FakeSink instead of EGL (ie. type=2 → type=1) I’ve tried to run it: /opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app# GST_DEBUG=3 deepstream-app -c source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt

which also fails w same error:

nvbufsurftransform: Could not get EGL display connection
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
0:00:05.577941647  1584 0xaaaacf049490 INFO                 nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<secondary_gie_1> NvDsInferContext[UID 5]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2095> [UID = 5]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-7.0/samples/configs/deepstream-app/../../models/Secondary_VehicleMake/resnet18_vehiclemakenet.etlt_b16_gpu0_int8.engine
INFO: [Implicit Engine Info]: layers num: 2
0   INPUT  kFLOAT input_1         3x224x224
1   OUTPUT kFLOAT predictions/Softmax 20x1x1

0:00:05.890315777  1584 0xaaaacf049490 INFO                 nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<secondary_gie_1> NvDsInferContext[UID 5]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2198> [UID = 5]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-7.0/samples/configs/deepstream-app/../../models/Secondary_VehicleMake/resnet18_vehiclemakenet.etlt_b16_gpu0_int8.engine
nvbufsurface: Could not get EGL display connection
nvbufsurface: Can't get EGL display
0:00:05.900967228  1584 0xaaaacf049490 ERROR       nvinferallocator gstnvinfer_allocator.cpp:107:gst_nvinfer_allocator_alloc: Error: Could not map EglImage from NvBufSurface for nvinfer
0:00:05.900991452  1584 0xaaaacf049490 WARN              GST_BUFFER gstbuffer.c:958:gst_buffer_new_allocate: failed to allocate 88 bytes
0:00:05.901009244  1584 0xaaaacf049490 WARN              bufferpool gstbufferpool.c:318:do_alloc_buffer:<bufferpool0> alloc function failed
0:00:05.901017116  1584 0xaaaacf049490 WARN              bufferpool gstbufferpool.c:351:default_start:<bufferpool0> failed to allocate buffer
0:00:05.901023164  1584 0xaaaacf049490 ERROR             bufferpool gstbufferpool.c:572:gst_buffer_pool_set_active:<bufferpool0> start failed
0:00:05.901033916  1584 0xaaaacf049490 WARN                 nvinfer gstnvinfer.cpp:1008:gst_nvinfer_start:<secondary_gie_1> error: Failed to set buffer pool to active
0:00:05.906676283  1584 0xaaaacf049490 WARN                GST_PADS gstpad.c:1141:gst_pad_set_active:<secondary_gie_1:sink> Failed to activate pad
** ERROR: <main:706>: Failed to set pipeline to PAUSED
Quitting
nvstreammux: Successfully handled EOS for source_id=0
nvstreammux: Successfully handled EOS for source_id=1
nvstreammux: Successfully handled EOS for source_id=2
nvstreammux: Successfully handled EOS for source_id=3
ERROR from secondary_gie_1: Failed to set buffer pool to active
Debug info: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(1008): gst_nvinfer_start (): /GstPipeline:pipeline/GstBin:secondary_gie_bin/GstNvInfer:secondary_gie_1
App run failed

Have you run the unset DISPLAY command?

yes - as mentioned above, since this’s the suggestion so common :)

    DISPLAY is unset - confirmed:

root@b06176e75a5a:/test# env | grep DISPLAY
root@b06176e75a5a:/test#

The default DISPLAY maybe not in the env. Could you run the cat /proc/*/environ 2>/dev/null | tr '\0' '\n' | grep '^DISPLAY=:' | uniq command to check?

You can also change the sink to fakesink and have a try.

Please read my post again:

after modifying its sink to use FakeSink instead of EGL (ie. type=2 → type=1)

No offense, but as this’s the second time, please please read my entire post carefully for what I had tried already.

And as mentioned, I didn’t just run the env - I literally ran unset DISPLAY, checked docker run in process, checked proc, checked X11 fwding - nope, negative, nil, nothing.

root@b06176e75a5a:/# cat /proc/*/environ | grep DISPLAY
root@b06176e75a5a:/# 
root@b06176e75a5a:/# cat /proc/*/environ 2>/dev/null | tr '\0' '\n' | grep '^DISPLAY=:' | uniq
root@b06176e75a5a:/# 
root@b06176e75a5a:/# 

Sorry. At present, we only support such scenario on the dgpu without a monitor, and this is not supported on jetson.

That…somehow doesnt sound right.

When you say “such scenarios”, are you suggesting that Jetson units can’t run deepstream pipelines (w nvinfer as one of element) w/o a monitor?

Hi,
If your device is headless, please make sure to apply this:

Jetson AGX Orin FAQ
Q: How to run developer kit in headless mode?

So that display is completely disabled.

Hi @fang4 , is the problem fixed now?

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

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