App Run Fails With Errors

• Hardware Platform: RTX 4060 (Laptop)
• OS: Windows 11
• DeepStream Version: 6.3
• DeepStream Install Method: Debian Package
• NVIDIA GPU Driver Version: 536.45
• WSL Version: WSL2
• WSL OS: Ubuntu 20.04.6 LTS
• TensorRT Version: 8.5.3-1+cuda11.8
• cuDNN Version: 8.8.1
• CUDA Version: 12.2
• Requirement details: I want to use deepstream-heartrate-app from deepstream-tao-apps repository in github

Hello,

First of all, this topic is continuation of this topic.

I have installed the 6.3 version of Deepstream following the guide. But, when i wanted to test deepstream with following command:

sudo deepstream-app -c /opt/nvidia/deepstream/deepstream-6.3/samples/configs/deepstream-app/source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt --gst-debug=3

I get this output:

0:00:00.565935502 77155 0x55e3ad98e8f0 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:458:gst_element_factory_make: no such element factory "nvinfer"!
0:00:00.565966642 77155 0x55e3ad98e8f0 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:458:gst_element_factory_make: no such element factory "nvinfer"!
** ERROR: <create_secondary_gie:195>: Failed to create 'secondary_gie_0'
** ERROR: <create_secondary_gie:297>: create_secondary_gie failed
** ERROR: <create_secondary_gie_bin:431>: create_secondary_gie_bin failed
** ERROR: <create_pipeline:1576>: create_pipeline failed
** ERROR: <main:697>: Failed to create pipeline
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
App run failed

Could you offer your guidance please?

Kindest regards.

WSL2 is not officially supported, but we found someone has made Deepstream6.2 work in WLS2, you may refer to the link in this topic:

1 Like

Thank you for your kind guidance.

By following the steps in the link, I managed to run the deepstream-test1. Now, if you don’t mind, may i ask your guidance and advice on making the deepstream-heartrate-app to run please?

Kindest regards.

Please follow the instructions in deepstream_tao_apps/apps/tao_others at release/tao4.0_ds6.3ga · NVIDIA-AI-IOT/deepstream_tao_apps (github.com)

Thank you for your advice.

Could you offer your advice on if i need anything extra for WSL2 please?

Kindest regards.

We don’t test on WSL since it is not formally supported.

Thank you for the explanation.

When trying to build deepstream-heartrate-app i get the following output:

g++ -c -o deepstream_heartrate_app.o -fpermissive -Wall -Werror -I /opt/nvidia/deepstream/deepstream/sources/includes -I /opt/nvidia/deepstream/deepstream/sources/includes/cvcore_headers -I /usr/local/cuda/include -I ../common `pkg-config --cflags gstreamer-1.0` -D_GLIBCXX_USE_CXX11_ABI=1 -Wno-sign-compare -Wno-deprecated-declarations deepstream_heartrate_app.cpp
In file included from deepstream_heartrate_app.cpp:38:
../common/ds_yml_parse.h:32:10: fatal error: gst/rtsp-server/rtsp-server.h: No such file or directory
   32 | #include <gst/rtsp-server/rtsp-server.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:70: deepstream_heartrate_app.o] Error 1

If you don’t mind may I ask your guidance and that, if i can copy the deepstream-heartrate-app of ds6.0.1-tao3.0 branch and replace current deepstream-heartrate-app with it please?

Kindest regards.

Please use “apt install libgstrtspserver-1.0-dev” to install the dependencies.

Thank you for your guidance,

When I build i see this output:

-fPIC -DDS_VERSION="6.1.0" -I /usr/local/cuda/include -I ../../../includes -I /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvdsvideotemplate/includes -I /opt/nvidia/deepstream/deepstream/sources/includes -I /opt/nvidia/deepstream/deepstream/sources/includes/cvcore_headers -I ../ -I ../../common/ -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wno-deprecated-declarations
g++ -c -o heartrateinfer.o -fPIC -DDS_VERSION=\"6.1.0\" -I /usr/local/cuda/include -I ../../../includes -I /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvdsvideotemplate/includes -I /opt/nvidia/deepstream/deepstream/sources/includes -I /opt/nvidia/deepstream/deepstream/sources/includes/cvcore_headers -I ../ -I ../../common/ -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wno-deprecated-declarations heartrateinfer.cpp
heartrateinfer.cpp: In member function ‘void HeartRateAlgorithm::OutputThread()’:
heartrateinfer.cpp:840:18: warning: narrowing conversion of ‘((HeartRateAlgorithm*)this)->HeartRateAlgorithm::m_batch_width’ from ‘int’ to ‘uint32_t’ {aka ‘unsigned int’} [-Wnarrowing]
  840 |           {0, 0, m_batch_width, m_batch_height};
      |                  ^~~~~~~~~~~~~
heartrateinfer.cpp:840:33: warning: narrowing conversion of ‘((HeartRateAlgorithm*)this)->HeartRateAlgorithm::m_batch_height’ from ‘int’ to ‘uint32_t’ {aka ‘unsigned int’} [-Wnarrowing]
  840 |           {0, 0, m_batch_width, m_batch_height};
      |                                 ^~~~~~~~~~~~~~
heartrateinfer.cpp:886:38: warning: narrowing conversion of ‘rect_params._NvOSD_RectParams::left’ from ‘float’ to ‘int’ [-Wnarrowing]
  886 |           faceBBox[0] = {rect_params.left, rect_params.top,
      |                          ~~~~~~~~~~~~^~~~
heartrateinfer.cpp:886:56: warning: narrowing conversion of ‘rect_params._NvOSD_RectParams::top’ from ‘float’ to ‘int’ -Wnarrowing]
  886 |           faceBBox[0] = {rect_params.left, rect_params.top,
      |                                            ~~~~~~~~~~~~^~~
heartrateinfer.cpp:887:38: warning: narrowing conversion of ‘(rect_params._NvOSD_RectParams::left + rect_params._NvOSD_RectParams::width)’ from ‘float’ to ‘int’ [-Wnarrowing]
  887 |                     rect_params.left + rect_params.width,
      |                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
heartrateinfer.cpp:888:37: warning: narrowing conversion of ‘(rect_params._NvOSD_RectParams::top + rect_params._NvOSD_RectParams::height)’ from ‘float’ to ‘int’ [-Wnarrowing]
  888 |                     rect_params.top + rect_params.height};
      |                     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
-fPIC -DDS_VERSION="6.1.0" -I /usr/local/cuda/include -I ../../../includes -I /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvdsvideotemplate/includes -I /opt/nvidia/deepstream/deepstream/sources/includes -I /opt/nvidia/deepstream/deepstream/sources/includes/cvcore_headers -I ../ -I ../../common/ -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wno-deprecated-declarations
g++ -c -o ../../common/ds_yml_parse.o -fPIC -DDS_VERSION=\"6.1.0\" -I /usr/local/cuda/include -I ../../../includes -I /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvdsvideotemplate/includes -I /opt/nvidia/deepstream/deepstream/sources/includes -I /opt/nvidia/deepstream/deepstream/sources/includes/cvcore_headers -I ../ -I ../../common/ -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wno-deprecated-declarations ../../common/ds_yml_parse.cpp
-fPIC -DDS_VERSION="6.1.0" -I /usr/local/cuda/include -I ../../../includes -I /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvdsvideotemplate/includes -I /opt/nvidia/deepstream/deepstream/sources/includes -I /opt/nvidia/deepstream/deepstream/sources/includes/cvcore_headers -I ../ -I ../../common/ -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wno-deprecated-declarations
g++ -o libnvds_heartrateinfer.so heartrateinfer.o ../../common/ds_yml_parse.o -shared -Wl,-no-undefined -lnvds_yml_parser -lgstrtspserver-1.0 -L/usr/local/cuda-12.2/lib64/ -lcudart -lcuda -ldl -lpthread -L/opt/nvidia/deepstream/deepstream/lib/ -lnvdsgst_helper -lnvdsgst_meta -lnvds_meta -lnvds_infer -L/opt/nvidia/deepstream/deepstream/lib/cvcore_libs -lyaml-cpp -lnvbufsurface -lnvbufsurftransform -lnvdsbufferpool -lnvcv_core -lnvcv_heartrate -Wl,-rpath,/opt/nvidia/deepstream/deepstream/lib/ -Wl,-rpath,/opt/nvidia/deepstream/deepstream/lib/cvcore_libs/ -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0
/usr/bin/ld: cannot find -lcuda
collect2: error: ld returned 1 exit status
make: *** [Makefile:70: libnvds_heartrateinfer.so] Error 1

Could you offer your advice please?

Kindest reagards.

Please check the CUDA directory in your container.

Thank you for your kind guidance,

I have solved the problem about system not being able to find -lcuda. Then followed this guide for getting the USB camera on the WSL. After following the guide, I could see /dev/video0 through /dev/video5 listed after the command:

ls -l /dev/video*

After listing devices, I run the command:

v4l2-ctl -d /dev/video2 --list-formats-ext

I got the following output:

ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'GREY' (8-bit Greyscale)
                Size: Discrete 480x270
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 848x480
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.125s (8.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.167s (6.000 fps)
        [1]: 'UYVY' (UYVY 4:2:2)
                Size: Discrete 480x270
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 848x480
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.125s (8.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.167s (6.000 fps)
        [2]: 'GREY' (8-bit Greyscale)
                Size: Discrete 480x270
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 848x480
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.125s (8.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.167s (6.000 fps)
        [3]: 'Y8I ' (Interleaved 8-bit Greyscale)
                Size: Discrete 480x270
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 848x480
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.125s (8.000 fps)
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.167s (6.000 fps)

Then, I copied and pasted the deepstream-heartrate-app.cpp code I have written previously to deepstream-tao-apps/apps/tao_others/deepstream-heartrate-app and I run the code with the command:

GST_DEBUG=3 ./deepstream-heartrate-app 3 v4l2:///dev/video2 ./heartrate

I got the following output:

Request sink_0 pad from streammux
Failed to load config file: No such file or directory
** ERROR: <gst_nvinfer_parse_config_file:1308>: failed
Now playing: v4l2:///dev/video2
0:00:00.867667006  2315 0x55f18aa26a40 WARN                    v4l2 v4l2_calls.c:607:gst_v4l2_open:<camera> error: Cannot identify device '
                   '.
0:00:00.867706928  2315 0x55f18aa26a40 WARN                    v4l2 v4l2_calls.c:607:gst_v4l2_open:<camera> error: system error: No such file or directory
Running...
ERROR from element camera: Cannot identify device '
                                                   '.
Error details: v4l2_calls.c(607): gst_v4l2_open (): /GstPipeline:pipeline/GstBin:source-bin-00/GstV4l2Src:camera:
system error: No such file or directory
Returned, stopping playback
Average fps 0.000233
Totally 0 faces are inferred
Deleting pipeline
Segmentation fault

and then, I have tried this command:

GST_DEBUG=3 ./deepstream-heartrate-app 3 file:/opt/nvidia/deepstream/deepstream-6.3/samples/streams/sample_ride_bike.mov ./heartrate

I got the following output:

Request sink_0 pad from streammux
Failed to load config file: No such file or directory
** ERROR: <gst_nvinfer_parse_config_file:1308>: failed
Now playing: file:/opt/nvidia/deepstream/deepstream-6.3/samples/streams/sample_ride_bike.mov
0:00:00.928061235  2453 0x55928c67ef80 ERROR      nvdsvideotemplate gstnvdsvideotemplate.cpp:576:gst_nvdsvideotemplate_start:<heartrate_infer> Runtime error: ./heartrateinfer_impl/libnvds_heartrateinfer.so: undefined symbol: cuGraphicsEGLRegisterImage
0:00:00.928116191  2453 0x55928c67ef80 WARN                GST_PADS gstpad.c:1142:gst_pad_set_active:<heartrate_infer:sink> Failed to activate pad
Running...
ERROR from element heartrate_infer: Runtime error: ./heartrateinfer_impl/libnvds_heartrateinfer.so: undefined symbol: cuGraphicsEGLRegisterImage
Error details: Exception occurred
Returned, stopping playback
Average fps 0.000233
Totally 0 faces are inferred
Deleting pipeline
Segmentation fault

Could you offer your advice and guidance please?

Kindest regards.

There is still GPU driver issue with the container. The host driver does not match the container’s driver.

Thank you for your kind guidance,

I would like to add that about the mismatch between container and host driver , I don’t use a container.

Kindest regards.

I have tried this command:

 sudo GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video2 ! 'video/x-raw, format=YUY2, width=640, height=480, framerate=30/1'  ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=NV12' ! mux.sink_0  nvstreammux name=mux width=1280 height=720 batch-size=1  ! autovideosink

I got this output:

0:00:01.371221304  1695 0x56091b78c4d0 ERROR           GST_PIPELINE grammar.y:723:gst_parse_perform_link: could not link v4l2src0 to nvvideoconvert0, nvvideoconvert0 can't handle caps video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, framerate=(fraction)30/1
WARNING: erroneous pipeline: could not link v4l2src0 to nvvideoconvert0, nvvideoconvert0 can't handle caps video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, framerate=(fraction)30/1

Could you offer your guidance please?

Kindest regards.

Please use “gst-inspect-1.0 nvvideoconvert” to query which formats are supported on the sink pad.

It is basic GStreamer operations, please google for the usage and skills for GStreamer.

Thank you for your kind advice,

After trying the command you have suggested, I have seen the list of available formats:

format: { (string)I420, (string)NV12, (string)P010_10LE, (string)BGRx, (string)RGBA, (string)Y444, (string)GRAY8, (string)GBR, (string)RGB, (string)BGR, (string)BGR10A2_LE, (string)UYVP }

As you can see here while normally, YUY2 version would be available for nvvideoconvert, here it isn’t available. So, I have tried the command:

sudo GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=640, height=480, framerate=30/1'  ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=NV12' ! mux.sink_0  nvstreammux name=mux width=1280 height=720 batch-size=1  ! fakesink

I have seen these lines in the output:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
0:00:01.716536225  2316 0x557055af0920 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:01.716648885  2316 0x557055af0920 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
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)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
nvstreammux: Successfully handled EOS for source_id=0
Freeing pipeline ...

If you don’t mind could you kindly offer your advice please?

Kindest regards.

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

The “v4l2-ctl” has told you your camera can only output ‘UYVY’ or ‘GRAY8’ format. Why did you set “YUY2” caps?

Please add videoconvert before nvvideoconvert to convert UYVY to any supported format.

E.G.

sudo GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video2 ! 'video/x-raw, format=UYVY, width=640, height=480, framerate=30/1'  !  videoconvert ! 'video/x-raw, format=I420' ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=NV12' ! mux.sink_0  nvstreammux name=mux width=1280 height=720 batch-size=1  ! autovideosink

I think he destails have been provided in the FAQ DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums, please read carefully.

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