Ask Your Question
1

OpenCV 3.0 Build Error Cuda 8.0

asked 2016-06-09 01:51:31 -0500

theholyhades1 gravatar image

I've pulled the newest version of OpenCV (3.0?) from GitHub, as well as the additional opencv_modules. I'm attempting to build with the following build flags, but am getting an error. Does this error look like it's from the CUDA 8.0 Toolkit, or from OpenCV? Additionally, is there anything I can do to fix it?

Build:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/home/hades/Downloads/opencv/opencv_contrib/modules -D PYTHON3_EXECUTABLE=/usr/bin/python3 -D PYTHON_INCLUDE_DIR=/usr/include/python3.5 -D PYTHON_INCLUDE_DIR2=/usr/include/x86_64-linux-gnu/python3.5m -D PYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.5m.so -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.5/dist-packages/numpy/core/include -D WITH_TBB=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D CUDA_ARCH_BIN="5.0" -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF /home/hades/Downloads/opencv/opencv

Complete error text below. I think the important lines are as follows:

/usr/local/cuda-8.0/include/thrust/detail/reference.inl(127): error: no default constructor exists for class "thrust::detail::execute_with_allocator<cv::cuda::device::ThrustAllocator, thrust::system::cuda::detail::execute_on_stream_base>"

/usr/local/cuda-8.0/include/thrust/detail/reference.inl(98): error: no default constructor exists for class "thrust::detail::execute_with_allocator<cv::cuda::device::ThrustAllocator, thrust::system::cuda::detail::execute_on_stream_base>"

Full:

<snip>
[ 87%] Built target opencv_traincascade
[ 87%] Building CXX object modules/optflow/CMakeFiles/opencv_optflow.dir/src/sparsetodenseflow.cpp.o
[ 87%] Building CXX object modules/optflow/CMakeFiles/opencv_optflow.dir/src/optical_flow_io.cpp.o
[ 87%] Linking CXX shared library ../../lib/libopencv_ccalib.so
[ 87%] Building NVCC (Device) object modules/cudaimgproc/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_match_template.cu.o
[ 87%] Built target opencv_ccalib
[ 87%] Building NVCC (Device) object modules/cudaimgproc/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_bilateral_filter.cu.o
[ 87%] Building CXX object modules/optflow/CMakeFiles/opencv_optflow.dir/opencl_kernels_optflow.cpp.o
[ 87%] Building NVCC (Device) object modules/cudastereo/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_util.cu.o
[ 87%] Linking CXX shared library ../../lib/libopencv_optflow.so
[ 87%] Built target opencv_optflow
[ 87%] Building NVCC (Device) object modules/cudastereo/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_stereocsbp.cu.o
[ 87%] Building NVCC (Device) object modules/cudastereo/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_disparity_bilateral_filter.cu.o
[ 87%] Building NVCC (Device) object modules/cudaimgproc/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gftt.cu.o
[ 89%] Building NVCC (Device) object modules/cudaimgproc/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_clahe.cu.o
[ 89%] Building NVCC (Device) object modules/cudaimgproc/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_debayer.cu.o
/usr/local/cuda-8.0/include/thrust/detail/reference.inl(127): error: no default constructor exists for class "thrust::detail::execute_with_allocator<cv::cuda::device::ThrustAllocator, thrust::system::cuda::detail::execute_on_stream_base>"
          detected during:
            instantiation of "void thrust::reference<Element, Pointer, Derived>::assign_from(OtherPointer) [with Element=float2, Pointer=thrust::pointer<float2, thrust::detail::execute_with_allocator<cv::cuda::device::ThrustAllocator, thrust::system::cuda::detail::execute_on_stream_base>, thrust::use_default, thrust::use_default>, Derived=thrust::use_default, OtherPointer=const float2 *]" 
(65): here
            instantiation of "thrust::reference<Element, Pointer, Derived>::derived_type &thrust::reference<Element, Pointer, Derived>::operator=(const thrust::reference<Element, Pointer, Derived>::value_type &) [with Element=float2, Pointer=thrust::pointer ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-06-19 22:30:35 -0500

Had the same problem but building fine now. Apparently there is a bug with the Thrust version that comes with Cuda 8.0rc as you can see here if you go the the thrust Github and download the latest version and replace the files in your Cuda toolkit folder it builds fine.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2016-06-09 01:51:31 -0500

Seen: 2,383 times

Last updated: Jun 09 '16