Hello,
I have a software I have written and profiled and now it's time for me to move some of the hot spots to the GPU. My previous installation of opencv was not build with CUDA, so I uninstalled it and obtained the 3.3.0 source. This is on linux.
I have an NVIDIA Quadro M1200 with Cuda 8.0.
$ nvidia-smi Wed Sep 27 08:54:18 2017 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 384.69 Driver Version: 384.69 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 Quadro M1200 Off | 00000000:01:00.0 Off | N/A | | N/A 46C P8 N/A / N/A | 1145MiB / 4042MiB | 18% Default | +-------------------------------+----------------------+----------------------+
$ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Tue_Jan_10_13:22:03_CST_2017 Cuda compilation tools, release 8.0, V8.0.61
I have cuda-8.0 installed at /usr/local/cuda-8.0 with a symbolic link to it from /usr/local/cuda
I invoked cmake with the following arguments:
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON -D -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=ON -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
And the output of cmake shows that CUDA is unavailable:
-- Use Cuda: NO
What can I do to get opencv 3.3.0 building with gpu support? Thank you.
Full output of cmake below, although I don't see anything telling.
-- Detected version of GNU GCC: 54 (504) -- Looking for ccache - not found -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") -- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so -- Checking for module 'gstreamer-base-1.0' -- No package 'gstreamer-base-1.0' found -- Checking for module 'gstreamer-video-1.0' -- No package 'gstreamer-video-1.0' found -- Checking for module 'gstreamer-app-1.0' -- No package 'gstreamer-app-1.0' found -- Checking for module 'gstreamer-riff-1.0' -- No package 'gstreamer-riff-1.0' found -- Checking for module 'gstreamer-pbutils-1.0' -- No package 'gstreamer-pbutils-1.0' found -- Checking for module 'gstreamer-base-0.10' -- No package 'gstreamer-base-0.10' found -- Checking for module 'gstreamer-video-0.10' -- No package 'gstreamer-video-0.10' found -- Checking for module 'gstreamer-app-0.10' -- No package 'gstreamer-app-0.10' found -- Checking for module 'gstreamer-riff-0.10' -- No package 'gstreamer-riff-0.10' found -- Checking for module 'gstreamer-pbutils-0.10' -- No package 'gstreamer-pbutils-0.10' found -- Looking for linux/videodev.h -- Looking for linux/videodev.h - not found -- Looking for linux/videodev2.h -- Looking for linux/videodev2.h - found -- Looking for sys/videoio.h -- Looking for sys/videoio.h - not found -- Checking for module 'libavresample' -- No package 'libavresample' found -- Checking for module 'libgphoto2' -- No package 'libgphoto2' found -- Found TBB: /usr/lib/x86_64-linux-gnu/libtbb.so -- found Intel IPP (ICV version): 2017.0.2 [2017.0.2] -- at: /home/mfisher/opencv-3.3.0/build/3rdparty/ippicv/ippicv_lnx -- found Intel IPP IW binaries: 2017.0.2 -- at: /home/mfisher/opencv-3.3.0/build/3rdparty/ippicv/ippicv_lnx/../ippiw_lnx/ -- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off -- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off -- Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY) -- A library with BLAS API not found. Please specify library location. -- LAPACK requires BLAS -- A library with LAPACK API not found. Please specify library location. -- Found apache ant 1.9.6: /usr/bin/ant -- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) -- The imported target "vtkRenderingPythonTkWidgets" references the file "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and contained "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake" but not all the files it references. -- The imported target "vtk" references the file "/usr/bin/vtk" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and contained "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake" but not all the files it references. -- Found VTK ver. 6.2.0 (usefile: /usr/lib/cmake/vtk-6.2/UseVTK.cmake) -- Excluding from source files list: /home/mfisher/opencv-3.3.0/build/modules/imgproc/accum.neon.cpp -- Torch importer has been enabled. To run the tests you have to install Torch ('th' executable should be available) and generate testdata using opencv_extra/testdata/dnn/generate_torch_models.py script. -- -- General configuration for OpenCV 3.3.0 ===================================== -- Version control: unknown -- -- Platform: -- Timestamp: 2017-09-27T14:13:00Z -- Host: Linux 4.13.0-041300-generic x86_64 -- CMake: 3.5.1 -- CMake generator: Unix Makefiles -- CMake build tool: /usr/bin/make -- Configuration: RELEASE -- -- CPU/HW features: -- Baseline: SSE SSE2 SSE3 -- requested: SSE3 -- Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 -- requested: SSE4_1 SSE4_2 AVX FP16 AVX2 -- SSE4_1 (2 files): + SSSE3 SSE4_1 -- SSE4_2 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 -- FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX -- AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX -- AVX2 (7 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 -- -- C/C++: -- Built as dynamic libs?: YES -- C++ Compiler: /usr/bin/c++ (ver 5.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 -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -msse -msse2 -msse3 -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 -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -msse -msse2 -msse3 -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-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -msse -msse2 -msse3 -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-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG -- Linker flags (Release): -- Linker flags (Debug): -- ccache: NO -- Precompiled headers: YES -- Extra dependencies: Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent Qt5::OpenGL /usr/lib/x86_64-linux-gnu/libwebp.so /usr/lib/x86_64-linux-gnu/libjasper.so /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so dc1394 avcodec-ffmpeg avformat-ffmpeg avutil-ffmpeg swscale-ffmpeg vtkRenderingOpenGL vtkImagingHybrid vtkIOImage vtkCommonDataModel vtkCommonMath vtkCommonCore vtksys vtkCommonMisc vtkCommonSystem vtkCommonTransforms vtkCommonExecutionModel vtkDICOMParser vtkIOCore /usr/lib/x86_64-linux-gnu/libz.so vtkmetaio /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libtiff.so vtkImagingCore vtkRenderingCore vtkCommonColor vtkFiltersExtraction vtkFiltersCore vtkFiltersGeneral vtkCommonComputationalGeometry vtkFiltersStatistics vtkImagingFourier vtkalglib vtkFiltersGeometry vtkFiltersSources vtkInteractionStyle vtkRenderingLOD vtkFiltersModeling vtkIOPLY vtkIOGeometry /usr/lib/x86_64-linux-gnu/libjsoncpp.so vtkFiltersTexture vtkRenderingFreeType /usr/lib/x86_64-linux-gnu/libfreetype.so vtkftgl vtkIOExport vtkRenderingAnnotation vtkImagingColor vtkRenderingContext2D vtkRenderingGL2PS vtkRenderingContextOpenGL /usr/lib/libgl2ps.so vtkRenderingLabel dl m pthread rt /usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libtbb.so -- 3rdparty dependencies: -- -- OpenCV modules: -- To be built: core flann imgproc ml objdetect photo video viz dnn imgcodecs shape videoio highgui superres ts features2d calib3d java stitching videostab python2 python3 -- Disabled: world -- Disabled by dependency: - -- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev -- -- GUI: -- QT 5.x: YES (ver 5.5.1) -- QT OpenGL support: YES (Qt5::OpenGL 5.5.1) -- OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so) -- VTK support: YES (ver 6.2.0) -- -- Media I/O: -- ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8) -- JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver ) -- WEBP: /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x0202) -- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.54) -- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.6) -- JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1) -- OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 2.2.0) -- GDAL: NO -- GDCM: NO -- -- Video I/O: -- DC1394 1.x: NO -- DC1394 2.x: YES (ver 2.2.4) -- FFMPEG: YES -- avcodec: YES (ver 56.60.100) -- avformat: YES (ver 56.40.101) -- avutil: YES (ver 54.31.100) -- swscale: YES (ver 3.1.101) -- avresample: NO -- GStreamer: NO -- OpenNI: NO -- OpenNI PrimeSensor Modules: NO -- OpenNI2: NO -- PvAPI: NO -- GigEVisionSDK: NO -- Aravis SDK: NO -- UniCap: NO -- UniCap ucil: NO -- V4L/V4L2: NO/YES -- XIMEA: NO -- Xine: NO -- Intel Media SDK: NO -- gPhoto2: NO -- -- Parallel framework: TBB (ver 4.4 interface 9002) -- -- Trace: YES (with Intel ITT) -- -- Other third-party libraries: -- Use Intel IPP: 2017.0.2 [2017.0.2] -- at: /home/mfisher/opencv-3.3.0/build/3rdparty/ippicv/ippicv_lnx -- Use Intel IPP IW: prebuilt binaries (2017.0.2) -- Use Intel IPP Async: NO -- Use VA: NO -- Use Intel VA-API/OpenCL: NO -- Use Lapack: NO -- Use Eigen: YES (ver 3.2.92) -- Use Cuda: NO -- Use OpenCL: YES -- Use OpenVX: NO -- Use custom HAL: NO -- -- OpenCL: <dynamic loading="" of="" opencl="" library=""> -- Include path: /home/mfisher/opencv-3.3.0/3rdparty/include/opencl/1.2 -- Use AMDFFT: NO -- Use AMDBLAS: NO -- -- Python 2: -- Interpreter: /usr/bin/python2.7 (ver 2.7.12) -- Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.12) -- numpy: /home/mfisher/.local/lib/python2.7/site-packages/numpy/core/include (ver 1.13.1) -- packages path: lib/python2.7/dist-packages -- -- Python 3: -- Interpreter: /usr/bin/python3 (ver 3.5.2) -- Libraries: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (ver 3.5.2) -- numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.11.0) -- packages path: lib/python3.5/dist-packages -- -- Python (for build): /usr/bin/python2.7 -- -- Java: -- ant: /usr/bin/ant (ver 1.9.6) -- JNI: /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include/linux /usr/lib/jvm/default-java/include -- Java wrappers: YES -- Java tests: YES -- -- Matlab: Matlab not found or implicitly disabled -- -- Documentation: -- Doxygen: /usr/bin/doxygen (ver 1.8.11) -- -- Tests and samples: -- Tests: YES -- Performance tests: YES -- C/C++ Examples: NO -- -- Install path: /usr/local -- -- cvconfig.h is in: /home/mfisher/opencv-3.3.0/build -- ----------------------------------------------------------------- -- -- Configuring done -- Generating done -- Build files have been written to: /home/mfisher/opencv-3.3.0/build