Compile and Install OpenCV for Nvidia Nano

Spread the love

Update your Operating System

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade -y

Cleanup your unwanted files.

sudo apt autoremove

Download the Packages

Make sure you have pip3 installled.

sudo apt-get install python3-pip

Check current version of OpenCV

The jetpack image comes pre-installed with OpenCV. To check which version you have installed, enter the following command.

dpkg -l | grep libopencv

For more information on your OpenCV installation to check if Cuda is installed, follow these instructions and install jtop.

Remove existing OpenCV (Optional)

sudo pip3 uninstall opencv-python

Increase swap file

Reduce crashes while compiling and compile faster.

Follow the instructions in the link below, however use this command in ‘For example’.

git clone
cd resizeSwapMemory
./ -g 4
sudo reboot

Compile OpenCV using bash script.

Follow the link and follow the instructions OR go to the next section for our quick install guide.

For website instructions, please click the following link…

Enter these commands to Auto compile and install the latest version of OpenCV

Open the ‘System monitor’ to monitor CPU and swap file performance. The enter the following command lines to install and compile the most recent version of OpenCV.

git clone
cd buildOpenCV
./ |& tee openCV_build.log
sudo ldconfig -v

Check OpenCV installed.

python3 -c 'import cv2; print(cv2.__version__)'

Check OpenCV is installed for Cuda.

Follow the instruction in the link below to install ‘jtop” and see Cuda performance and statistics.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.