Difference between revisions of "CUDA ISP for NVIDIA Jetson/Getting Started/Building CUDA ISP for NVIDIA Jetson"

From RidgeRun Developer Connection
Jump to: navigation, search
(Dependencies)
 
(43 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
{{CUDA ISP for NVIDIA Jetson/Head|previous=|next=|metakeywords=|metadescription=}}
+
{{CUDA ISP for NVIDIA Jetson/Head|previous=Getting Started/Getting the code|next=Getting Started/Building custom v4l2src element|metakeywords=|metadescription=}}
 
</noinclude>
 
</noinclude>
  
Line 7: Line 7:
 
== Dependencies==
 
== Dependencies==
  
{{Review|I think we should provide more hints. Ok. Here is a list but, where can we find them?|lleon}}
 
  
 
CUDA ISP has the following dependencies for building from source:
 
CUDA ISP has the following dependencies for building from source:
  
* CUDA
+
* CUDA/NPPI. See more about CUDA Toolkit in this link: [https://developer.nvidia.com/cuda-toolkit CUDA Toolkit].
* NPPI
+
* libspdlog. You can see more about spdlog in this link: [https://github.com/gabime/spdlog spdlog repository].
* libspdlog
+
* GstCUDA. This is another RidgeRun product. You can see more about it in the following link: [[GstCUDA]]
* GstCUDA
+
 
 +
In the following sections you can see how to install the dependencies mentioned before.
  
  
Line 28: Line 28:
  
 
=== CUDA L4T pacakge (NPPI library) ===  
 
=== CUDA L4T pacakge (NPPI library) ===  
 +
 +
 
<pre style=background-color:yellow>
 
<pre style=background-color:yellow>
 
The Jetpack default installation will flash and install all the necessary CUDA packages, including NPPI library. This section describes how to perform a manual installation, which is typically __NOT__ needed
 
The Jetpack default installation will flash and install all the necessary CUDA packages, including NPPI library. This section describes how to perform a manual installation, which is typically __NOT__ needed
Line 39: Line 41:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
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.
+
2. Depending on your platform follow the next instructions:
  
* 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]
+
==== Jetson platforms ====
+
* Depending on what Jetpack release you have installed on your Jetson, you might want to download the corresponding CUDA Toolkit version, including NPPI library. In the following table you can see which one you need. Click on the link and follow the selection menu.
* 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]
 
  
Select the version depending on the ''lsb_release'' command executed above. We recommend using the '''deb (local)''' option for the installation.
+
{| class="wikitable"
 +
|-
 +
! Jetpack Release !! CUDA Toolkit version
 +
|-
 +
| JetPack 4.x || [https://developer.nvidia.com/cuda-10.2-download-archive Get CUDA 10.2 Toolkit]
 +
|-
 +
| JetPack 5.x || [https://developer.nvidia.com/cuda-11-4-0-download-archive Get CUDA 11.4 Toolkit]
 +
|}
  
3. Once you have selected your system setup, NVIDIA will show you the installation instructions for those requirements.
+
==== x86 platforms ==== 
 +
* For x86 platforms, go to this link: [https://developer.nvidia.com/cuda-downloads CUDA Toolkit 12.1 download archive] and follow the selection menu.  
  
Installation guide for NPPI library:
+
3. Select the version depending on the ''lsb_release'' command executed above. We recommend using the '''deb (local)''' option for the installation.
  
In case installing CUDA does not include the NPPI library, you can follow this step to install NPPI library:
+
4. Once you have selected your system setup, NVIDIA will show you the installation instructions for those requirements.
  
1. Download the package for NPPI library. Access this link [http://archive.ubuntu.com/ubuntu/pool/multiverse/n/nvidia-cuda-toolkit download NPPI library] and find the version of NPPI library you want. For this project we used: libnppicom10_10.1.243-3_amd64.deb
+
=== GstCUDA ===
  
2. Then run:
+
GstCUDA is another RigdeRun product. This product is required for CUDA ISP if you want to use it with GStreamer applications. You can see more about this product in this link: [[GstCUDA|Get GstCUDA]]
<syntaxhighlight lang=bash>
 
sudo apt-get update
 
sudo apt-get install libnppicom10
 
</syntaxhighlight>
 
  
=== GstCUDA ===
+
=== Custom v4l2src element ===
  
{{Review|Please, highlight that it is required for CUDA ISP in case they want to use it on GStreamer|lleon}}
+
To capture from a camera in raw format with a bits per pixel different from 0, you may require to recompile the GStreamer Plugins Good. Please, follow [[CUDA_ISP_for_NVIDIA_Jetson/Getting_Started/Building_custom_v4l2src_element|these steps]].
 
 
GstCUDA is another RigdeRun product. You can see more about this product in this link: [[GstCUDA|Get GstCUDA]]
 
  
 
=== Documentation (optional) ===
 
=== Documentation (optional) ===
Line 100: Line 103:
  
 
The process should be similar in other systems, not based on Debian.
 
The process should be similar in other systems, not based on Debian.
 
Then, install meson and other elements.
 
 
<syntaxhighlight lang=bash>
 
sudo pip3 install meson      \
 
                  pre-commit
 
pip3 install numpy
 
</syntaxhighlight>
 
  
 
== Building the project ==
 
== Building the project ==
Line 114: Line 109:
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
meson build
+
meson build --optimization 3 --prefix /usr -Denable-docs=disabled -Ddeveloper-mode=false
 
ninja -C build
 
ninja -C build
 
sudo ninja -C build install
 
sudo ninja -C build install
Line 120: Line 115:
  
 
For additional customization, you may refer to the following table of options:
 
For additional customization, you may refer to the following table of options:
 +
  
 
<center>`
 
<center>`
Line 126: Line 122:
 
! Configure Option !! Description
 
! Configure Option !! Description
 
|-
 
|-
| -Denable-python=disabled || Skip the Python API compilation. Enabled by default.
+
| -Ddeveloper-mode=false || Disable developer mode. Enabled by default.
 
|-
 
|-
| -Dwith-python-version=3.8 || Sets the Python version. It takes '3' by default.
+
| -Denable-docs=disabled || Skip documentation generation. Enabled by default.
 
|-
 
|-
| -Denable-docs=disabled || Skip documentation generation. Enabled by default.
+
| -Denable-gst=disabled || Skip building for GStreamer elements. Enabled by default.
 +
|-
 +
| -Denable-tests=disabled || Skip building tests. Enabled by default.
 +
|-
 +
| --prefix /usr || Set the installation path of the library.  
 
|-
 
|-
| --prefix /usr || Set the installation path of the library
+
| --optimization 3 || Set the optimization level to the maximum
 
|}
 
|}
 
<b>Table 1.</b> CUDA ISP configuration options (Meson)</caption>
 
<b>Table 1.</b> CUDA ISP configuration options (Meson)</caption>
 
</center>
 
</center>
 
 
 
 
 
 
 
 
 
 
 
 
 
  
  
Line 154: Line 141:
  
 
<noinclude>
 
<noinclude>
{{CUDA ISP for NVIDIA Jetson/Foot||}}
+
{{CUDA ISP for NVIDIA Jetson/Foot|Getting Started/Getting the code|Getting Started/Building custom v4l2src element}}
 
</noinclude>
 
</noinclude>

Latest revision as of 10:07, 31 March 2023


Previous: Getting Started/Getting the code Index Next: Getting Started/Building custom v4l2src element






Dependencies

CUDA ISP has the following dependencies for building from source:

  • CUDA/NPPI. See more about CUDA Toolkit in this link: CUDA Toolkit.
  • libspdlog. You can see more about spdlog in this link: spdlog repository.
  • GstCUDA. This is another RidgeRun product. You can see more about it in the following link: GstCUDA

In the following sections you can see how to install the dependencies mentioned before.


Core

Please, install them using (in Debian-based systems):

sudo apt install -y     \
    libspdlog-dev       \
    python3-dev

CUDA L4T pacakge (NPPI library)

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

Installation guide for CUDA:

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

lsb_release -a

2. Depending on your platform follow the next instructions:

Jetson platforms

  • Depending on what Jetpack release you have installed on your Jetson, you might want to download the corresponding CUDA Toolkit version, including NPPI library. In the following table you can see which one you need. Click on the link and follow the selection menu.
Jetpack Release CUDA Toolkit version
JetPack 4.x Get CUDA 10.2 Toolkit
JetPack 5.x Get CUDA 11.4 Toolkit

x86 platforms

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

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

GstCUDA

GstCUDA is another RigdeRun product. This product is required for CUDA ISP if you want to use it with GStreamer applications. You can see more about this product in this link: Get GstCUDA

Custom v4l2src element

To capture from a camera in raw format with a bits per pixel different from 0, you may require to recompile the GStreamer Plugins Good. Please, follow these steps.

Documentation (optional)

For the documentation, consider the following dependency:

  • doxygen

Please, install it using (in Debian-based systems):

sudo apt install -y     \
    doxygen             \

Meson building system

At the building system level:

  • ninja-build
  • python3-pip
  • pkg-config
  • meson

Please, install them using (in Debian-based systems):

sudo apt install -y \
     python3        \
     python3-pip    \
     ninja-build    \
     pkg-config

The process should be similar in other systems, not based on Debian.

Building the project

Once fulfilled the dependencies, you can run a default compilation with:

meson build --optimization 3 --prefix /usr -Denable-docs=disabled -Ddeveloper-mode=false
ninja -C build
sudo ninja -C build install

For additional customization, you may refer to the following table of options:


`
Configure Option Description
-Ddeveloper-mode=false Disable developer mode. Enabled by default.
-Denable-docs=disabled Skip documentation generation. Enabled by default.
-Denable-gst=disabled Skip building for GStreamer elements. Enabled by default.
-Denable-tests=disabled Skip building tests. Enabled by default.
--prefix /usr Set the installation path of the library.
--optimization 3 Set the optimization level to the maximum

Table 1. CUDA ISP configuration options (Meson)




Previous: Getting Started/Getting the code Index Next: Getting Started/Building custom v4l2src element