GstCUDA - Building and Installation Guide

From RidgeRun Developer Wiki

Follow Us On Twitter LinkedIn Email Share this page



Previous: Evaluating GstCUDA Index Next: Project Structure





Getting the Code

GstCUDA is RidgeRun's professional product. You can purchase GstCUDA, with full source code, from the RidgeRun Store or using the Shopping Cart:



Dependencies

GstCUDA is supported for the Jetson TX1/TX2/Nano/Xavier platforms and PC systems that have an NVIDIA GPU. The following packages are needed in order to build and use GstCUDA:

  • GStreamer 1.8.0.1 version or greater:
    • gstreamer-1.0
    • gstreamer-plugins-base-1.0
    • gstreamer-base-1.0
    • gstreamer-check-1.0
    • gstreamer-video-1.0
    • gstreamer-controller-1.0
    • gstreamer-plugins-bad-1.0
  • CUDA 8.0 version or greater *
  • Mesa EGL
  • Meson

GStreamer

The GStreamer packages are likely already installed in your Tegra Ubuntu OS distribution. In case you want to double check and install the missing packages, run the following commands.

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-bad

CUDA L4T package

The Jetpack default installation will flash and install all the necessary CUDA packages. This section describes how to perform a manual installation, which is typically __NOT__ needed

Installation guide:

1. You will need to know which distribution version you are using:

lsb_release -a

2. Go to the CUDA 11.6.1 download archive and follow the selection menu.

Select the version depending on the lsb_release command executed above. We recommend using the deb (local) option for the installation.

3. Once you have selected your system setup, NVIDIA will show you the installation instructions for those requirements.

Mesa EGL

Run the following command to install the Mesa EGL package:

sudo apt install libegl1-mesa-dev

Meson

The image stitching library makes use of the Meson build system. To correctly build this library, you need to use the latest version of Meson:

First, make sure python dependencies and ninja are installed

sudo apt-get install python3 python3-pip python3-setuptools \
                       python3-wheel ninja-build

Then use pip3 install Meson directly from its repository.

sudo -H pip3 install git+https://github.com/mesonbuild/meson.git

Building the project

The GstCUDA package must be built natively.

For the Jetson TX1/TX2/Nano/Xavier/Orin platforms

In order to build the project run the following commands. Note that the libdir variable corresponds to the Jetson system.

meson build --prefix=/usr/ --libdir=/usr/lib/aarch64-linux-gnu/
ninja -C build

For x86 platforms

In order to build the project run the following commands.

meson build --prefix=/usr -Dnvmm-support=false
ninja -C build

Enable OCV CUDA Support

If you want to compile the library with OpenCV with CUDA backend support, then use the following meson option during the configuration step.

-Docvcuda=enabled

Installing the plugin

The plugin is installed to the GStreamer's default plug-in location in the file system by running:

sudo ninja -C build install

To verify that the plug-in was correctly installed, you should run:

gst-inspect-1.0 cuda

with expected output

Plugin Details:
  Name                     cuda
  Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm
  Filename                 /usr/lib/<platform>/gstreamer-1.0/libgstcuda.so
  Version                  0.14.1.1
  License                  Proprietary
  Source module            gst-cuda
  Source release date      2022-09-28 20:35 (UTC)
  Binary package           GStreamer CUDA Plug-in
  Origin URL               Unknown package origin

  cudamux: cudamux
  cudafilter: cudafilter

  2 features:
  +-- 2 elements

After installing GstCUDA and all its dependencies, the Linux O.S. running on your platform must be rebooted before running a GStreamer pipeline that uses GstCUDA.



Previous: Evaluating GstCUDA Index Next: Project Structure