
You can find a detailed reference of these at the end of this article. We will be using a bunch of CMake flags to compile OpenCV. Prepare to compile with CUDA and cuDNN support This is the NVIDIA GPU architecture version, which will be the value for the CMake flag: CUDA_ARCH_BIN=6.1. Next to the model name, you will find the Comput Capability of the GPU. To set the flag correctly, let’s first determine the NVIDIA GPU model using the nvidia-smi -L command: If this flag is not set correctly, the final use of the binaries would fail. Determine the CUDA architecture versionĬMake needs a CUDA_ARCH_BIN flag to be set in order to compile the binaries with the correct CUDA architecture.

These modules are required to use the CUDA funcionality with OpenCV. We will also be downloading the OpenCV’s extra modules (CMake flag -D OPENCV_EXTRA_MODULES_PATH) repository. Now, download the OpenCV repository using Git: $ git clone formats: $ sudo apt install libpng-dev libjpeg-dev libopenexr-dev libtiff-dev libwebp-dev The next dependencies are optional but add the latest support for PNG, JPEG, JPEG2000, TIFF, WebP, etc. GTK is requried for GUI features, Camera support (v4l), Media Support (ffmpeg, gstreamer…), etc.: $ sudo apt install libavcodec-dev libavformat-dev libswscale-dev $ sudo apt install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev $ sudo apt install libgtk-3-dev To support Python 3 installations, we need Python (it comes pre-installed with most Ubuntu versions), Python-devel and Numpy: $ sudo apt install python3 python3-dev python3-numpy

DependenciesĬMake and GCC are required to configure the installation and compile the project: $ sudo apt install cmake $ sudo apt install gcc g++ Once you are set, let’s continue with the dependencies.
