OpenCV build with CUDA Support Error

I tried to build opencv 4.5.5 with OpenCV build script for Tegra from here: GitHub - mdegans/nano_build_opencv: Build OpenCV on Nvidia Jetson Nano

At the end, the error below showed:
In file included from /tmp/build_opencv/opencv/build/modules/python_bindings_generator/pyopencv_generated_include.h:90:0,
from /tmp/build_opencv/opencv/modules/python/src2/cv2.cpp:11:
/tmp/build_opencv/opencv_contrib/modules/cudafeatures2d/include/opencv2/cudafeatures2d.hpp:121:26: warning: ‘virtual void cv::cuda::DescriptorMatcher::clear()’ can be marked override [-Wsuggest-override]
CV_WRAP virtual void clear() = 0;
/tmp/build_opencv/opencv_contrib/modules/cudafeatures2d/include/opencv2/cudafeatures2d.hpp:125:26: warning: ‘virtual bool cv::cuda::DescriptorMatcher::empty() const’ can be marked override [-Wsuggest-override]
CV_WRAP virtual bool empty() const = 0;
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
modules/python2/CMakeFiles/opencv_python2.dir/build.make:62: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir//src2/cv2.cpp.o’ failed
make[2]: *** [modules/python2/CMakeFiles/opencv_python2.dir/
/src2/cv2.cpp.o] Error 4
CMakeFiles/Makefile2:7027: recipe for target ‘modules/python2/CMakeFiles/opencv_python2.dir/all’ failed
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
Makefile:162: recipe for target ‘all’ failed
make: *** [all] Error 2

What can I do to proceed?

Hi @Jazzztin, this error means that your system ran out of memory - you should mount additional SWAP memory, like shown here:

Also, I have tarballs of the pre-built OpenCV packages with CUDA enabled (basically the output from this script) that you can download from here for JetPack 4:

1 Like

Thank you very much, after using swapfile, I have installed OpenCV 4.8.0 with CUDA support successfully.

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