Reputation: 11
I am using Ubuntu 14.04, to build opencv 3.1.0 with cuda 8.0.
the cmake command:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -DOPENCV_EXTRA_MODULES_PATH=/home/lindeyang/library/opencv_contrib/modules ..
After the cmake configuration, I begin to build, but failed with the problems: "Insufficient Cuda Runtime library version, please update it."
Can anyone help?
the errors:
[ 0%] Built target opencv_cudev
[ 0%] [ 0%] Built target opencv_ts_pch_dephelp
Building CXX object modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o
[ 2%] Built target libwebp
[ 2%] Built target opencv_imgproc_pch_dephelp
[ 2%] Built target opencv_imgcodecs_pch_dephelp
[ 2%] Built target opencv_videoio_pch_dephelp
[ 2%] Automoc for target opencv_highgui_pch_dephelp
[ 2%] Automoc for target opencv_highgui
[ 2%] Built target opencv_perf_core_pch_dephelp
[ 2%] Built target opencv_highgui_pch_dephelp_automoc
[ 2%] Built target opencv_highgui_automoc
[ 2%] Built target opencv_test_core_pch_dephelp
Scanning dependencies of target opencv_perf_cudaarithm_pch_dephelp
[ 2%] Scanning dependencies of target opencv_test_cudaarithm_pch_dephelp
Building CXX object modules/cudaarithm/CMakeFiles/opencv_cudaarithm_pch_dephelp.dir/opencv_cudaarithm_pch_dephelp.cxx.o
[ 2%] Building CXX object modules/cudaarithm/CMakeFiles/opencv_perf_cudaarithm_pch_dephelp.dir/opencv_perf_cudaarithm_pch_dephelp.cxx.o
[ 2%] Building CXX object modules/cudaarithm/CMakeFiles/opencv_test_cudaarithm_pch_dephelp.dir/opencv_test_cudaarithm_pch_dephelp.cxx.o
In file included from /home/lindeyang/library/opencv/modules/core/src/precomp.hpp:56:0,
from /home/lindeyang/library/opencv/build/modules/core/opencv_core_pch_dephelp.cxx:1:
/home/lindeyang/library/opencv/modules/core/include/opencv2/core/private.cuda.hpp:70:6: error: #error "Insufficient Cuda Runtime library version, please update it."
# error "Insufficient Cuda Runtime library version, please update it."
^
In file included from /home/lindeyang/library/opencv/modules/cudaarithm/src/precomp.hpp:53:0,
from /home/lindeyang/library/opencv/build/modules/cudaarithm/opencv_cudaarithm_pch_dephelp.cxx:1:
/home/lindeyang/library/opencv/modules/core/include/opencv2/core/private.cuda.hpp:70:6: error: #error "Insufficient Cuda Runtime library version, please update it."
# error "Insufficient Cuda Runtime library version, please update it."
^
make[2]: *** [modules/cudaarithm/CMakeFiles/opencv_cudaarithm_pch_dephelp.dir/opencv_cudaarithm_pch_dephelp.cxx.o] Error 1
make[1]: *** [modules/cudaarithm/CMakeFiles/opencv_cudaarithm_pch_dephelp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX static library ../../lib/libopencv_test_cudaarithm_pch_dephelp.a
[ 2%] Built target opencv_test_cudaarithm_pch_dephelp
Linking CXX static library ../../lib/libopencv_perf_cudaarithm_pch_dephelp.a
[ 2%] Built target opencv_perf_cudaarithm_pch_dephelp
make[2]: *** [modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/all] Error 2
make: *** [all] Error 2
images attached: [results for deviceQuery][1]
Upvotes: 1
Views: 440
Reputation: 91
Yu Lin Yang,
The problem is that you have multiple versions of CUDA installed. Probably when your last cuda version upgrade, some files from the another version still remain in your system.
Find the libs using the follow command:
dconfig -p | grep libcudart
This command show you the libcudart versions on your machine. But remove the older libs don't solve your problem.
The problem occurs in file: /opencv/modules/core/include/opencv2/core/private.cuda.hpp Because CUDART_VERSION is lower than the required (CUDART_MINIMUM_REQUIRED_VERSION).
Search on /usr/ for:
grep --include=\*.{c,cpp,h,hpp} -rnw '/usr/' -e "define CUDART_VERSION"
Probably you'll found the actual version in /usr/local/cuda/ and some include files in /usr/include/: in this file: /usr/include/cuda_runtime_api.h You found the wrong version.
I solve the problem, comparing the folders and overwriting the old cuda headers (/usr/include/) by the new (/usr/local/cuda/include/).
Another way is remove all versions using apt or the NVIDIA installer binary (*.run):
sudo apt-get remove --purge nvidia-*
But, you'll need reinstall all libraries again.
Upvotes: 1