DeepStream Reference Designs/Getting Started/Environment Setup: Difference between revisions

From RidgeRun Developer Wiki
Line 116: Line 116:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
$ docker --version
$ docker --version
AGREGAR VERSION
Docker version 20.10.2, build 20.10.2-0ubuntu1~18.04.2
</syntaxhighlight>
</syntaxhighlight>



Revision as of 20:30, 6 July 2022




Previous: Getting Started Index Next: Getting Started/Evaluating the Project




System Setup

We offer several versions of the system, all based on the NVIDIA Jetson boards. Small places that use a single or dual camera may use a Jetson Nano, while big commerce with 32 cameras may need to use the Jetson Xavier AGX.

  • RTSP Cameras: 1 to 8 simultaneous cameras.
  • Jetson Board: portable through Jetson Nano, TX2, NX, and AGX development kits.

The system is based on NVIDIA's DeepStream SDK to take advantage of the board's hardware and multimedia capabilities. The DeepStream version used in this project is 6.0, which is included as part of the NVIDIA JetPack 4.6. In case you need to install JetPack SDK 4.6, NVIDIA provides the Image SD Card method or it can also be installed through the NVIDIA SDK Manager. For more information on such installation methods, you can refer to the official NVIDIA documentation at the following Link.

Dependencies

This project has the following system dependencies:

  • pkg-config
  • gtk-doc-tools
  • libgstreamer1.0-dev
  • libgstreamer-plugins-base1.0-dev
  • gstreamer1.0-tools
  • gstreamer1.0-plugins-good
  • gstreamer1.0-libav
  • python3-pip

You may install the dependencies with the following command:

$ sudo apt-get install -y python3 python3-pip python3-setuptools python3-wheel ninja-build pkg-config gtk-doc-tools libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev  gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-libav libopencv-dev

Python 3 Version

NVIDIA Jetpack 4.6 installs within its packages the python version 3.6. You can check the current version with the command:

$ python3 --version
Python 3.6.9

But this project has a dependency on using python versions >= 3.7. To install Python 3.7 on the Jetson, you can use the following command:

$ sudo apt-get install python3.7

Next, Python versions 3.6 and 3.7 are added to update-alternatives:

$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2

To configure python3 version, use the following command and when the interactive menu is displayed, select option 2:

$ sudo update-alternatives --config python3
There are 2 choices for the alternative python3 (providing /usr/bin/python3).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3.7   2         auto mode
  1            /usr/bin/python3.6   1         manual mode
  2            /usr/bin/python3.7   2         manual mode

Press <enter> to keep the current choice[*], or type selection number: 2

In the example above, python3.7 was set as the default version, however, it may be the case that python3 still points to an older version, so it is important to make the manual selection. Finally, you can check the version of python used, again with the command:

$ python3 --version
Python 3.7.5

GstD

To handle the media instances used in this project, we rely on the methods provided by the Python API of Gstreamer Daemon (GstD). In order to install GStreamer Daemon, we invite you to refer to the following installation guide.

GstInterpipe

The media descriptors built in this project use the Gstreamer plugin called GstInterpipe. To install this plugin, we invite you to follow the building and installation guide.

AMQP Protocol Adapter

The project has a dependency on using a message broker like RabbitMQ. From DeepStream version 5.0, an AMQP protocol adapter is included that DeepStream applications can use out of the box to publish messages using AMQP 0-9-1 message protocol. The AMQP protocol adapter shared library is in the DeepStream package at:

/opt/nvidia/deepstream/deepstream-6.0/lib/libnvds_amqp_proto.so

The AMQP protocol adapter also has its own dependencies. To install the additional dependencies, you can run the following command:

$ sudo apt-get install libglib2.0 libglib2.0-dev libssl-dev

AMQP protocol adapter for DeepStream uses the librabbitmq.so library, built from rabbitmq-c for the underlying AMQP protocol implementation. To build the library, you may enter the following commands:

$ git clone -b v0.8.0  --recursive https://github.com/alanxz/rabbitmq-c.git
$ cd rabbitmq-c
$ mkdir build && cd build
$ cmake ..
$ cmake --build .

To copy the built librabbitmq.so library to its final location on the Jetson, enter the following command:

$ sudo cp ./librabbitmq/librabbitmq.so.4 /usr/lib/aarch64-linux-gnu/

The AMQP protocol communicates with an AMQP 0-9-1 compliant message broker like RabbitMQ. In this project, we use docker to build an image with the RabbitMQ message broker. Docker is one of the packages installed as part of NVIDIA JetPack 4.6, so no extra installation is required. You can check the docker version installed on the Jetson with the following command:

$ docker --version
Docker version 20.10.2, build 20.10.2-0ubuntu1~18.04.2

The first time you run the project, docker will display a message indicating that it could not find the RabbitMQ image locally, however, it will automatically search the remote server to install it correctly.

Nvmsgconv Plugin

As part of its components, this project uses the DeepStream plugin called Gst-nvmsgconv to build the payload messages that will be transmitted by the broker. If you want to know more about this module and its role within the system you can review the Wiki section of APLVR Inference Parser. By default, the library required by the DeepStream pipeline to use nvmsgconv is not built. So in a terminal, you should navigate to the following path and run the make command:

$ cd /opt/nvidia/deepstream/deepstream-6.0/sources/libs/nvmsgconv/ && sudo make

After that, you can inspect the library generated with the "ls" command, and the directory should have the following library (among other files):

$ ls
...
libnvds_msgconv.so
...



Previous: Getting Started Index Next: Getting Started/Evaluating the Project