Need help building OpenCV with CUDA for Jetson Nano

Hi,
I’m just getting started with a Jetson Nano, although I have some experience optimizing code to use multi CPU and cuda cores on a GTX1060 graphics card.
So it seems I need to build OpenCV for CUDA, when I look at jtop output it shows an OpenCV version of 4.1.1 with CUDA NO

but when I run a simple python script(shown below) it says Version 3.2.0, so which is it?

import cv2
print(f"OpenCV Version: {cv2.version}")
OpenCV Version: 3.2.0

If I go with 4.1.1 then it appears I should follow this(I guess Tegra is right):

Any suggestions on how to proceed would be appreciated!
Dan

Hi,

jtop captures the C++ OpenCV version so it can be different from the Python OpenCV version.
We also have an auto script for installing GPU-enabled OpenCV for your reference:

Thanks.

1 Like

Hi,
Thanks for your good answer,
Sorry for the slow reply, I was on something else for a few days.

I ended up finding a script from mdegans: nano_build_opencv, this would fail after 1/2 hour,
then found the info to know I had to edit these 2 build flags:
CUDNN_VERSION=‘8.2’ (my actual version is 8.2.1.32 but assume 8.2 will work)
CUDA_ARCH=5.3 (this if for Jetson nano)

and the build seemed to complete successfully after about 5 hours and seemed to install ok.
Now jtop shows: OpenCV version of 4.1.1 with CUDA YES

I will now try to test it to see that OpenCV does in fact work.
Any tips on a good way to do that would be welcomed!
Thanks,
Dan

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.