GstCUDA - Building and Installation Guide: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
mNo edit summary
 
(47 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{GstCUDA Page |  
{{GstCUDA/Head|previous=Evaluating GstCUDA|next=Project Structure|metakeywords=GstCUDA source code, GstCUDA Getting the Code, GstCUDA Dependencies, GstCUDA Building, GstCUDA Installing, GstCUDA plugin, GstCUDA source code, GstCUDA code}}
[[GstCUDA - Features and Limitations|Features and Limitations]]|
[[GstCUDA - Elements Detailed Description|Elements Detailed Description]]|


This page describes the GstCUDA building and installation steps.
== Getting the Code ==


== Getting the Code ==
GstCUDA is RidgeRun's professional product. You can purchase GstCUDA, with full source code, from the [https://shop.ridgerun.com/products/gstcuda-1?_pos=1&_sid=4657d83bc&_ss=r RidgeRun Store] or using the Shopping Cart:


GstCUDA is an add-on to RidgeRun's professional SDK. You can purchase GstCUDA, with full source code, from the [http://www.ridgerun.com/store/GstCuda-p88257022 RidgeRun Store] or using the Shopping Cart:
<center>
<html>
<html>
<div class="ecwid ecwid-SingleProduct-v2 ecwid-SingleProduct-v2-bordered ecwid-SingleProduct-v2-centered ecwid-Product ecwid-Product-88257022" itemscope itemtype="http://schema.org/Product" data-single-product-id="88257022"><div itemprop="image"></div><div class="ecwid-title" itemprop="name"></div><div itemtype="http://schema.org/Offer" itemscope itemprop="offers"><div class="ecwid-productBrowser-price ecwid-price" itemprop="price" data-spw-price-location="button"><div itemprop="priceCurrency" content="USD"></div></div></div><div customprop="options"></div><div customprop="addtobag"></div></div><script type="text/javascript" src="https://app.ecwid.com/script.js?7804024&data_platform=singleproduct_v2" charset="utf-8"></script><script type="text/javascript">xProduct()</script>
<div id='product-component-11074b13486'></div>
    <script type="text/javascript">
    /*<![CDATA[*/
 
    (function () {
      var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';
      if (window.ShopifyBuy) {
        if (window.ShopifyBuy.UI) {
          ShopifyBuyInit();
        } else {
          loadScript();
        }
      } else {
        loadScript();
      }
 
      function loadScript() {
        var script = document.createElement('script');
        script.async = true;
        script.src = scriptURL;
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);
        script.onload = ShopifyBuyInit;
      }
 
      function ShopifyBuyInit() {
        var client = ShopifyBuy.buildClient({
          domain: 'ridgerun1.myshopify.com',
          storefrontAccessToken: 'b0ca98633a82de5d2f63cd51f5af30ac',
        });
 
        ShopifyBuy.UI.onReady(client).then(function (ui) {
          ui.createComponent('product', {
            id: [1684585742407],
            node: document.getElementById('product-component-11074b13486'),
            moneyFormat: '%24%7B%7Bamount%7D%7D',
            options: {
  "product": {
    "variantId": "all",
    "width": "240px",
    "contents": {
      "imgWithCarousel": false,
      "variantTitle": false,
      "description": false,
      "buttonWithQuantity": false,
      "quantity": false
    },
    "text": {
      "button": "BUY NOW"
    },
    "styles": {
      "product": {
        "@media (min-width: 601px)": {
          "max-width": "100%",
          "margin-left": "0",
          "margin-bottom": "50px"
        }
      },
      "button": {
        "background-color": "#007493",
        "font-size": "18px",
        "padding-top": "17px",
        "padding-bottom": "17px",
        ":hover": {
          "background-color": "#006884"
        },
        ":focus": {
          "background-color": "#006884"
        }
      },
      "quantityInput": {
        "font-size": "18px",
        "padding-top": "17px",
        "padding-bottom": "17px"
      },
      "compareAt": {
        "font-size": "12px"
      }
    }
  },
  "cart": {
    "contents": {
      "button": true
    },
    "styles": {
      "button": {
        "background-color": "#007493",
        "font-size": "18px",
        "padding-top": "17px",
        "padding-bottom": "17px",
        ":hover": {
          "background-color": "#006884"
        },
        ":focus": {
          "background-color": "#006884"
        }
      },
      "footer": {
        "background-color": "#ffffff"
      }
    }
  },
  "modalProduct": {
    "contents": {
      "img": false,
      "imgWithCarousel": true,
      "variantTitle": false,
      "buttonWithQuantity": true,
      "button": false,
      "quantity": false
    },
    "styles": {
      "product": {
        "@media (min-width: 601px)": {
          "max-width": "100%",
          "margin-left": "0px",
          "margin-bottom": "0px"
        }
      },
      "button": {
        "background-color": "#007493",
        "font-size": "18px",
        "padding-top": "17px",
        "padding-bottom": "17px",
        ":hover": {
          "background-color": "#006884"
        },
        ":focus": {
          "background-color": "#006884"
        }
      },
      "quantityInput": {
        "font-size": "18px",
        "padding-top": "17px",
        "padding-bottom": "17px"
      }
    }
  },
  "toggle": {
    "styles": {
      "toggle": {
        "background-color": "#007493",
        ":hover": {
          "background-color": "#006884"
        },
        ":focus": {
          "background-color": "#006884"
        }
      },
      "count": {
        "font-size": "18px"
      }
    }
  },
  "productSet": {
    "styles": {
      "products": {
        "@media (min-width: 601px)": {
          "margin-left": "-20px"
        }
      }
    }
  }
}
          });
        });
      }
    })();
    /*]]>*/
    </script>
</html>
</html>
Contact [mailto:support@ridgerun.com support@ridgerun.com] with any questions.
<center>
[[File:RR Contact Us.png|200px|link=http://www.ridgerun.com/contact]]
</center>
</center>
 
<br>


== Dependencies==
== Dependencies==
It is important to recall that GstCUDA is only supported on Tegra X1/X2 platforms. So, the below dependencies and provided guides to meet them corresponds to Tegra platform.


The following packages are needed in order to build and use GstCUDA:  
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.8.0.1 version or greater:
Line 30: Line 191:
** gstreamer-video-1.0
** gstreamer-video-1.0
** gstreamer-controller-1.0
** gstreamer-controller-1.0
* CUDA 8.0 version or greater
** gstreamer-plugins-bad-1.0
* CUDA 8.0 version or greater *
* Mesa EGL
** Installed by JetPack by default, if not got to [https://developer.ridgerun.com/wiki/index.php?title=Installing_CUDA-toolkit_and_VisionWorks_Jetson_TX2/Xavier/Nano Installing_CUDA-toolkit_and_VisionWorks_Jetson_TX2/Xavier/Nano]


=== GStreamer ===
=== 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.
 
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.


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-bad
</syntaxhighlight>
</syntaxhighlight>


=== CUDA L4T package ===
=== CUDA L4T package ===


Below are the required steps to install CUDA L4T pacakage on Tegra. The Jetpack default installation will flash and install all the necessary CUDA packages, but in case that a CUDA L4T installation is required the below steps should be followed.
<pre style=background-color:yellow>
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
</pre>


Installation guide:
Installation guide:
# Copy the CUDA L4T package into your Tegra file system
## For this guide we are using: cuda-repo-l4t-8-0-local_8.0.34-1_arm64.deb.
## You can find the CUDA L4T package under the jetpack_download directory.
# Under the Tegra command line run the following commands:
## '''''sudo dpkg -i cuda-repo-l4t-8-0-local_8.0.34-1_arm64.deb'''''
## '''''sudo apt-get update''''' **
## '''''sudo apt-get install cuda-toolkit-8-0'''''   


'''''** Note:''''' If you are using Ubuntu 16.04 or later it will warn about the signature of the package, you can ignore this.
1. You will need to know which distribution version you are using:
<syntaxhighlight lang=bash line=true>
<syntaxhighlight lang=bash>
$ sudo apt-get update
lsb_release -a
Get:1 file:/var/cuda-repo-8-0-local  InRelease
</syntaxhighlight>
Ign:1 file:/var/cuda-repo-8-0-local  InRelease
 
Get:2 file:/var/cuda-repo-8-0-local  Release [574 B]
2. Go to the [https://developer.nvidia.com/cuda-11-6-1-download-archive CUDA 11.6.1 download archive] and follow the selection menu.
Get:2 file:/var/cuda-repo-8-0-local  Release [574 B]
 
Hit:4 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
* For Jetson platform you can follow this link: [https://developer.nvidia.com/cuda-11-6-1-download-archive?target_os=Linux&target_arch=arm64-sbsa&Compilation=Native&Distribution=Ubuntu CUDA 11.6.1 Jetson Configuration]
Hit:5 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
Hit:6 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease
* For Ubuntu x86 platform you can follow this link: [https://developer.nvidia.com/cuda-11-6-1-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu CUDA 11.6.1 Ubuntu x86 Configuration]
Reading package lists... Done
 
W: file:///var/cuda-repo-8-0-local/Release.gpg: Signature by key 889BEE522DA690103C4B085ED88C3D385C37D3BE uses weak digest algorithm (SHA1)
Select the version depending on the ''lsb_release'' command executed above. We recommend using the '''deb (local)''' option for the installation.
</syntaxhighlight>        
 
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:
 
<syntaxhighlight lang=bash>
sudo apt install libegl1-mesa-dev
</syntaxhighlight>
 
=== GTK-Doc ===
 
Run the following command to install the GTK-Doc package:


<syntaxhighlight lang=bash>
sudo apt install gtk-doc-tools
</syntaxhighlight>


== Building the project ==
== Building the project ==
It is important to recall that GstCUDA is only supported on Tegra X1/X2 platforms. So, the GstCUDA package must be built natively on the Tegra.  
The GstCUDA package must be built natively.
 
=== For the Jetson TX1/TX2/Nano/Xavier platforms ===
 
In order to build the project run the following commands.  Note that the libdir variable corresponds to the Jetson TX1/TX2 system.


In order to build the project run the following commands. Note that the libdir variable corresponds to the Tegra X1/X2 system.
<syntaxhighlight lang=bash line=true>
<syntaxhighlight lang=bash line=true>
./autogen.sh --libdir=/usr/lib/aarch64-linux-gnu/
./autogen.sh --prefix=/usr/ --libdir=/usr/lib/aarch64-linux-gnu/
make
make
</syntaxhighlight>
</syntaxhighlight>


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:
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:
<syntaxhighlight lang=bash line=true>
./autogen.sh --noconfigure
./configure --prefix=/usr/ --libdir=/usr/lib/aarch64-linux-gnu/ <additional advanced options>
make
</syntaxhighlight>
=== For x86 platforms ===
In order to build the project run the following commands.
<syntaxhighlight lang=bash line=true>
<syntaxhighlight lang=bash line=true>
./autogen.sh --noconfigure
./autogen.sh --noconfigure
./configure --libdir=/usr/lib/aarch64-linux-gnu/ <additional advanced options>
./configure --prefix=/usr/ --libdir=/usr/lib/x86_64-linux-gnu/ --disable-nvmm <additional advanced options>
make
make
</syntaxhighlight>
</syntaxhighlight>


Finally, the status of the current version may be checked by running the unit tests:
Finally, the status of the current version may be checked by running the unit tests:
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
make check
make check
</syntaxhighlight>
</syntaxhighlight>




== Installing the plugin ==
== Installing the plugin ==
The plugin is installed to the GStreamer's default plug-in location in the file system by running:
The plugin is installed to the GStreamer's default plug-in location in the file system by running:
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
sudo make install
sudo make install
Line 96: Line 291:


To verify that the plug-in was correctly installed, you should run:
To verify that the plug-in was correctly installed, you should run:
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
$ gst-inspect-1.0 cuda
gst-inspect-1.0 cuda
</syntaxhighlight>   
 
with expected output
 
<syntaxhighlight lang=bash line=true>
Plugin Details:
Plugin Details:
   Name                    cuda
   Name                    cuda
   Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm
   Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm
   Filename                /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcuda.so
   Filename                /usr/lib/<platform>/gstreamer-1.0/libgstcuda.so
   Version                  0.1.0.1
   Version                  0.14.1.1
   License                  Proprietary
   License                  Proprietary
   Source module            gst-cuda
   Source module            gst-cuda
   Source release date      2017-09-21 17:31 (UTC)
   Source release date      2022-09-28 20:35 (UTC)
   Binary package          GStreamer CUDA Plug-in
   Binary package          GStreamer CUDA Plug-in
   Origin URL              Unknown package origin
   Origin URL              Unknown package origin


  cudamux: cudamux
   cudafilter: cudafilter
   cudafilter: cudafilter
  cudadebayer: cudadebayer


   2 features:
   2 features:
Line 116: Line 317:
</syntaxhighlight>  
</syntaxhighlight>  


}}
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.
 
 
{{GstCUDA/Foot|previous=Evaluating GstCUDA|next=Project Structure}}

Latest revision as of 06:54, 6 March 2023



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

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

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.

For the Jetson TX1/TX2/Nano/Xavier platforms

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

./autogen.sh --prefix=/usr/ --libdir=/usr/lib/aarch64-linux-gnu/
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:

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

For x86 platforms

In order to build the project run the following commands.

./autogen.sh --noconfigure
./configure --prefix=/usr/ --libdir=/usr/lib/x86_64-linux-gnu/ --disable-nvmm <additional advanced options>
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

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