Running DeepStream sample apps in docker container

I am trying to run the examples using the Deepstream 6.1 docker image for dGPU. (link) [Docker Containers — DeepStream 6.1.1 Release documentation]

I’m running Ubuntu20.04LTS

The steps I have taken are as follows:

  1. Run docker image:

$ nvidia-docker run -it --env DISPLAY --env XAUTHORITY --volume /tmp/.X11-unix:/tmp/.X11-unix --volume /run/user/1000/gdm/Xauthority:/run/user/1000/gdm/Xauthority --volume /tmp/.X11-unix:/tmp/.X11-unix --volume /dev/dri/card0:/dev/dri/card0 --gpus all nvcr.io/nvidia/deepstream:6.1-samples /bin/bash

  1. Change to bin directory and run the sample app with the config file:

$ pwd

/opt/nvidia/deepstream/deepstream-6.1

$ cd bin
$ ./deepstream-app -c $(find / -name "dstest1_pgie_config.txt")

(gst-plugin-scanner:16): GStreamer-WARNING **: 09:47:42.080: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libtritonserver.so: cannot open shared object file: No such file or directory

(gst-plugin-scanner:16): GStreamer-WARNING **: 09:47:42.081: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so': librivermax.so.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:16): GStreamer-WARNING **: 09:47:42.086: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_ucx.so': libucs.so.0: cannot open shared object file: No such file or directory
** ERROR: <main:716>: Failed to set pipeline to PAUSED
Quitting
ERROR from src_bin_muxer: Output width not set
Debug info: gstnvstreammux.c(2794): gst_nvstreammux_change_state (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstNvStreamMux:src_bin_muxer
App run failed
  1. Verify that the display is reachable

$ apt install x11-apps
$ xeyes

This creates the expected xeyes window so I know the display is reachable using the current DISPLAY env var

I can’t help but wonder why I’m getting issues with shared libraries missing…? Isn’t that the point of the docker image?

  1. Running step2 with GST_DEBUG=4:

$ GST_DEBUG=4 ./deepstream-app -c $(find / -name "dstest1_pgie_config.txt")

0:00:00.000036910   308 0x55c6e127c400 INFO                GST_INIT gst.c:586:init_pre: Initializing GStreamer Core Library version 1.16.2
0:00:00.000059167   308 0x55c6e127c400 INFO                GST_INIT gst.c:587:init_pre: Using library installed in /usr/lib/x86_64-linux-gnu
0:00:00.000064973   308 0x55c6e127c400 INFO                GST_INIT gst.c:605:init_pre: Linux b3cb12cd2595 5.15.0-43-generic #46~20.04.1-Ubuntu SMP Thu Jul 14 15:20:17 UTC 2022 x86_64
0:00:00.000323643   308 0x55c6e127c400 INFO                GST_INIT gstmessage.c:128:_priv_gst_message_initialize: init messages
0:00:00.000723424   308 0x55c6e127c400 INFO                GST_INIT gstcontext.c:84:_priv_gst_context_initialize: init contexts
0:00:00.000913811   308 0x55c6e127c400 INFO      GST_PLUGIN_LOADING gstplugin.c:318:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.000989142   308 0x55c6e127c400 INFO      GST_PLUGIN_LOADING gstplugin.c:226:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.001015246   308 0x55c6e127c400 INFO      GST_PLUGIN_LOADING gstplugin.c:228:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.001035328   308 0x55c6e127c400 INFO            GST_REGISTRY gstregistry.c:1720:ensure_current_registry: reading registry cache: /root/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.007791306   308 0x55c6e127c400 INFO            GST_REGISTRY gstregistrybinary.c:621:priv_gst_registry_binary_read_cache: loaded /root/.cache/gstreamer-1.0/registry.x86_64.bin in 0.006740 seconds
0:00:00.007863241   308 0x55c6e127c400 INFO            GST_REGISTRY gstregistry.c:1579:scan_and_update_registry: Validating plugins from registry cache: /root/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.008782903   308 0x55c6e127c400 INFO            GST_REGISTRY gstregistry.c:1678:scan_and_update_registry: Registry cache has not changed
0:00:00.008789390   308 0x55c6e127c400 INFO            GST_REGISTRY gstregistry.c:1755:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.008814269   308 0x55c6e127c400 INFO                GST_INIT gst.c:806:init_post: GLib runtime version: 2.64.6
0:00:00.008818206   308 0x55c6e127c400 INFO                GST_INIT gst.c:808:init_post: GLib headers version: 2.63.1
0:00:00.008820843   308 0x55c6e127c400 INFO                GST_INIT gst.c:810:init_post: initialized GStreamer successfully
0:00:00.008937133   308 0x55c6e127c400 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:358:gst_element_factory_create: creating element "pipeline" named "pipeline"
0:00:00.009017644   308 0x55c6e127c400 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:358:gst_element_factory_create: creating element "bin" named "multi_src_bin"
0:00:00.054995624   308 0x55c6e127c400 INFO      GST_PLUGIN_LOADING gstplugin.c:902:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_multistream.so" loaded
0:00:00.055034815   308 0x55c6e127c400 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:358:gst_element_factory_create: creating element "nvstreammux" named "src_bin_muxer"
0:00:00.055358859   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:668:gst_element_add_pad:<GstNvStreamMux@0x55c6e1542040> adding pad 'src'
0:00:00.055449014   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:915:gst_element_get_static_pad: found pad src_bin_muxer:src
0:00:00.055563392   308 0x55c6e127c400 INFO                GST_PADS gstpad.c:2377:gst_pad_link_prepare: trying to link src_bin_muxer:src and src:proxypad0
0:00:00.055590882   308 0x55c6e127c400 INFO                GST_PADS gstpad.c:2585:gst_pad_link_full: linked src_bin_muxer:src and src:proxypad0, successful
0:00:00.055608539   308 0x55c6e127c400 INFO               GST_EVENT gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:00.055623844   308 0x55c6e127c400 INFO               GST_EVENT gstpad.c:5812:gst_pad_send_event_unchecked:<src_bin_muxer:src> Received event on flushing pad. Discarding
0:00:00.055649835   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:668:gst_element_add_pad:<multi_src_bin> adding pad 'src'
0:00:00.056567273   308 0x55c6e127c400 INFO      GST_PLUGIN_LOADING gstplugin.c:902:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcoreelements.so" loaded
0:00:00.056588293   308 0x55c6e127c400 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:358:gst_element_factory_create: creating element "tee" named "tiler_tee"
0:00:00.056672413   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:668:gst_element_add_pad:<GstTee@0x55c6e154f000> adding pad 'sink'
0:00:00.056716383   308 0x55c6e127c400 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:358:gst_element_factory_create: creating element "nvstreamdemux" named "demuxer"
0:00:00.056811699   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:668:gst_element_add_pad:<GstNvStreamDemux@0x55c6e1552010> adding pad 'sink'
0:00:00.056840742   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:915:gst_element_get_static_pad: found pad demuxer:sink
0:00:00.056855399   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstutils.c:1771:gst_element_link_pads_full: trying to link element multi_src_bin:(any) to element demuxer:(any)
0:00:00.056872059   308 0x55c6e127c400 INFO                GST_PADS gstutils.c:1034:gst_pad_check_link: trying to link multi_src_bin:src and demuxer:sink
0:00:00.056955443   308 0x55c6e127c400 INFO                GST_PADS gstutils.c:1587:prepare_link_maybe_ghosting: multi_src_bin and demuxer in same bin, no need for ghost pads
0:00:00.056977881   308 0x55c6e127c400 INFO                GST_PADS gstpad.c:2377:gst_pad_link_prepare: trying to link multi_src_bin:src and demuxer:sink
0:00:00.057000253   308 0x55c6e127c400 INFO                GST_PADS gstpad.c:2585:gst_pad_link_full: linked multi_src_bin:src and demuxer:sink, successful
0:00:00.057009231   308 0x55c6e127c400 INFO               GST_EVENT gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:00.057018585   308 0x55c6e127c400 INFO               GST_EVENT gstpad.c:5812:gst_pad_send_event_unchecked:<multi_src_bin:src> Received event on flushing pad. Discarding
0:00:00.071070352   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<demuxer> current NULL pending VOID_PENDING, desired next READY
0:00:00.071115832   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2675:gst_element_continue_state:<demuxer> completed state change to READY
0:00:00.071136310   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2575:_priv_gst_element_state_changed:<demuxer> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.071203864   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline> child 'demuxer' changed state to 2(READY) successfully
0:00:00.071243364   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<multi_src_bin> current NULL pending VOID_PENDING, desired next READY
0:00:00.071301625   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<src_bin_muxer> current NULL pending VOID_PENDING, desired next READY
0:00:00.071687505   308 0x55c6e127c400 WARN             nvstreammux gstnvstreammux.c:2794:gst_nvstreammux_change_state:<src_bin_muxer> error: Output width not set
0:00:00.071737425   308 0x55c6e127c400 INFO        GST_ERROR_SYSTEM gstelement.c:2140:gst_element_message_full_with_details:<src_bin_muxer> posting message: Output width not set
0:00:00.071800054   308 0x55c6e127c400 INFO        GST_ERROR_SYSTEM gstelement.c:2167:gst_element_message_full_with_details:<src_bin_muxer> posted error message: Output width not set
0:00:00.071820892   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2960:gst_element_change_state:<src_bin_muxer> have FAILURE change_state return
0:00:00.071844945   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2547:gst_element_abort_state:<src_bin_muxer> aborting state from NULL to READY
0:00:00.071864092   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2968:gst_bin_change_state_func:<multi_src_bin> child 'src_bin_muxer' failed to go to state 2(READY)
0:00:00.072198006   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2675:gst_element_continue_state:<src_bin_muxer> completed state change to NULL
0:00:00.072233627   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2960:gst_element_change_state:<multi_src_bin> have FAILURE change_state return
0:00:00.072259211   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2968:gst_bin_change_state_func:<pipeline> child 'multi_src_bin' failed to go to state 2(READY)
0:00:00.072299871   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2675:gst_element_continue_state:<demuxer> completed state change to NULL
0:00:00.072319895   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2575:_priv_gst_element_state_changed:<demuxer> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:00.072363291   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<src_bin_muxer> current NULL pending VOID_PENDING, desired next NULL
0:00:00.072383345   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2621:gst_bin_element_set_state:<src_bin_muxer> skipping transition from NULL to  NULL
0:00:00.072401558   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<multi_src_bin> child 'src_bin_muxer' changed state to 1(NULL) successfully
0:00:00.072424950   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2675:gst_element_continue_state:<multi_src_bin> completed state change to NULL
0:00:00.072454639   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2675:gst_element_continue_state:<tiler_tee> completed state change to NULL
0:00:00.072473986   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2960:gst_element_change_state:<pipeline> have FAILURE change_state return
** ERROR: <main:716>: Failed to set pipeline to PAUSED
Quitting
0:00:00.072566513   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:915:gst_element_get_static_pad: found pad demuxer:sink
0:00:00.072588784   308 0x55c6e127c400 INFO               GST_EVENT gstpad.c:5812:gst_pad_send_event_unchecked:<demuxer:sink> Received event on flushing pad. Discarding
ERROR from src_bin_muxer: Output width not set
Debug info: gstnvstreammux.c(2794): gst_nvstreammux_change_state (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstNvStreamMux:src_bin_muxer
0:00:00.173355015   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<demuxer> current NULL pending VOID_PENDING, desired next NULL
0:00:00.173400572   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2621:gst_bin_element_set_state:<demuxer> skipping transition from NULL to  NULL
0:00:00.173433582   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline> child 'demuxer' changed state to 1(NULL) successfully
0:00:00.173458379   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<multi_src_bin> current NULL pending VOID_PENDING, desired next NULL
0:00:00.173497371   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<src_bin_muxer> current NULL pending VOID_PENDING, desired next NULL
0:00:00.173517700   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2621:gst_bin_element_set_state:<src_bin_muxer> skipping transition from NULL to  NULL
0:00:00.173533301   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<multi_src_bin> child 'src_bin_muxer' changed state to 1(NULL) successfully
0:00:00.173551322   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2675:gst_element_continue_state:<multi_src_bin> completed state change to NULL
0:00:00.173584435   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline> child 'multi_src_bin' changed state to 1(NULL) successfully
0:00:00.173609074   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<tiler_tee> current NULL pending VOID_PENDING, desired next NULL
0:00:00.173625712   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2621:gst_bin_element_set_state:<tiler_tee> skipping transition from NULL to  NULL
0:00:00.173645242   308 0x55c6e127c400 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline> child 'tiler_tee' changed state to 1(NULL) successfully
0:00:00.173675724   308 0x55c6e127c400 INFO              GST_STATES gstelement.c:2675:gst_element_continue_state:<pipeline> completed state change to NULL
0:00:01.072694584   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstpad.c:2132:gst_pad_unlink: unlinking multi_src_bin:src(0x55c6e1548180) and demuxer:sink(0x55c6e1544630)
0:00:01.072715447   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstpad.c:2187:gst_pad_unlink: unlinked multi_src_bin:src and demuxer:sink
0:00:01.072721626   308 0x55c6e127c400 INFO           GST_PARENTAGE gstbin.c:1801:gst_bin_remove_func:<pipeline> removed child "demuxer"
0:00:01.072730778   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3251:gst_element_dispose:<demuxer> 0x55c6e1552010 dispose
0:00:01.072733768   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:784:gst_element_remove_pad:<demuxer> removing pad 'sink'
0:00:01.072738207   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3296:gst_element_dispose:<demuxer> 0x55c6e1552010 parent class dispose
0:00:01.072742370   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3328:gst_element_finalize:<demuxer> 0x55c6e1552010 finalize
0:00:01.072746657   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3333:gst_element_finalize:<demuxer> 0x55c6e1552010 finalize parent
0:00:01.072752083   308 0x55c6e127c400 INFO           GST_PARENTAGE gstbin.c:1801:gst_bin_remove_func:<pipeline> removed child "tiler_tee"
0:00:01.072756178   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3251:gst_element_dispose:<tiler_tee> 0x55c6e154f000 dispose
0:00:01.072759949   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:784:gst_element_remove_pad:<tiler_tee> removing pad 'sink'
0:00:01.072788283   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3296:gst_element_dispose:<tiler_tee> 0x55c6e154f000 parent class dispose
0:00:01.072792870   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3328:gst_element_finalize:<tiler_tee> 0x55c6e154f000 finalize
0:00:01.072795475   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3333:gst_element_finalize:<tiler_tee> 0x55c6e154f000 finalize parent
0:00:01.072800430   308 0x55c6e127c400 INFO           GST_PARENTAGE gstbin.c:1801:gst_bin_remove_func:<pipeline> removed child "multi_src_bin"
0:00:01.072828834   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstpad.c:2132:gst_pad_unlink: unlinking src_bin_muxer:src(0x55c6e1544190) and src:proxypad0(0x55c6e154a130)
0:00:01.072855984   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstpad.c:2187:gst_pad_unlink: unlinked src_bin_muxer:src and src:proxypad0
0:00:01.072860273   308 0x55c6e127c400 INFO           GST_PARENTAGE gstbin.c:1801:gst_bin_remove_func:<multi_src_bin> removed child "src_bin_muxer"
0:00:01.072864702   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3251:gst_element_dispose:<multi_src_bin> 0x55c6e14b8130 dispose
0:00:01.072867934   308 0x55c6e127c400 INFO        GST_ELEMENT_PADS gstelement.c:784:gst_element_remove_pad:<multi_src_bin> removing pad 'src'
0:00:01.072874614   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3296:gst_element_dispose:<multi_src_bin> 0x55c6e14b8130 parent class dispose
0:00:01.072879751   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3328:gst_element_finalize:<multi_src_bin> 0x55c6e14b8130 finalize
0:00:01.072907945   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3333:gst_element_finalize:<multi_src_bin> 0x55c6e14b8130 finalize parent
0:00:01.072913409   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3251:gst_element_dispose:<pipeline> 0x55c6e14b60c0 dispose
0:00:01.072934401   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3296:gst_element_dispose:<pipeline> 0x55c6e14b60c0 parent class dispose
0:00:01.072938935   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3328:gst_element_finalize:<pipeline> 0x55c6e14b60c0 finalize
0:00:01.072941604   308 0x55c6e127c400 INFO         GST_REFCOUNTING gstelement.c:3333:gst_element_finalize:<pipeline> 0x55c6e14b60c0 finalize parent
App run failed
0:00:01.074480055   308 0x55c6e127c400 INFO                GST_INIT gst.c:1083:gst_deinit: deinitializing GStreamer
0:00:01.075571216   308 0x55c6e127c400 INFO                GST_INIT gst.c:1232:gst_deinit: deinitialized GStreamer

For reference, this command run inside the container:
$ nvidia-smi

Sun Aug  7 09:54:47 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 515.65.01    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0  On |                  N/A |
| N/A   48C    P5    20W /  N/A |    105MiB /  6144MiB |     20%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

In step 2, please use config file such as deepstream-6.1/samples/configs/deepstream-app/sourcen_*.txt. dstest1_pgie_config.txt is only for deepstream-test1’s pgie config file.

Thanks for the response.

I have been trying to get the USB webcam config file to run. I have updated the docker container:

$ nvidia-docker run -it --env DISPLAY --env XAUTHORITY --volume /tmp/.X11-unix:/tmp/.X11-unix --volume /run/user/1000/gdm/Xauthority:/run/user/1000/gdm/Xauthority --device /dev/dri/card0:/dev/dri/card0 --device /dev/video0:/dev/video0 --gpus all --privileged nvcr.io/nvidia/deepstream:6.1-samples /bin/bash

I now pass access to my webcam via --device /dev/video0:/dev/video0

Then running the example:

$pwd

/opt/nvidia/deepstream/deepstream-6.1

$ cd bin/

$ ./deepstream-app -c $(find / -name “source1_usb_dec_infer_resnet_int8.txt”)

(gst-plugin-scanner:12): GStreamer-WARNING **: 09:01:21.755: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libtritonserver.so: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 09:01:21.757: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so': librivermax.so.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 09:01:21.761: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_ucx.so': libucs.so.0: cannot open shared object file: No such file or directory
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1482 Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine open error
0:00:01.102725459    11 0x562c4c3e58c0 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1888> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine failed
0:00:01.117446772    11 0x562c4c3e58c0 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1993> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine failed, try rebuild
0:00:01.117472015    11 0x562c4c3e58c0 INFO                 nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files
0:00:21.609609635    11 0x562c4c3e58c0 INFO                 nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1946> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine successfully
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1         3x368x640       
1   OUTPUT kFLOAT conv2d_bbox     16x23x40        
2   OUTPUT kFLOAT conv2d_cov/Sigmoid 4x23x40         

0:00:21.631595423    11 0x562c4c3e58c0 INFO                 nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary_gie> [UID 1]: Load new model:/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/config_infer_primary.txt sucessfully

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.


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

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

ERROR from src_elem: Device '/dev/video0' is busy
Debug info: gstv4l2object.c(3770): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstV4l2Src:src_elem:
Call to S_FMT failed for YUYV @ 640x480: Device or resource busy
ERROR from src_elem: Internal data stream error.
Debug info: gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstV4l2Src:src_elem:
streaming stopped, reason not-negotiated (-4)
** INFO: <bus_callback:160>: incorrect camera parameters provided, please provide supported resolution and frame rate

Quitting
cuGraphicsGLRegisterBuffer failed with error(219) gst_eglglessink_cuda_init texture = 1
App run failed
root@359e3fd2cb42:/opt/nvidia/deepstream/deepstream-6.1/bin# ./deepstream-app -c $(find / -name "source1_usb_dec_infer_resnet_int8.txt")
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1482 Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine open error
0:00:00.767011989    38 0x557fe7f4b0c0 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1888> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine failed
0:00:00.780202323    38 0x557fe7f4b0c0 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1993> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine failed, try rebuild
0:00:00.780214498    38 0x557fe7f4b0c0 INFO                 nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files
0:00:21.291262484    38 0x557fe7f4b0c0 INFO                 nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1946> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine successfully
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1         3x368x640       
1   OUTPUT kFLOAT conv2d_bbox     16x23x40        
2   OUTPUT kFLOAT conv2d_cov/Sigmoid 4x23x40         

0:00:21.309305835    38 0x557fe7f4b0c0 INFO                 nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary_gie> [UID 1]: Load new model:/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/config_infer_primary.txt sucessfully

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.


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

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

cuGraphicsGLRegisterBuffer failed with error(219) gst_eglglessink_cuda_init texture = 1
0:00:21.703767200    38 0x557fe6822700 WARN                 nvinfer gstnvinfer.cpp:2299:gst_nvinfer_output_loop:<primary_gie> error: Internal data stream error.
0:00:21.703801600    38 0x557fe6822700 WARN                 nvinfer gstnvinfer.cpp:2299:gst_nvinfer_output_loop:<primary_gie> error: streaming stopped, reason not-negotiated (-4)
ERROR from primary_gie: Internal data stream error.
Debug info: gstnvinfer.cpp(2299): gst_nvinfer_output_loop (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie:
streaming stopped, reason not-negotiated (-4)
** INFO: <bus_callback:160>: incorrect camera parameters provided, please provide supported resolution and frame rate

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)
** INFO: <bus_callback:160>: incorrect camera parameters provided, please provide supported resolution and frame rate

ERROR from src_elem: Internal data stream error.
Debug info: gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstV4l2Src:src_elem:
streaming stopped, reason not-negotiated (-4)
** INFO: <bus_callback:160>: incorrect camera parameters provided, please provide supported resolution and frame rate

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)
** INFO: <bus_callback:160>: incorrect camera parameters provided, please provide supported resolution and frame rate

App run failed

I checked the webcam with VLC showing the codec info:

And comparing with the config file:

[source0]
    enable=1
    #Type - 1=CameraV4L2 2=URI 3=MultiURI
    type=1
    camera-width=640
    camera-height=480
    camera-fps-n=30
    camera-fps-d=1
    camera-v4l2-dev-node=0

They’re the same res and framerate as far as I can tell? Not sure what the issue is here?

Is there another program occupying the camera?

Apologies, I didn’t get that error the first time I tried this, I only got that when I accidentily left VLC running in the background while I was getting the text to share.

This is with VLC closed:

WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1482 Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine open error
0:00:01.012674784    77 0x55970d2324c0 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1888> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine failed
0:00:01.028109447    77 0x55970d2324c0 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1993> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine failed, try rebuild
0:00:01.028127453    77 0x55970d2324c0 INFO                 nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files
0:00:21.643307647    77 0x55970d2324c0 INFO                 nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1946> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine successfully
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1         3x368x640       
1   OUTPUT kFLOAT conv2d_bbox     16x23x40        
2   OUTPUT kFLOAT conv2d_cov/Sigmoid 4x23x40         

0:00:21.658712174    77 0x55970d2324c0 INFO                 nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary_gie> [UID 1]: Load new model:/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/config_infer_primary.txt sucessfully

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.


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

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


cuGraphicsGLRegisterBuffer failed with error(219) gst_eglglessink_cuda_init texture = 1
0:00:22.053173817    77 0x55970b829700 WARN                 nvinfer gstnvinfer.cpp:2299:gst_nvinfer_output_loop:<primary_gie> error: Internal data stream error.
0:00:22.053212911    77 0x55970b829700 WARN                 nvinfer gstnvinfer.cpp:2299:gst_nvinfer_output_loop:<primary_gie> error: streaming stopped, reason not-negotiated (-4)
ERROR from primary_gie: Internal data stream error.
Debug info: gstnvinfer.cpp(2299): gst_nvinfer_output_loop (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie:
streaming stopped, reason not-negotiated (-4)
** INFO: <bus_callback:160>: incorrect camera parameters provided, please provide supported resolution and frame rate

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)
** INFO: <bus_callback:160>: incorrect camera parameters provided, please provide supported resolution and frame rate

ERROR from src_elem: Internal data stream error.
Debug info: gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstV4l2Src:src_elem:
streaming stopped, reason not-negotiated (-4)
** INFO: <bus_callback:160>: incorrect camera parameters provided, please provide supported resolution and frame rate

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)
** INFO: <bus_callback:160>: incorrect camera parameters provided, please provide supported resolution and frame rate

App run failed

The window also pops up for a moment before closing again, so I think from that the container is able to output to the display

Please check following pipeline works or not with the camera
gst-launch-1.0 v4l2src ! ‘video/x-raw, framerate=30/1’,width=640,height=480’ ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=NV12’ ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=RGBA’ ! nvegltransform ! nveglglessink

When I tried to copy paste the command I was having an issue:

$ gst-launch-1.0 v4l2src ! ‘video/x-raw, framerate=30/1’,width=640,height=480’ ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=NV12’ ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=RGBA’ ! nvegltransform ! nveglglessink

bash: syntax error near unexpected token `('

I made an edit to it to change the single quote to double quote and remove one of the single quotes:

$ gst-launch-1.0 v4l2src ! "video/x-raw,framerate=30/1,width=640,height=480" ! nvvideoconvert ! "video/x-raw(memory:NVMM),format=NV12" ! nvvideoconvert ! "video/x-raw(memory:NVMM),format=RGBA" ! nvegltransform ! nveglglessink

WARNING: erroneous pipeline: no element "nvegltransform"

For dGPU, please remove nvegltransform and try again.

$ GST_DEBUG=3 gst-launch-1.0 v4l2src ! "video/x-raw,framerate=30/1,width=640,height=480" ! nvvideoconvert     ! "video/x-raw(memory:NVMM),format=NV12" ! nvvideoconvert ! "video/x-raw(memory:NVMM),format=RGBA" ! nveglglessink

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
0:00:00.194673899    34 0x55fef9241a90 WARN               structure gststructure.c:1861:priv_gst_structure_append_to_gstring: No value transform to serialize field 'display' of type 'GstEGLDisplay'
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING ...
0:00:00.194825533    34 0x55fef9087a40 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:00.194839715    34 0x55fef9087a40 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
0:00:00.194890811    34 0x55fef9241a90 WARN                 v4l2src gstv4l2src.c:695:gst_v4l2src_query:<v4l2src0> Can't give latency since framerate isn't fixated !
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000042009
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

For anyone reading this in the future, my issue was resolved by:

  1. purge all nvidia packages [How to Uninstall NVIDIA Drivers in Ubuntu - Fedingo]

  2. reboot, as far as I understand this loads in the “default” nouveau driver on boot which is present in the ubuntu20 distro.

  3. Download the .run driver file which is version >510 (I used 515) [Linux x64 (AMD64/EM64T) Display Driver | 515.65.01 | Linux 64-bit | NVIDIA]

  4. Attempt to run this as sudo, I got an error saying the nouveau driver was loaded so the driver could not be updated. It offered to create 2 files to prevent it being loaded:

    /usr/lib/modprobe.d/nvidia-installer-disable-nouveau.conf
    /etc/modprobe.d/nvidia-installer-disable-nouveau.conf
    

    to which I confirmed yes.

  5. Reboot

  6. Install the driver again like in step 4. Say yes to everything in the prompts (ncurses style install)

  7. At this point, the correct driver is installed with no other nvidia packages. In order to enable passing the gpu to the docker container, we need to reinstall some packages

  8. Follow the steps here to install the required packages for docker to use your nvidia gpu: [Installation Guide — NVIDIA Cloud Native Technologies documentation]

At this point, the reference applications worked as expected.

In order to use docker containers, your host needs to be set up correctly, not all the setup is done in the container. Just another case of “fix your nvidia driver”

Glad you make it.

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