ERROR: Could not init EGL display connection with ./deepstream-test1-app sample_720p....

Hi amycao,
Thank you for your reply
I don’t think it’s problem about DISPLAY
xrandr
Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
1920x1200 59.95*+
1920x1080 60.00
1680x1050 59.95
1600x1200 60.00
1280x1024 60.02
1280x960 60.00
1024x768 60.00
800x600 60.32
640x480 59.94
And gst-launh-c1.0 videotestsrc ! nveglglessink could show the display
But I still failed on deepstream-app -c source1_usb_dec_infer_resnet_int8.txt
NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
To go back to the tiled display, right-click anywhere on the window.

**PERF: FPS 0 (Avg)
**PERF: 0.00 (0.00)
** INFO: <bus_callback:189>: Pipeline ready

** INFO: <bus_callback:175>: Pipeline running

Creating LL OSD context new
cuGraphicsGLRegisterBuffer failed with error(304) gst_eglglessink_cuda_init texture = 1
0:00:06.362471396 67 0x558e07588d90 WARN nvinfer gstnvinfer.cpp:1830:gst_nvinfer_output_loop:<primary_gie_classifier> error: Internal data stream error.
0:00:06.362489132 67 0x558e07588d90 WARN nvinfer gstnvinfer.cpp:1830:gst_nvinfer_output_loop:<primary_gie_classifier> error: streaming stopped, reason not-negotiated (-4)
ERROR from primary_gie_classifier: Internal data stream error.
Debug info: gstnvinfer.cpp(1830): gst_nvinfer_output_loop (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie_classifier:
streaming stopped, reason not-negotiated (-4)
Quitting
ERROR from sink_bin_queue: Internal data stream error.
Debug info: gstqueue.c(988): gst_queue_handle_sink_event (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstQueue:sink_bin_queue:
streaming stopped, reason not-negotiated (-4)
ERROR from src_elem: Internal data stream error.
Debug info: gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstV4l2Src:src_elem:
streaming stopped, reason not-negotiated (-4)
ERROR from primary_gie_queue: Internal data stream error.
Debug info: gstqueue.c(988): gst_queue_handle_sink_event (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstQueue:primary_gie_queue:
streaming stopped, reason not-negotiated (-4)
App run failed

Could you give some advice how to solve such problem

Deepstream requires nvidia GPU for output to display, if you are using Tesla card, please noted it’s compute card, but you can follow this to setup virtual display, Deepstream/FAQ - eLinux.org
5A, if nvidia GPU with display port, please check your display driver environments;
you also can use sink type 4 RTSPStreaming for visulization on host by vlc.

Hi amycao,
I see,my card is 1080ti. I always want to develop on desktop first and then transfer to jetson. I think i could use rtsp,it‘s ok. Thank you for answer

Hi amycao, thanks for your follow-up. I have run the test again following your new instructions (with sink2 RTSPStreaming), and I got the below output, now I need to know how to visualize the streamed output pointed at *** DeepStream: Launched RTSP Streaming at rtsp://localhost:8080/ds-test ***

root@a3714bd34d9a:~/deepstream_sdk_v4.0.2_x86_64/sources/apps/sample_apps/deepstream-app# deepstream-app -c /root/deepstream_sdk_v4.0.2_x86_64/samples/configs/deepstream-app/source30_1080p_dec_infer-resnet_tiled_display_int8.txt

 *** DeepStream: Launched RTSP Streaming at rtsp://localhost:8080/ds-test ***

Creating LL OSD context new

Runtime commands:
        h: Print this help
        q: Quit

        p: Pause
        r: Resume

NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
      To go back to the tiled display, right-click anywhere on the window.

** INFO: <bus_callback:189>: Pipeline ready

Creating LL OSD context new
** INFO: <bus_callback:175>: Pipeline running


**PERF: FPS 0 (Avg)     FPS 1 (Avg)     FPS 2 (Avg)     FPS 3 (Avg)     FPS 4 (Avg)     FPS 5 (Avg)     FPS 6                                   (Avg)   FPS 7 (Avg)     FPS 8 (Avg)     FPS 9 (Avg)     FPS 10 (Avg)    FPS 11 (Avg)    FPS 12 (Avg)    FPS 13                                   (Avg)  FPS 14 (Avg)    FPS 15 (Avg)    FPS 16 (Avg)    FPS 17 (Avg)    FPS 18 (Avg)    FPS 19 (Avg)    FPS 20                                   (Avg)  FPS 21 (Avg)    FPS 22 (Avg)    FPS 23 (Avg)    FPS 24 (Avg)    FPS 25 (Avg)    FPS 26 (Avg)    FPS 27                                   (Avg)  FPS 28 (Avg)    FPS 29 (Avg)
**PERF: 29.75 (29.75)   32.62 (32.62)   34.51 (34.51)   31.21 (31.21)   41.56 (41.56)   41.56 (41.56)   41.56                                   (41.56) 30.78 (30.78)   41.56 (41.56)   41.56 (41.56)   35.14 (35.14)   29.36 (29.36)   32.05 (32.05)   35.14                                   (35.14) 33.90 (33.90)   31.21 (31.21)   41.56 (41.56)   31.21 (31.21)   34.51 (34.51)   33.32 (33.32)   41.56                                   (41.56) 35.14 (35.14)   41.56 (41.56)   30.24 (30.24)   32.05 (32.05)   30.78 (30.78)   40.76 (40.76)   34.57                                   (34.57) 33.32 (33.32)   35.14 (35.14)
**PERF: 39.58 (36.86)   39.98 (38.07)   39.18 (38.03)   39.58 (37.34)   39.98 (40.29)   39.78 (40.13)   39.78 (40.13)   39.98 (37.49)   39.78 (498 (37.01)      39.98 (37.90)   39.98 (38.86)   39.78 (38.34)   39.98 (37.63)   39.38 (39.81)   39.58 (37.34)   39.38 (38.19)   39.78 (38.13)   9)      38.98 (36.62)   39.98 (37.90)   39.98 (37.49)   39.58 (39.81)   39.98 (38.67)   39.58 (37.98)   39.78 (38.70)
**PERF: 40.57 (38.42)   40.57 (39.14)   40.37 (39.04)   40.57 (38.71)   40.37 (40.33)   40.57 (40.33)   40.37 (40.24)   40.17 (38.62)   40.57 (457 (38.50)      40.37 (38.95)   40.17 (39.43)   39.77 (38.95)   40.17 (38.71)   40.17 (39.97)   40.57 (38.71)   39.57 (38.78)   40.57 (39.17)   4)      40.17 (38.12)   40.57 (39.03)   40.57 (38.79)   40.37 (40.06)   40.17 (39.32)   40.37 (39.00)   40.57 (39.52)
**PERF: 39.36 (38.70)   39.36 (39.20)   39.16 (39.08)   39.16 (38.84)   39.36 (40.03)   38.36 (39.72)   38.96 (39.85)   38.96 (38.72)   39.36 (416 (38.70)      38.36 (38.77)   38.56 (39.17)   38.96 (38.96)   39.16 (38.84)   39.36 (39.79)   39.36 (38.90)   39.16 (38.90)   38.36 (38.93)   7)      39.16 (38.43)   39.36 (39.13)   39.36 (38.96)   39.36 (39.85)   39.36 (39.33)   39.16 (39.05)   39.16 (39.41)
**PERF: 41.55 (39.35)   41.55 (39.74)   41.55 (39.65)   41.95 (39.55)   41.95 (40.49)   41.95 (40.25)   40.95 (40.11)   40.95 (39.23)   41.95 (495 (39.44)      41.95 (39.50)   41.75 (39.77)   41.75 (39.60)   41.75 (39.51)   41.75 (40.25)   41.95 (39.60)   41.95 (39.60)   41.55 (39.54)   9)      41.95 (39.23)   41.95 (39.78)   41.95 (39.65)   41.95 (40.34)   41.95 (39.94)   41.75 (39.67)   41.95 (40.00)
**PERF: 40.33 (39.53)   40.13 (39.82)   40.13 (39.74)   40.33 (39.70)   40.13 (40.42)   40.33 (40.27)   39.93 (40.07)   40.33 (39.44)   40.13 (493 (39.53)      40.33 (39.66)   40.13 (39.84)   40.13 (39.70)   40.13 (39.63)   39.53 (40.11)   40.13 (39.70)   40.13 (39.70)   40.13 (39.65)   5)      40.33 (39.44)   40.33 (39.88)   40.13 (39.74)   40.33 (40.34)   40.13 (39.98)   40.13 (39.76)   40.33 (40.06)
**PERF: 39.99 (39.60)   40.39 (39.91)   40.39 (39.84)   39.59 (39.68)   40.39 (40.41)   40.39 (40.28)   40.19 (40.09)   40.39 (39.59)   40.19 (419 (39.63)      39.99 (39.71)   40.19 (39.89)   40.19 (39.78)   40.39 (39.74)   40.39 (40.16)   40.39 (39.81)   40.39 (39.81)   39.99 (39.70)   6)      39.99 (39.52)   39.99 (39.90)   39.79 (39.74)   39.99 (40.28)   40.19 (40.01)   40.39 (39.86)   40.19 (40.08)
** INFO: <bus_callback:212>: Received EOS. Exiting ...

Quitting
App run successful

you can use vlc to play it.

Hi Amycao thanks for the reply, I decided to save the out video to a file disabling sink0 and enabling sink1, and it is working fine.

I have a server with 6xT4’s. When I run deepstream-app on just 1 GPU the performance is around 39 FPS; however, I decided to run the application in parallel on each GPU and the performance dropped to 16 FPS for each GPU. Do you have an idea about the root cause for the dropping of performance?

Can you share the config used?

File:
source30_1080p_dec_infer-resnet_tiled_display_int8.txt

Configuration to save the output video to a file:
[sink0]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File
type=2
sync=1
source-id=0
gpu-id=0
nvbuf-memory-type=0

[sink1]
enable=1
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265
codec=1
sync=0
#iframeinterval=10
bitrate=2000000
output-file=out.mp4
source-id=0

Configuration to run the application on each GPU:
-Start the container image on 6 different shell windows
-Set a different gpu id for each container image with the flag gpu-id=<GPU ID #>
-Run the application parallely

from your config, sink1 used, it’s for File type, which will save the output onto your disk, it will not take GPU, through docker to set gpu id? or can you paste the whole config?

Hello @Amycao,
I have a very similar problem related to this post. My platform details are -
• Hardware Platform GPU (Tesla K20Xm)
• DeepStream Version - 5.0
• NVIDIA GPU Driver Version-440.33.01

I am trying to run a test application with a name deepstream-nvdsanalytics-test in /opt/nvidia/deepstream/deepstream-5.0/source/apps/sample-apps/deepstream-nvdsanalytics-test. It uses dsanalytics plugin for processing line-crossing, direction detection, overcrowding etc.

I followed this post and was able to run the test by doing following changes in deepstream_nvdsanalytics_test.cpp-

sink = gst_element_factory_make ("nveglglessink", "nvvideo-renderer");
TO
sink = gst_element_factory_make ("filesink", "filesink");
g_object_set (G_OBJECT (sink), "location", capture.mp4, NULL);

I got all information (overcrowding, line-crossing, direction) printed in the terminal and also got video file. But nothing got written in that video file “capture.mp4”. The file was completely empty with a size of few KB. I am not able to understand what is going wrong.

Please help, and let me know if any more information is required.
Thanks in advance.

I have the same issue, I guess the file is just created, but we are missing the code that copies the video data into the file

Please refer to sources/apps/apps-common/src/deepstream_sink_bin.c::create_encode_file_bin
for how to encode and save to file.

hi amycao, is there some documentation/sample on how to implement this function?

Above code is for this. you need to customize to your code.

Hello @sanchezvr7 please let me know if you are able to implement the solution suggested by @Amycao.
I went through the code and found it difficult to understand. I am still trying and if I understand the implementation I will post.
Thank you for the response.

I have the same problem. I’m trying to save the output to .mp4 but I have some difficulties understanding the code.
Any help would be appreciated.

Perhaps, i late to the party, but it could be useful for anyone who still facing this error.

This is how i handle EGL display connection error in deepstream docker container:

  1. EXPORT $display:0 or $display:1 [normally its set already]
  2. SUDO xhost+
  3. SUDO docker run deepstream container with --network=host

Number 3 is crucial because it allows container to communicate with localhost network