Difference between revisions of "GstCUDA - Building and Installation Guide"

From RidgeRun Developer Connection
Jump to: navigation, search
(Dependencies)
Line 182: Line 182:
 
== Dependencies==
 
== Dependencies==
  
GstCUDA is only supported on Jetson TX1/TX2 platforms.  The following packages are needed in order to build and use GstCUDA:  
+
GstCUDA is supported for the Jetson TX1/TX2/Nano/Xavier platforms.  The following packages are needed in order to build and use GstCUDA:  
  
 
* GStreamer 1.8.0.1 version or greater:
 
* GStreamer 1.8.0.1 version or greater:

Revision as of 16:36, 3 August 2021


Previous: Evaluating GstCUDA Index Next: Project Structure


Nvidia-preferred-partner-badge-rgb-for-screen.png



Getting the Code

GstCUDA is a 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. 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

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. Copy the CUDA L4T package into your Jetson file system
    1. For this guide we are using: cuda-repo-l4t-8-0-local_8.0.34-1_arm64.deb. Please adjust as needed.
    2. You can find the CUDA L4T package under the jetpack_download directory.
    3. New releases use the Nvidia SDK Manager.
  2. Run the following commands on your target hardware
sudo dpkg -i cuda-repo-l4t-8-0-local_8.0.34-1_arm64.deb
sudo apt-get update
sudo apt-key add /var/cuda-repo-10-0-local-10.0.166/7fa2af80.pub
sudo apt-get install cuda-toolkit-8-0

echo "# Add 32-bit CUDA library & binary paths:" >> ~/.bashrc
echo "export PATH=/usr/local/cuda-8.0/bin:\$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc
source ~/.bashrc

If you are using Ubuntu 16.04 or newer you may get the following warning, which is safe to ignore:

Get:1 file:/var/cuda-repo-8-0-local  InRelease
Ign:1 file:/var/cuda-repo-8-0-local  InRelease
Get:2 file:/var/cuda-repo-8-0-local  Release [574 B]
Get:2 file:/var/cuda-repo-8-0-local  Release [574 B]
Hit:4 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
Hit:6 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease
Reading package lists... Done
W: file:///var/cuda-repo-8-0-local/Release.gpg: Signature by key 889BEE522DA690103C4B085ED88C3D385C37D3BE uses weak digest algorithm (SHA1)

Finally, install the Multimedia API:

sudo dpkg -i nvidia-l4t-jetson-multimedia-api_32.4.2-20200408182620_arm64.deb

Mesa EGL

Run the following command to install the Mesa EGL package:

sudo apt install libegl1-mesa-dev

GTK-Doc

Run the following command to install the GTK-Doc package:

sudo apt install gtk-doc-tools

Building the project

The GstCUDA package must be built natively on the Jetson hardware.

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

1 ./autogen.sh --prefix=/usr/ --libdir=/usr/lib/aarch64-linux-gnu/
2 make

The autogen.sh script will automatically run the configure script. In case a more complex configuration is needed, the configure step may be executed manually:

1 ./autogen.sh --noconfigure
2 ./configure --prefix=/usr/ --libdir=/usr/lib/aarch64-linux-gnu/ <additional advanced options>
3 make

Finally, the status of the current version may be checked by running the unit tests:

make check

Installing the plugin

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

sudo make install

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

gst-inspect-1.0 cuda

with expected output

 1 Plugin Details:
 2   Name                     cuda
 3   Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm
 4   Filename                 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcuda.so
 5   Version                  0.7.0.1
 6   License                  Proprietary
 7   Source module            gst-cuda
 8   Source release date      2019-08-14 21:15 (UTC)
 9   Binary package           GStreamer CUDA Plug-in
10   Origin URL               Unknown package origin
11 
12   cudamux: cudamux
13   cudafilter: cudafilter
14 
15   2 features:
16   +-- 2 elements

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



Previous: Evaluating GstCUDA Index Next: Project Structure