Python Samples of Deepstream 5.0 : Getting errors (Could not get EGL display connection) while running python test examples on Jetson Nano

Hi , I have installed DeepStream 5.0 SDK along with Python bindings , and after that I have downloaded python sample code from git. When I am trying to run already downloaded videos from Samples/Stream folder I am getting few errors.

System Configurations :
• Hardware Platform : Jetson
• JetPack Version : 4.4-b144
• Architecture: arm64
• DeepStream Version : 5.0
• TensorRT Version :7.1.3
• Cuda : 10.2

I used this Command:
$ python3 deepstream_test_1.py ../../../samples/streams/sample_720p.h264

Error Output :

Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

nvbuf_utils: Could not get EGL display connection
Unable to create NvStreamMux
Unable to create pgie
Unable to create nvvidconv
Unable to create nvosd
Creating EGLSink

Playing file ../../../samples/streams/sample_720p.h264
Traceback (most recent call last):
File "deepstream_test_1.py", line 266, in <module>
sys.exit(main(sys.argv))
File "deepstream_test_1.py", line 199, in main
streammux.set_property('width', 1920)
AttributeError: 'NoneType' object has no attribute 'set_property'

I tried to run other sample test cases but getting simillar errors.

Let me know if anyone has any idea about this?

Thanks

You can directly run on desktop, or you could do like below:
export DISPLAY=:0 or 1
xrandr to see if display exported.

nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream-5.0$ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 530mm x 300mm
1920x1080 60.00*+
1280x1024 75.03 60.00
1152x864 75.00
1024x768 75.03 60.01
800x600 75.00 60.32
720x400 70.04
640x480 75.00 59.94
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
then run your sample again.

Hi ,
I am connected to desktop and then tried your solutions -

  • xrandr
    Output:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm
1920x1080 60.00*+ 59.95 50.00
1600x900 60.00
1280x1024 75.03 60.00
1280x720 60.00 59.94 50.00
1152x864 75.00
1024x768 75.03 60.01
800x600 75.00 60.32
720x576 50.00
720x480 59.94
720x400 70.04
640x480 75.00 59.94 59.94
DP-0 disconnected (normal left inverted right x axis y axis)

After this I tried to run sample and still getting following error output =>

Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

Unable to create NvStreamMux
Unable to create pgie
Unable to create nvvidconv
Unable to create nvosd
Creating EGLSink

Playing file /opt/nvidia/deepstream/deepstream- 
5.0/samples/streams/sample_720p.h264
Traceback (most recent call last):
File "deepstream_test_1.py", line 266, in <module>
sys.exit(main(sys.argv))
File "deepstream_test_1.py", line 199, in main
streammux.set_property('width', 1920)
AttributeError: 'NoneType' object has no attribute 'set_property'
1 Like

Hi,
I am facing same issue with Python samples on AGX Xavier. If I connect with SSH, I get EGL display error and if I connect Xavier to monitor, I get errors:

Unable to create NvStreamMux
Unable to create pgie
Unable to create nvvidconv
Unable to create nvosd
Creating EGLSink

Playing file /opt/nvidia/deepstream/deepstream-5.0/samples/streams/sample_720p.h264
Traceback (most recent call last):
File "deepstream_test_1.py", line 266, in <module>
sys.exit(main(sys.argv))
File "deepstream_test_1.py", line 199, in main
streammux.set_property('width', 1920)
AttributeError: 'NoneType' object has no attribute 'set_property'

Any idea about this issue?

Can you find plugin,
gst-inspect-1.0 nvstreammux
gst-inspect-1.0 pgie
gst-inspect-1.0 nvvidconv
gst-inspect-1.0 nvosd
your initial creating display context error gone after connect with monitor.

I found only nvvidconv, others are not there. I followed DeepStream installation Guide from this page - https://docs.nvidia.com/metropolis/deepstream/dev-guide/index.html#page/DeepStream_Development_Guide/deepstream_quick_start.html#wwpID0E0GI0HA

If you installed by Jetpack, and select install Deepstream, all components should be there, can you list /usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/?

Here is the list of files in /usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/

libgstnvvideoconvert.so    libnvdsgst_dsexample.so    libnvdsgst_msgbroker.so    libnvdsgst_multistreamtiler.so  libnvdsgst_osd.so
libnvdsgst_dewarper.so     libnvdsgst_inferserver.so  libnvdsgst_msgconv.so      libnvdsgst_of.so                libnvdsgst_segvisual.so
libnvdsgst_dsanalytics.so  libnvdsgst_infer.so        libnvdsgst_multistream.so  libnvdsgst_ofvisual.so          libnvdsgst_tracker.so

it’s all there, strange you can only detect nvvidconv but others can not.

I am facing this issue on AGX Xavier, not sure what went wrong. If it’s related to installations or anything else. How to trace this now?

Please try to run c++ version first, like deepstream-app, it used above all components.

Sure, I will try C++ samples and let you know.

@Amycao I tried C++ deepstream-app sample and it’s not working. I’m getting below errors:

./deepstream-app -c /opt/nvidia/deepstream/deepstream-5.0/samples/configs/deepstream-app/source30_1080p_dec_infer-resnet_tiled_display_int8.txt

 ** ERROR: <create_multi_source_bin:1057>: Failed to create element 'src_bin_muxer'
** ERROR: <create_multi_source_bin:1132>: create_multi_source_bin failed
** ERROR: <create_pipeline:1296>: create_pipeline failed
** ERROR: <main:636>: Failed to create pipeline
Quitting
App run failed

So, rest of the C++ samples are also not working. The output from GST_DEBUG=4 is:

0:00:00.000144359 29502   0x5596a32000 INFO                GST_INIT gst.c:586:init_pre: Initializing GStreamer Core Library version 1.14.5
0:00:00.000227691 29502   0x5596a32000 INFO                GST_INIT gst.c:587:init_pre: Using library installed in /usr/lib/aarch64-linux-gnu
0:00:00.000305359 29502   0x5596a32000 INFO                GST_INIT gst.c:607:init_pre: Linux drishtic-xavier 4.9.140-tegra #1 SMP PREEMPT Thu Jun 25 21:22:12 PDT 2020 aarch64
0:00:00.000887307 29502   0x5596a32000 INFO                GST_INIT gstmessage.c:127:_priv_gst_message_initialize: init messages
0:00:00.001933820 29502   0x5596a32000 INFO                GST_INIT gstcontext.c:84:_priv_gst_context_initialize: init contexts
0:00:00.002345360 29502   0x5596a32000 INFO      GST_PLUGIN_LOADING gstplugin.c:317:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.002601052 29502   0x5596a32000 INFO      GST_PLUGIN_LOADING gstplugin.c:225:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.002628861 29502   0x5596a32000 INFO      GST_PLUGIN_LOADING gstplugin.c:227:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.002671519 29502   0x5596a32000 INFO            GST_REGISTRY gstregistry.c:1727:ensure_current_registry: reading registry cache: /home/archana/.cache/gstreamer-1.0/registry.aarch64.bin
0:00:00.038501576 29502   0x5596a32000 INFO            GST_REGISTRY gstregistrybinary.c:621:priv_gst_registry_binary_read_cache: loaded /home/archana/.cache/gstreamer-1.0/registry.aarch64.bin in 0.035758 seconds
0:00:00.038629902 29502   0x5596a32000 INFO            GST_REGISTRY gstregistry.c:1583:scan_and_update_registry: Validating plugins from registry cache: /home/archana/.cache/gstreamer-1.0/registry.aarch64.bin
0:00:00.041315310 29502   0x5596a32000 INFO            GST_REGISTRY gstregistry.c:1685:scan_and_update_registry: Registry cache has not changed
0:00:00.041355280 29502   0x5596a32000 INFO            GST_REGISTRY gstregistry.c:1762:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.041383921 29502   0x5596a32000 INFO                GST_INIT gst.c:807:init_post: GLib runtime version: 2.56.4
0:00:00.041402898 29502   0x5596a32000 INFO                GST_INIT gst.c:809:init_post: GLib headers version: 2.56.4
0:00:00.041412946 29502   0x5596a32000 INFO                GST_INIT gst.c:810:init_post: initialized GStreamer successfully
0:00:00.042119444 29502   0x5596a32000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "pipeline" named "pipeline"
0:00:00.042323646 29502   0x5596a32000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "bin" named "multi_src_bin"
0:00:00.042381537 29502   0x5596a32000 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "nvstreammux"!
** ERROR: <create_multi_source_bin:1057>: Failed to create element 'src_bin_muxer'
** ERROR: <create_multi_source_bin:1132>: create_multi_source_bin failed
** ERROR: <create_pipeline:1296>: create_pipeline failed
** ERROR: <main:636>: Failed to create pipeline
Quitting
0:00:00.142761704 29502   0x5596a32000 INFO              GST_STATES gstelement.c:2676:gst_element_continue_state:<pipeline> completed state change to NULL
0:00:01.042818538 29502   0x5596a32000 INFO         GST_REFCOUNTING gstelement.c:3251:gst_element_dispose:<pipeline> 0x5596c72120 dispose
0:00:01.042936560 29502   0x5596a32000 INFO         GST_REFCOUNTING gstelement.c:3297:gst_element_dispose:<pipeline> 0x5596c72120 parent class dispose
0:00:01.043027124 29502   0x5596a32000 INFO         GST_REFCOUNTING gstelement.c:3328:gst_element_finalize:<pipeline> 0x5596c72120 finalize
0:00:01.043077239 29502   0x5596a32000 INFO         GST_REFCOUNTING gstelement.c:3334:gst_element_finalize:<pipeline> 0x5596c72120 finalize parent
App run failed
0:00:01.043401286 29502   0x5596a32000 INFO                GST_INIT gst.c:1083:gst_deinit: deinitializing GStreamer
0:00:01.050087236 29502   0x5596a32000 INFO                GST_INIT gst.c:1231:gst_deinit: deinitialized GStreamer

Any idea about this issue? We are facing this same issue on Nano and Xavier. We installed Jetpack from here JetPack SDK | NVIDIA Developer and DeepStream from here - https://docs.nvidia.com/metropolis/deepstream/dev-guide/index.html#page/DeepStream_Development_Guide/deepstream_quick_start.html#wwpID0E0GI0HA

Please make sure Deepstream version compatible with Jetpack version, JP 4.4 GA support DS 5.0 GA, you can directly install deepstream through jetpack, there one option for it.

We are using DeepStream 5.0 only and the link I referred has installation instructions for the same on Jetson with DeepStream 5 and Jetpack 4.4.
I haven’t tried DeepStream 5 installation from JP 4.4 directly. Does that make any difference? Would you please suggest the best way to install DeepStream 5?

Not sure why you can’t detect the plugins, try remove the cache again,
rm ~/.cache/gstreamer-1.0/
if still not work, suggest install deepstream 5 through Jetpack, after that you can diretly use it.

Ok, I need to uninstall current setup for DeepStream 5.0. Do you have any set of instructions to remove DeepStream 5 completely?

try remove the cache first.

Tried removing cache, but error is same.