OPENCV在Ubuntu上的CUDA支持中失败
opencv make fails with CUDA support on Ubuntu
我正在尝试在ubuntu 15.10上使用CUDA支持构建OPENCV。Cmake显示有CUDA 7.5可用。Cmake成功。当我运行命令时,我将获得以下输出:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jishnu/Downloads/opencv-2.4.13/Release
[ 5%] Built target IlmImf
[ 6%] Built target opencv_core_pch_dephelp
[ 6%] Built target pch_Generate_opencv_core
[ 8%] Built target opencv_core
[ 9%] Built target opencv_ts_pch_dephelp
[ 9%] Built target pch_Generate_opencv_ts
[ 9%] Built target opencv_imgproc_pch_dephelp
[ 9%] Built target pch_Generate_opencv_imgproc
[ 12%] Built target opencv_imgproc
[ 12%] Built target opencv_flann_pch_dephelp
[ 12%] Built target pch_Generate_opencv_flann
[ 12%] Built target opencv_flann
[ 12%] Built target opencv_highgui_pch_dephelp
[ 13%] Built target pch_Generate_opencv_highgui
[ 15%] Built target opencv_highgui
[ 15%] Built target opencv_features2d_pch_dephelp
[ 15%] Built target pch_Generate_opencv_features2d
[ 16%] Built target opencv_features2d
[ 16%] Built target opencv_calib3d_pch_dephelp
[ 16%] Built target pch_Generate_opencv_calib3d
[ 18%] Built target opencv_calib3d
[ 19%] Built target opencv_video_pch_dephelp
[ 19%] Built target pch_Generate_opencv_video
[ 19%] Built target opencv_video
[ 19%] Built target opencv_ts
[ 19%] Built target opencv_perf_core_pch_dephelp
[ 19%] Built target pch_Generate_opencv_perf_core
[ 21%] Built target opencv_perf_core
[ 21%] Built target opencv_test_core_pch_dephelp
[ 21%] Built target pch_Generate_opencv_test_core
[ 22%] Built target opencv_test_core
[ 22%] Built target opencv_test_flann_pch_dephelp
[ 22%] Built target pch_Generate_opencv_test_flann
[ 23%] Built target opencv_test_flann
[ 24%] Built target opencv_perf_imgproc_pch_dephelp
[ 24%] Built target pch_Generate_opencv_perf_imgproc
[ 25%] Built target opencv_perf_imgproc
[ 25%] Built target opencv_test_imgproc_pch_dephelp
[ 25%] Built target pch_Generate_opencv_test_imgproc
[ 27%] Built target opencv_test_imgproc
[ 27%] Built target opencv_perf_highgui_pch_dephelp
[ 27%] Built target pch_Generate_opencv_perf_highgui
[ 28%] Built target opencv_perf_highgui
[ 28%] Built target opencv_test_highgui_pch_dephelp
[ 28%] Built target pch_Generate_opencv_test_highgui
[ 29%] Built target opencv_test_highgui
[ 29%] Built target opencv_perf_features2d_pch_dephelp
[ 29%] Built target pch_Generate_opencv_perf_features2d
[ 29%] Built target opencv_perf_features2d
[ 29%] Built target opencv_test_features2d_pch_dephelp
[ 30%] Built target pch_Generate_opencv_test_features2d
[ 31%] Built target opencv_test_features2d
[ 31%] Built target opencv_perf_calib3d_pch_dephelp
[ 31%] Built target pch_Generate_opencv_perf_calib3d
[ 31%] Built target opencv_perf_calib3d
[ 31%] Built target opencv_test_calib3d_pch_dephelp
[ 31%] Built target pch_Generate_opencv_test_calib3d
[ 33%] Built target opencv_test_calib3d
[ 33%] Built target opencv_ml_pch_dephelp
[ 33%] Built target pch_Generate_opencv_ml
[ 34%] Built target opencv_ml
[ 34%] Built target opencv_test_ml_pch_dephelp
[ 35%] Built target pch_Generate_opencv_test_ml
[ 36%] Built target opencv_test_ml
[ 36%] Built target opencv_perf_video_pch_dephelp
[ 37%] Built target pch_Generate_opencv_perf_video
[ 38%] Built target opencv_perf_video
[ 38%] Built target opencv_test_video_pch_dephelp
[ 39%] Built target pch_Generate_opencv_test_video
[ 40%] Built target opencv_test_video
[ 40%] Built target opencv_legacy_pch_dephelp
[ 40%] Built target pch_Generate_opencv_legacy
[ 47%] Built target opencv_legacy
[ 47%] Built target opencv_test_legacy_pch_dephelp
[ 47%] Built target pch_Generate_opencv_test_legacy
[ 47%] Built target opencv_test_legacy
[ 47%] Built target opencv_objdetect_pch_dephelp
[ 47%] Built target pch_Generate_opencv_objdetect
[ 48%] Built target opencv_objdetect
[ 48%] Built target opencv_perf_objdetect_pch_dephelp
[ 48%] Built target pch_Generate_opencv_perf_objdetect
[ 48%] Built target opencv_perf_objdetect
[ 48%] Built target opencv_test_objdetect_pch_dephelp
[ 48%] Built target pch_Generate_opencv_test_objdetect
[ 48%] Built target opencv_test_objdetect
[ 48%] Built target opencv_photo_pch_dephelp
[ 48%] Built target pch_Generate_opencv_photo
[ 48%] Built target opencv_photo
[ 48%] Built target opencv_perf_photo_pch_dephelp
[ 48%] Built target pch_Generate_opencv_perf_photo
[ 49%] Built target opencv_perf_photo
[ 49%] Built target opencv_test_photo_pch_dephelp
[ 49%] Built target pch_Generate_opencv_test_photo
[ 50%] Built target opencv_test_photo
[ 50%] Built target opencv_gpu_pch_dephelp
[ 50%] Built target pch_Generate_opencv_gpu
Linking CXX shared library ../../lib/libopencv_gpu.so
[ 61%] Built target opencv_gpu
[ 61%] Built target opencv_perf_gpu_pch_dephelp
[ 61%] Built target pch_Generate_opencv_perf_gpu
Linking CXX executable ../../bin/opencv_perf_gpu
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `ncvHaarGetClassifierSize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int&, unsigned int&, unsigned int&)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Ballard_Pos_findPosInHist_gpu(cv::gpu::PtrStepSz<int>, float4*, int3*, int, float, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::buildRTable_gpu(unsigned int const*, float const*, int, cv::gpu::PtrStepSz<short2>, int*, short2, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Guil_Full_calcPHist_gpu(int const*, int const*, cv::gpu::PtrStepSz<int>, float, float, float, float, int, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Ballard_PosRotation_calcHist_gpu(unsigned int const*, float const*, int, cv::gpu::PtrStepSz<short2>, int const*, cv::gpu::PtrStep<int>, int, int, float, float, int, float, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Guil_Full_buildImageFeatureList_gpu(unsigned int const*, float const*, int, int*, int, float, float, int, float2, float)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `int cv::gpu::device::hough::buildEdgePointList_gpu<float>(cv::gpu::PtrStepSz<unsigned char>, cv::gpu::PtrStepSz<unsigned char>, cv::gpu::PtrStepSz<unsigned char>, unsigned int*, float*)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `ncvDebugOutput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Guil_Full_calcSHist_gpu(int const*, int const*, int*, float, float, float, float, float, int, int, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Ballard_PosScale_findPosInHist_gpu(cv::gpu::PtrStep<int>, int, int, int, float4*, int3*, int, float, float, float, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `int cv::gpu::device::hough::buildEdgePointList_gpu<int>(cv::gpu::PtrStepSz<unsigned char>, cv::gpu::PtrStepSz<unsigned char>, cv::gpu::PtrStepSz<unsigned char>, unsigned int*, float*)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Ballard_PosRotation_findPosInHist_gpu(cv::gpu::PtrStep<int>, int, int, int, float4*, int3*, int, float, float, float, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Guil_Full_setImageFeatures(cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `int cv::gpu::device::hough::buildEdgePointList_gpu<short>(cv::gpu::PtrStepSz<unsigned char>, cv::gpu::PtrStepSz<unsigned char>, cv::gpu::PtrStepSz<unsigned char>, unsigned int*, float*)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Guil_Full_findPosInHist_gpu(cv::gpu::PtrStepSz<int>, float4*, int3*, int, int, float, int, float, int, float, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `ncvSetDebugOutputHandler(void (*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Ballard_Pos_calcHist_gpu(unsigned int const*, float const*, int, cv::gpu::PtrStepSz<short2>, int const*, cv::gpu::PtrStepSz<int>, float, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Guil_Full_setTemplFeatures(cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>, cv::gpu::PtrStep<unsigned char>)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `loadFromXML(std::string const&, HaarClassifierCascadeDescriptor&, std::vector<HaarStage64, std::allocator<HaarStage64> >&, std::vector<HaarClassifierNode128, std::allocator<HaarClassifierNode128> >&, std::vector<HaarFeature64, std::allocator<HaarFeature64> >&)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Guil_Full_calcOHist_gpu(int const*, int const*, int*, float, float, float, int, int, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Guil_Full_buildTemplFeatureList_gpu(unsigned int const*, float const*, int, int*, int, float, float, int, float2, float)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `cv::gpu::device::hough::GHT_Ballard_PosScale_calcHist_gpu(unsigned int const*, float const*, int, cv::gpu::PtrStepSz<short2>, int const*, cv::gpu::PtrStep<int>, int, int, float, float, int, float, int)'
../../lib/libopencv_gpu.so.2.4.13: undefined reference to `ncvHaarLoadFromFile_host(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, HaarClassifierCascadeDescriptor&, NCVVector<HaarStage64>&, NCVVector<HaarClassifierNode128>&, NCVVector<HaarFeature64>&)'
collect2: error: ld returned 1 exit status
modules/gpu/CMakeFiles/opencv_perf_gpu.dir/build.make:364: recipe for target 'bin/opencv_perf_gpu' failed
make[2]: *** [bin/opencv_perf_gpu] Error 1
CMakeFiles/Makefile2:4453: recipe for target 'modules/gpu/CMakeFiles/opencv_perf_gpu.dir/all' failed
make[1]: *** [modules/gpu/CMakeFiles/opencv_perf_gpu.dir/all] Error 2
Makefile:146: recipe for target 'all' failed
make: *** [all] Error 2
我较早时就建立了没有CUDA支持的OpenCV,而且效果很好。
这可能是由于GPU设备与库的兼容性问题所致。您可以指定您正在使用的GPU设备以及是物理设备还是模拟?
解决它检查您的CMAKE GCC和G 版本需要相同的版本
相关文章:
- 如果没有malloc,链表实现将失败
- 模板参数替换失败,并且未完成隐式转换
- 具有默认模板参数的多态类的模板推导失败
- 编译时未启用intel oneApi CUDA支持
- POCO::PostgreSQL:如何将std::vector支持添加到`Binder::bind`
- 使用CMake检测支持的C++标准
- 视图中的参数推导失败:take_while
- 为什么istream不支持右值提取
- 链接到自行创建的dll失败
- 带有特殊路径部分的"std::filesystem::weakly_canonical"失败
- GetShortPathName在网络驱动器上使用中文文件夹时失败
- gcc和c++17的过载解析失败
- 为什么使用 P/Invoke 调用 dll 时,某些计算机中的 LoadLibrary 失败?
- 在WSL:configure_file上对config_file的每次调用都失败:配置文件时出现问题
- 当我编译webrtc服务器时,Windows上只支持clang-cl
- 构建音频分析库Essentia在Gaia支持下失败了
- OPENCV在Ubuntu上的CUDA支持中失败
- getaddrinfo 失败,出现错误:C++ 中不支持ai_socktype服务名称
- ./configure错误:针对libxcb和支持库进行链接的测试失败
- 测试仅在travis-ci上失败;不支持RTTI