Development Environment on Ubuntu 20.04 LTS



Having proper foundations in software usually translates on having a software project easy to extend and faster to develop. On its core, software engineering provides tools to improve: Business Value, Code Quality, and Process Predictability (Our primary focus).

Our goal is to introduce Software Engineering practices, for the usage of Cloud and Edge Computing for video processing.

Writen by: Santiago Hurtado


We used a Linux environment tested on a bare-metal machine and also using docker containers. Docker provides good process predictability, and the benchmarks are run on the bare-metal machine for performance reasons.

The specifications used are the following:

  • Ubuntu 20.04
  • Docker Community Edition(CE)v19
  • Nvidia Cuda 10.2
  • Nvidia Container Toolkit
  • OpenCV 4, CMake 3, C++, Boost 1.7, GTest and Python 3.8, Numpy
  • *Nvidia Quadro P400 GPU

*The P400 seems to be an excellent card to learn Cuda since it provides an architecture 6.1 and is not expensive. However, to have higher performance is recommended an Nvidia GeForce RTX 2060 GPU, at the least.

System Installation

Ubuntu 20.04 LTS

Installing ubuntu 20.04 LTS and Cuda together is very straight forward, go to, there are many resources can be found. Many Linux distros have similar installation steps, for instance, CentOS and Redhat should be pretty much the same.

  • Install the Linux distro on your machine, update and upgrade your system and restart,


  • The Nvidia drivers should have been already installed, to verify run


When installing a new driver on the kernel be aware that new computers might have security for the UEFI boot

  • Next step is to install the Cuda SDK, for now, we will use the ubuntu 1804 support

      sudo mv /etc/apt/preferences.d/cuda-repository-pin-600
      sudo apt-key adv --fetch-keys
      sudo add-apt-repository "deb /"
      sudo apt-get update
      sudo apt-get install cuda
  • Add to your .bashrc

      export PATH=/usr/local/cuda-10.2/bin:/usr/local/cuda-10.2/NsightCompute-2019.1${PATH:+:${PATH}}
      export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64 ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  • The last step is to restart the system and check that everything works. Run the command and check that you see your card on the screen.


There are detailed instructions on the Cuda quick start


If you like, now you can install the docker-ce (community edition) on your system. For ubuntu 20.04 LTS there is already a package on the main package repository so the only step needed is to run the following command.

sudo apt install

Instead of “distribution=$(. /etc/os-release;echo $ID$VERSION_ID)” set to ubuntu1804

export distribution=ubuntu18.04
curl -s -L | sudo apt-key add -
curl -s -L$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

Development Libraries

Install OpenCV

To install OpenCV we will use the master from the git repository, you can select a specific version if you prefer. Here is the guide we used. Note: At this moment Cuda 10.02 can use only gcc 8, the ubuntu 20.04 default is 9.

sudo apt-get install -y build-essential
sudo apt-get install -y cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev
#[Cuda support]
sudo apt-get install gcc-8 g++-8
sudo ln -s /usr/bin/gcc-8 gcc
sudo ln -s /usr/bin/g++-8 g++
cd /usr/local/cuda-10.2/bin
sudo rm gcc
sudo rm g++
sudo ln -s /usr/bin/gcc-8 gcc
sudo ln -s /usr/bin/g++-8 g++

cd /opt/libs
git clone 
git clone
mkdir opencv_build
cd opencv_build


make -j 8

Install Boost 1.72

To install boost you will not require many dependencies but if you want Boost.python you will need to have installed Python.

sudo apt install python3-dev python3-numpy 
cd ~/Downloads
tar xvfz boost_1_72_0.tar.gz -C /opt/libs
cd /opt/libs/boost_1_72_0

This step is for Boost.Python, verify that you have all the paths correct and spaces.

./ --with-libraries=python,thread,log,system,chrono --with-python-version=3.8
echo "using python : 3.8 : /usr/bin/python3.8 : /usr/include/python3.8 : /usr/lib ;" >> project-config.jam
./b2 headers
sudo ./b2 install

Install Gtest

There are many ways to install gTest, we use the package included in ubuntu.

cd /tmp
mkdir build
mkdir /opt/libs/gtest
cd build
cmake /usr/src/googletest
make && sudo make install
cd && rm -rf /tmp/build

Now you have a development system ready and there are plenty of examples out there. You can start with the nVidia Samples, OpenCV, and Boost

Happy coding!


List of references presented on this post: