Understanding how to run `deepstream-mrcnn-app` app preferrably without any proto-lib

Please provide complete information as applicable to your setup.

• Personal Computer (GEFORCE RTX)
• DeepStream 5.1
• TensorRT 7.0
• NVIDIA GPU Driver: CUDA 11.2
• question
• How to reproduce the issue ?:

Pull Deepstream 5.1 images

docker pull nvcr.io/nvidia/deepstream:5.1-21.02-devel

docker pull nvcr.io/nvidia/deepstream:5.1-21.02-samples

Run docker container

docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -w /opt/nvidia/deepstream/deepstream-5.1 nvcr.io/nvidia/deepstream:5.1-21.02-devel

Go to Mask RCNN sample directory

cd /opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-mrcnn-app/

The sample build instructions are in the README.

Please follow instructions in the apps/sample_apps/deepstream-app/README on how
to install the prerequisites for Deepstream SDK, the DeepStream SDK itself and
the apps. It says

You must have the following development packages installed
   GStreamer-1.0
   GStreamer-1.0 Base Plugins
   GStreamer-1.0 gstrtspserver
   X11 client-side library

To install these packages, execute the following command:
   sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \
   libgstrtspserver-1.0-dev libx11-dev
   ...
   ...

The complete README can be found here
README.md (11.8 KB)

Specify CUDA version

I have CUDA 11.2 installed. I checked this outside the docker container using nvidia-smi. Within the container,

export CUDA_VER=11.2

Install dependencies. (No need for sudo here)

apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \
   libgstrtspserver-1.0-dev libx11-dev

Build the application

I modified the given makefile as

diff --git a/Makefile b/backupMakefile
index e6abba3..1ffadc0 100644
--- a/Makefile
+++ b/backupMakefile
@@ -51,14 +51,14 @@ PKGS+= gstreamer-1.0 gstreamer-video-1.0
 OBJS:= $(SRCS:.cpp=.o)
 
 CFLAGS+= -I../../../includes -std=c++11 \
-		-I /usr/local/cuda/include
+		-I /usr/local/cuda-$(CUDA_VER)/include
 
 CFLAGS+= $(shell pkg-config --cflags $(PKGS))
 
 LIBS:= $(shell pkg-config --libs $(PKGS))
 
 LIBS+= -L$(LIB_INSTALL_DIR) -lnvdsgst_meta -lnvds_meta -lrt \
-       -L/usr/local/cuda/lib64/ -lcudart \
+       -L/usr/local/cuda-$(CUDA_VER)/lib64/ -lcudart \
        -lcuda -Wl,-rpath,$(LIB_INSTALL_DIR)
 
 all: $(APP)

I got the application file built with the name deepstream-mrcnn-app. On running it as

$deepstream-mrcnn-app

I am prompted with an error

Error

(gst-plugin-scanner:99): GStreamer-WARNING **: 12:03:29.655: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_infer.so': libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:99): GStreamer-WARNING **: 12:03:29.656: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libgstnvvideoconvert.so': libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:99): GStreamer-WARNING **: 12:03:29.676: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_dewarper.so': libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:99): GStreamer-WARNING **: 12:03:29.677: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_multistreamtiler.so': libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:99): GStreamer-WARNING **: 12:03:29.678: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_eglglessink.so': libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:99): GStreamer-WARNING **: 12:03:29.679: 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:99): GStreamer-WARNING **: 12:03:29.679: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_multistream.so': libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:99): GStreamer-WARNING **: 12:03:29.683: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_tracker.so': libcuda.so.1: cannot open shared object file: No such file or directory

(gst-plugin-scanner:99): GStreamer-WARNING **: 12:03:29.692: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_dsexample.so': libcuda.so.1: cannot open shared object file: No such file or directory
missing arguments
Usage: deepstream-mrcnn-app -i <H264 filename> -p <Proto adaptor library> --conn-str=<Connection string>

On focusing on the last line, Usage: deepstream-mrcnn-app -i <H264 filename> -p <Proto adaptor library> --conn-str=<Connection string> , I want to know what protocol should I use among the 3 explained in the README, just so that I can get a mask on the sample video file (I don’t find it anywhere). I don’t see the need for the protocol for the sample to infer on a sample image/video and display a mask.

Am I understanding it correctly ?

Hi,
If you do not need to send messages to broker server, there two options,
1, you can remove nvmsgconv and nvmsgbroker from the sample, and change to other sinks you need.
2, you can use other samples like test1 sample or test3 sample but use configuration from dsmrcnn_pgie_config.txt under sample deepstream-mrcnn-test

need some changes in the sample code.

While running the test1 sample, I went on to check which CUDA libs were present in my container and found that /usr/local/cuda-11.1 was there. So, I re-ran

export CUDA_VER=11.1

And went on to make the project.

On running it, I get

One element could not be created. Exiting.

do you have CUDA 11.1 (/usr/local/cuda-11.1) instated outside the docker on your host, if you didn’t, please install it and run the docker

As you can see in DeepStream Getting Started | NVIDIA Developer , CUDA 11.1 is required dependency.

image

Thanks!