Ask Your Question

Revision history [back]

Issues compiling opencv-3.4.8 with cuda-10.2 in Ubuntu

Did anyone successfully compile opencv-3.4.x successfully with cuda 10.2?

It seems that cudu 10.2 has made some changes that breaks the opencv compilations.

**System description:**
OS: Ubuntu 18.04 LTS
Platform: Nvidia Drive AGX
CPU: aarch64
Cuda: 10.2
Cmake: 3.16.3

cmake command:

cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_PNG=OFF \
-DBUILD_TIFF=OFF \
-DBUILD_TBB=OFF \
-DBUILD_JPEG=OFF \
-DBUILD_JASPER=OFF \
-DBUILD_ZLIB=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_opencv_java=OFF \
-DBUILD_opencv_python2=ON \
-DBUILD_opencv_python3=OFF \
-DENABLE_NEON=OFF \
-DWITH_OPENCL=OFF \
-DWITH_OPENMP=OFF \
-DWITH_FFMPEG=ON \
-DWITH_GSTREAMER=OFF \
-DWITH_GSTREAMER_0_10=OFF \
-DWITH_CUDA=ON \
-DWITH_GTK=ON \
-DWITH_VTK=OFF \
-DWITH_TBB=ON \
-DWITH_1394=OFF \
-DWITH_OPENEXR=OFF \
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
-DCUDA_ARCH_BIN=7.2 \
-DCUDA_ARCH_PTX=7.2 \
-DINSTALL_C_EXAMPLES=OFF \
-DINSTALL_TESTS=OFF \
-DCUDA_cufft_LIBRARY=/usr/local/cuda/lib64/libcufft.so.10 \
-DCUDA_nppc_LIBRARY=/usr/local/cuda/lib64/libnppc.so.10 \
-DCUDA_npps_LIBRARY=/usr/local/cuda/lib64/libnpps.so.10 \
-DCUDA_nppial_LIBRARY=/usr/local/cuda/lib64/libnppial.so.10 \
-DCUDA_nppicc_LIBRARY=/usr/local/cuda/lib64/libnppicc.so.10 \
-DCUDA_nppicom_LIBRARY=/usr/local/cuda/lib64/libnppicom.so.10 \
-DCUDA_nppidei_LIBRARY=/usr/local/cuda/lib64/libnppidei.so.10 \
-DCUDA_nppif_LIBRARY=/usr/local/cuda/lib64/libnppif.so.10 \
-DCUDA_nppig_LIBRARY=/usr/local/cuda/lib64/libnppig.so.10 \
-DCUDA_nppim_LIBRARY=/usr/local/cuda/lib64/libnppim.so.10 \
-DCUDA_nppist_LIBRARY=/usr/local/cuda/lib64/libnppist.so.10 \
-DCUDA_nppisu_LIBRARY=/usr/local/cuda/lib64/libnppisu.so.10 \
-DCUDA_nppitc_LIBRARY=/usr/local/cuda/lib64/libnppitc.so.10 \
..

Output from console:

-- General configuration for OpenCV 3.4.8 =====================================
--   Version control:               unknown
-- 
--   Platform:
--     Timestamp:                   2020-01-30T02:15:35Z
--     Host:                        Linux 4.14.102-rt53-tegra aarch64
--     CMake:                       3.16.3
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               Release
-- 
--   CPU/HW features:
--     Baseline:
--       requested:                 NEON FP16
--       disabled:                  VFPV3 NEON
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++11:                       YES
--     C++ Compiler:                /usr/bin/c++  (ver 7.4.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--gc-sections  
--     Linker flags (Debug):        -Wl,--gc-sections  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          m pthread cudart_static -lpthread dl rt nppc npps cublas cufft -L/usr/local/cuda/lib64 -L/usr/lib/aarch64-linux-gnu
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 calib3d core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev dnn features2d flann highgui imgcodecs imgproc ml objdetect photo python2 shape stitching superres ts video videoio videostab
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 java js python3 viz
--     Applications:                tests perf_tests apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI: 
--     GTK+:                        YES (ver 2.24.32)
--       GThread :                  YES (ver 2.56.4)
--       GtkGlExt:                  NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
--     WEBP:                        build (ver encoder: 0x020e)
--     PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.34)
--     TIFF:                        /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.0.9)
--     JPEG 2000:                   build (ver 1.900.1)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
-- 
--   Video I/O:
--     FFMPEG:                      YES
--       avcodec:                   YES (ver 57.107.100)
--       avformat:                  YES (ver 57.83.100)
--       avutil:                    YES (ver 55.78.100)
--       swscale:                   YES (ver 4.8.100)
--       avresample:                YES (ver 3.7.0)
--     libv4l/libv4l2:              NO
--     v4l/v4l2:                    linux/videodev2.h
-- 
--   Parallel framework:            TBB (ver 2017.0 interface 9107)
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Lapack:                      NO
--     Eigen:                       YES (ver 3.3.4)
--     Custom HAL:                  YES (carotene (ver 0.0.1))
--     Protobuf:                    build (3.5.1)
-- 
--   NVIDIA CUDA:                   YES (ver 10.2, CUFFT CUBLAS)
--     NVIDIA GPU arch:             72
--     NVIDIA PTX archs:            72
-- 
--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.17)
--     Libraries:                   /usr/lib/aarch64-linux-gnu/libpython2.7.so (ver 2.7.17)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.13.3)
--     install path:                lib/python2.7/dist-packages/cv2/python-2.7
-- 
--   Python (for build):            /usr/bin/python2.7
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/opencv-3.4.8/build
[  0%] Built target gen-pkgconfig
[  0%] Built target quirc
[  3%] Built target libjasper
[  9%] Built target carotene_objs
[ 14%] Built target libwebp
[ 14%] Built target ittnotify
[ 14%] Built target gen_opencv_python_source
[ 15%] Built target tegra_hal
[ 20%] Built target libprotobuf
[ 21%] Built target opencv_cudev
[ 21%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.o
[ 21%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/alloc.cpp.o
[ 21%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/arithm.cpp.o
[ 21%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/arithm.dispatch.cpp.o
[ 21%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/async.cpp.o
[ 21%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o
In file included from /usr/local/opencv-3.4.8/modules/core/src/precomp.hpp:56:0,
                 from /usr/local/opencv-3.4.8/modules/core/src/arithm.cpp:50:
/usr/local/opencv-3.4.8/modules/core/include/opencv2/core/private.cuda.hpp:71:12: fatal error: npp.h: No such file or directory
 #  include <npp.h>
            ^~~~~~~
compilation terminated.
modules/core/CMakeFiles/opencv_core.dir/build.make:534: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/arithm.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/arithm.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /usr/local/opencv-3.4.8/modules/core/src/precomp.hpp:56:0,
                 from /usr/local/opencv-3.4.8/modules/core/src/algorithm.cpp:43:
/usr/local/opencv-3.4.8/modules/core/include/opencv2/core/private.cuda.hpp:71:12: fatal error: npp.h: No such file or directory
 #  include <npp.h>
            ^~~~~~~
compilation terminated.
modules/core/CMakeFiles/opencv_core.dir/build.make:508: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.o] Error 1
In file included from /usr/local/opencv-3.4.8/modules/core/src/precomp.hpp:56:0,
                 from /usr/local/opencv-3.4.8/modules/core/src/alloc.cpp:43:
/usr/local/opencv-3.4.8/modules/core/include/opencv2/core/private.cuda.hpp:71:12: fatal error: npp.h: No such file or directory
 #  include <npp.h>
            ^~~~~~~
compilation terminated.
modules/core/CMakeFiles/opencv_core.dir/build.make:521: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/alloc.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/alloc.cpp.o] Error 1
In file included from /usr/local/opencv-3.4.8/modules/core/src/precomp.hpp:56:0,
                 from /usr/local/opencv-3.4.8/modules/core/src/async.cpp:5:
/usr/local/opencv-3.4.8/modules/core/include/opencv2/core/private.cuda.hpp:71:12: fatal error: npp.h: No such file or directory
 #  include <npp.h>
            ^~~~~~~
compilation terminated.
modules/core/CMakeFiles/opencv_core.dir/build.make:573: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/async.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/async.cpp.o] Error 1
In file included from /usr/local/opencv-3.4.8/modules/core/src/precomp.hpp:56:0,
                 from /usr/local/opencv-3.4.8/modules/core/src/array.cpp:49:
/usr/local/opencv-3.4.8/modules/core/include/opencv2/core/private.cuda.hpp:71:12: fatal error: npp.h: No such file or directory
 #  include <npp.h>
            ^~~~~~~
compilation terminated.
modules/core/CMakeFiles/opencv_core.dir/build.make:560: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o] Error 1
In file included from /usr/local/opencv-3.4.8/modules/core/src/precomp.hpp:56:0,
                 from /usr/local/opencv-3.4.8/modules/core/src/arithm.dispatch.cpp:5:
/usr/local/opencv-3.4.8/modules/core/include/opencv2/core/private.cuda.hpp:71:12: fatal error: npp.h: No such file or directory
 #  include <npp.h>
            ^~~~~~~
compilation terminated.
modules/core/CMakeFiles/opencv_core.dir/build.make:547: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/arithm.dispatch.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/arithm.dispatch.cpp.o] Error 1
CMakeFiles/Makefile2:2736: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2