I have compiled opencv-4.1.2 from source using the following commands :
sudo cmake -D CMAKE_BUILD_TYPE=RELEASE
-D WITH_CUDA=ON
-D CUDA_ARCH_PTX=“”
-D CUDA_ARCH_BIN=“5.3,6.2,7.2”
-D WITH_CUBLAS=ON
-D OPENCV_DNN_CUDA=ON
-D ENABLE_FAST_MATH=1
-D CUDA_FAST_MATH=1
-D WITH_LIBV4L=ON
-D BUILD_opencv_python3=ON
-D BUILD_opencv_python2=OFF
-D BUILD_opencv_java=OFF
-D WITH_GSTREAMER=ON
-D WITH_GTK=ON
-D BUILD_TESTS=OFF
-D BUILD_PERF_TESTS=OFF
-D BUILD_EXAMPLES=OFF
-D OPENCV_ENABLE_NONFREE=ON
-D OPENCV_EXTRA_MODULES_PATH=/home/whoami/opencv_contrib/modules …
after installation when I run, print(cv2.cuda.getCudaEnabledDeviceCount()) in python3 I get the output 0, that is quite unusual. As the expected output is 1 to show the 1 cuda enabled device on the nano.