opencv - 使用 Cuda7.5 ffmpeg(最新)问题 OpenSUSE 13.2 编译 OpenCV3

标签 opencv cuda ffmpeg

我正在使用 OpenSUSE 13.2-X86-64 和 Geforce 940M GPU。我想在 Qt5 IDE 上使用它。
为此,我使用 cudazone 中的 Cuda7.5 工具包 rpm 安装了我的 GPU 驱动程序。一切都差不多好了。
它检测我所做的一切并执行了几个 cuda 样本。

作为下一步,我已经使用 nvenc 和其他库(如 Xvid 和许多其他库)安装了当前的 FFmpeg 版本
其他有用的东西在这里列出来太多了。之后我下载了当前的
OpenCV-3.0.0 源代码并运行 cmake-gui,我在其中添加了 cuda、ffmpeg、Qt5 等并制作了它。

在制作 session (make -j4)的不同点上,我从控制台中得到了这种错误(多重定义的列表
错误要长得多)。这是第一个。

.
.
.
.
.
.
nvlink error   : Multiple definition of '_ZN2cv5cudev16color_cvt_detail15c_HlsSectorDataE' in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_arithm_func.cu.o', first defined in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_lut.cu.o'
nvlink error   : Multiple definition of '_ZN2cv5cudev16color_cvt_detail16c_sRGBGammaTab_bE' in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_arithm_func.cu.o', first defined in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_lut.cu.o'
nvlink error   : Multiple definition of '_ZN2cv5cudev16color_cvt_detail14c_sRGBGammaTabE' in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_arithm_func.cu.o', first defined in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_lut.cu.o'
nvlink error   : Multiple definition of '_ZN2cv5cudev16color_cvt_detail17c_sRGBInvGammaTabE' in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_arithm_func.cu.o', first defined in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_lut.cu.o'
nvlink error   : Multiple definition of '_ZN2cv5cudev16color_cvt_detail12c_LabCbrtTabE' in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_arithm_func.cu.o', first defined in '/home/peter/Programme/opencv/build/modules/cudev/test/CMakeFiles/opencv_test_cudev.dir//./opencv_test_cudev_generated_test_lut.cu.o'
modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/build.make:5302: recipe for target 'modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/./opencv_test_cudev_intermediate_link.o' failed
make[2]: *** [modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/./opencv_test_cudev_intermediate_link.o] Error 255
CMakeFiles/Makefile2:1182: recipe for target 'modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/all' failed
make[1]: *** [modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

我不知道如何解决这个问题。

谢谢!

编辑:添加了 cmake 配置
~/Programme/opencv/build> cmake /home/peter/Programme/opencv-3.0.0
CMake Error: The source "/home/peter/Programme/opencv-3.0.0/CMakeLists.txt" does not match the source "/home/peter/Programme/opencv/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.
peter@linux-3mgc:~/Programme/opencv/build> cmake /home/peter/Programme/opencv
-- Detected version of GNU GCC: 48 (408)
-- Found ZLIB: /usr/lib64/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") 
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8") 
-- checking for module 'gstreamer-video-0.10'
--   package 'gstreamer-video-0.10' not found
-- checking for module 'gstreamer-app-0.10'
--   package 'gstreamer-app-0.10' not found
-- checking for module 'gstreamer-riff-0.10'
--   package 'gstreamer-riff-0.10' not found
-- checking for module 'gstreamer-pbutils-0.10'
--   package 'gstreamer-pbutils-0.10' not 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'
--   package 'libavresample' not found
-- Looking for libavformat/avformat.h 
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- found IPP (ICV version): 8.2.1 [8.2.1]
-- at: /home/peter/Programme/opencv/3rdparty/ippicv/unpack/ippicv_lnx
-- CUDA detected: 7.5
-- CUDA NVCC target flags: -gencode;arch=compute_50,code=sm_50
-- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.8", minimum required is "2.7") 
-- Found PythonLibs: /usr/lib64/libpython2.7.so (found suitable exact version "2.7.8") 
-- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4.1", minimum required is "3.4") 
-- Found PythonLibs: /usr/lib64/libpython3.4m.so (found suitable exact version "3.4.1") 
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named 'numpy'
-- Found apache ant 1.8.0: /usr/bin/ant
-- Could NOT find JNI (missing:  JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
-- 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) 
-- VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.6.1.0 + Qt4
-- 
-- General configuration for OpenCV 3.0.0-dev =====================================
--   Version control:               3.0.0-528-g3a3f403-dirty
-- 
--   Platform:
--     Host:                        Linux 3.16.7-24-desktop x86_64
--     CMake:                       3.0.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/gmake
--     Configuration:               Release
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                /usr/bin/c++  (ver 4.8.3)
--     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 -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -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 -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -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 -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fopenmp -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 -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fopenmp -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      
--     Linker flags (Debug):        
--     Precompiled headers:         YES
--     Extra dependencies:          /usr/lib64/libcuda.so /usr/lib64/libnvcuvid.so Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent Qt5::OpenGL /usr/lib64/libwebp.so /usr/lib64/libpng.so /usr/lib64/libz.so /usr/lib64/libtiff.so /usr/lib64/libjasper.so /usr/lib64/libjpeg.so gstbase-0.10 gstreamer-0.10 gobject-2.0 gmodule-2.0 gthread-2.0 xml2 ucil glib-2.0 unicap dc1394 xine v4l1 v4l2 avcodec avformat avutil swscale gphoto2 gphoto2_port exif /usr/lib64/libbz2.so dl m pthread rt /usr/lib64/libGLU.so /usr/lib64/libGL.so /usr/lib64/libSM.so /usr/lib64/libICE.so /usr/lib64/libX11.so /usr/lib64/libXext.so cudart nppc nppi npps cublas cufft
--     3rdparty dependencies:       IlmImf ippicv
-- 
--   OpenCV modules:
--     To be built:                 cudev hal core cudaarithm flann imgproc ml video cudabgsegm cudafilters cudaimgproc cudawarping imgcodecs photo shape videoio cudacodec highgui objdetect ts features2d calib3d cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo stitching superres videostab python2
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 java python3 viz
-- 
--   GUI: 
--     QT 5.x:                      YES (ver 5.4.2)
--     QT OpenGL support:           YES (Qt5::OpenGL 5.4.2)
--     OpenGL support:              YES (/usr/lib64/libGLU.so /usr/lib64/libGL.so /usr/lib64/libSM.so /usr/lib64/libICE.so /usr/lib64/libX11.so /usr/lib64/libXext.so)
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib64/libz.so (ver 1.2.8)
--     JPEG:                        /usr/lib64/libjpeg.so (ver )
--     WEBP:                        /usr/lib64/libwebp.so (ver encoder: 0x0202)
--     PNG:                         /usr/lib64/libpng.so (ver 1.2.51)
--     TIFF:                        /usr/lib64/libtiff.so (ver 42 - 4.0.4)
--     JPEG 2000:                   /usr/lib64/libjasper.so (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
--     GDAL:                        NO
-- 
--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  YES (ver 2.2.2)
--     FFMPEG:                      YES
--       codec:                     YES (ver 57.3.100)
--       format:                    YES (ver 57.2.100)
--       util:                      YES (ver 55.2.100)
--       swscale:                   YES (ver 4.0.100)
--       resample:                  NO
--       gentoo-style:              YES
--     GStreamer:                   NO
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     OpenNI2:                     NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     UniCap:                      YES (ver 0.9.12)
--     UniCap ucil:                 YES (ver 0.9.10)
--     V4L/V4L2:                    Using libv4l1 (ver 1.2.1) / libv4l2 (ver 1.2.1)
--     XIMEA:                       NO
--     Xine:                        YES (ver 1.2.6)
--     gPhoto2:                     YES
-- 
--   Parallel framework:            OpenMP
-- 
--   Other third-party libraries:
--     Use IPP:                     8.2.1 [8.2.1]
--          at:                     /home/peter/Programme/opencv/3rdparty/ippicv/unpack/ippicv_lnx
--     Use IPP Async:               NO
--     Use VA:                      NO
--     Use Intel VA-API/OpenCL:     NO
--     Use Eigen:                   YES (ver 3.2.2)
--     Use Cuda:                    YES (ver 7.5)
--     Use OpenCL:                  YES
-- 
--   NVIDIA CUDA
--     Use CUFFT:                   YES
--     Use CUBLAS:                  YES
--     USE NVCUVID:                 YES
--     NVIDIA GPU arch:             50
--     NVIDIA PTX archs:
--     Use fast math:               YES
-- 
--   OpenCL:
--     Version:                     dynamic
--     Include path:                /home/peter/Programme/opencv/3rdparty/include/opencl/1.2
--     Use AMDFFT:                  NO
--     Use AMDBLAS:                 NO
-- 
--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.8)
--     Libraries:                   /usr/lib64/libpython2.7.so (ver 2.7.8)
--     numpy:                       /usr/lib64/python2.7/site-packages/numpy/core/include (ver 1.9.0)
--     packages path:               lib/python2.7/site-packages
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3.4 (ver 3.4.1)
-- 
--   Python (for build):            /usr/bin/python2.7
-- 
--   Java:
--     ant:                         /usr/bin/ant (ver 1.8.0)
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Matlab:
--     mex:                         NO
-- 
--   Documentation:
--     Doxygen:                     /usr/bin/doxygen (ver 1.8.8)
--     PlantUML:                    NO
-- 
--   Tests and samples:
--     Tests:                       YES
--     Performance tests:           YES
--     C/C++ Examples:              NO
-- 
--   Install path:                  /usr/local
-- 
--   cvconfig.h is in:              /home/peter/Programme/opencv/build
--        
-----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/peter/Programme/opencv/build

最佳答案

因此,在尝试并再次尝试之后,我以不同的方式解决了这个问题。我从 opencv3 退回到 2.4.11,我从最新的 ffmpeg 退回(这解决了很多问题)。另一个问题是始终希望使用已安装的 openv-2.4.9 版本,而不是我的 cuda 编译库。我不是一个想在 cmakefiles 中阅读的人。 OpenCV 有一大堆这样的东西,而不是 cmake 对我来说绝对是一片困惑的大地。

尽管如此,我已经解决了我的问题。不是使用 OpenCV3,而是使用 opencv-2.4.11、Cuda-5.0,这对我的目的来说已经足够了。为了运行这个组合,我编写了一些 shell 脚本来反馈我自己并分析问题。您应该以 super 用户身份运行此文件并替换用户名,或者将文件安装在您的自定义系统中。

-- 请注意,您可能必须重新启动 bumbleed 守护程序,才能使用 mkinitrd 并再次重新启动。由于这里的指令,第二次强制安装完成 --> https://en.opensuse.org/SDB:NVIDIA_Bumblebee
在末端。如果要使用cuda开发,建议使用。
在此之后,您必须重新启动才能完成它。

mkdir /home/peter/programs
cd /home/peter/programs
# 3rd part library and qt library packages installed. Not even sure that everyone is needed
zypper --non-interactive in gcc git libwebp-devel vtk vtk-devel eigen3-devel libeigen2-devel python-numpy-devel python python3-numpy python3-numpy-devel ant java-1_7_0-openjdk-devel java-1_7_0-openjdk-src python-Sphinx openexr openexr-devel libpng12-devel openjpeg openjpeg-devel tiff jasper libjasper-devel pbzip2 python3-cairo  python3-cairo-devel ilmbase-devel cmake-gui gtk2-devel libdc1394 libdc1394-devel libv4l-devel libxine-devel gstreamer-0_10-devel gstreamer-devel openmpi openmpi-devel openmpi-libs VirtualGL-devel Mesa-libGLESv3-devel ftgl-devel glew glproto-devel gltt gltt-devel gtkglext-devel libGLw1 libftgl2 libglfw-devel libgltf-devel python-opengl gluegen2 gluegen2-devel libjnidispatch gphoto libgphoto2-devel libunicap2 libunicap-devel libucil-devel libucil2 zypper libbz2-devel doxygen jna zypper libQt5Bluetooth5  libQt5Bootstrap-devel-static libQt5Concurrent-devel libQt5Concurrent5 libQt5Core-devel libQt5Core-private-headers-devel libQt5Designer5 libQt5DesignerComponents5 libQt5Gui-devel libQt5Gui-private-headers-devel libQt5Help5 libQt5Network-devel libQt5Network-private-headers-devel libQt5Network5 libQt5OpenGL-devel libQt5OpenGL-private-headers-devel libQt5OpenGL5 libQt5OpenGLExtensions-devel-static libQt5PlatformHeaders-devel libQt5PlatformSupport-devel-static libQt5PlatformSupport-private-headers-devel libQt5Widgets-devel libqt5-creator libqt5-qtdoc libqt5-qttools libqt5-qttools-devel python-qt5 python-qt5-devel python-qt5-utils freetype freetype-devel freetype2-devel dpic libvpx1 libvpx-devel nasm yasm  libopus-devel autoconf automake libass-devel libfreetype6 libSDL-devel libSDL2-devel libtheora-devel libtool libva1 libva-devel libtool libvdpau-devel libvorbis-devel libxcb-devel libxcb-shm0 libxcb-xfixes0 pkg-config latex2html zlib  zlib-devel

# downloading and preparing libs that should be installed form the scratch 
wget http://developer.download.nvidia.com/compute/cuda/repos/opensuse132/x86_64/cuda-repo-opensuse132-7.5-18.x86_64.rpm

mkdir SDK
cd SDK
wget http://developer.download.nvidia.com/compute/nvenc/v5.0/nvenc_5.0.1_sdk.zip -O nvenc-sdk.zip
unzip nvenc-sdk.zip
cd nvenc_5.0.1_sdk

cd /home/peter/programs
wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2

wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master
unzip fdk-aac.zip

wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz

wget http://downloads.xvid.org/downloads/xvidcore-1.3.4.tar.gz
tar xzvf xvidcore-1.3.4.tar.gz

wget http://ffmpeg.org/releases/ffmpeg-2.6.1.tar.bz2
tar xjvf ffmpeg-2.6.1.tar.bz2

wget  http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.11/opencv-2.4.11.zip/download  --output-document=opencv.zip
unzip opencv.zip
cd opencv-2.4.11
mkdir build
cd /home/peter/programs
rpm -i cuda-repo-opensuse132-7.5-18.x86_64.rpm
zypper --gpg-auto-import-keys refresh
zypper addrepo http://download.opensuse.org/repositories/X11:Bumblebee/openSUSE_13.2/X11:Bumblebee.repo
zypper --gpg-auto-import-keys refresh

zypper --non-interactive --gpg-auto-import-keys in bumblebee
usermod -G video,bumblebee peter

systemctl enable bumblebeed
mkinitrd

zypper --gpg-auto-import-keys --non-interactive in cuda 

systemctl enable dkms
zypper --non-interactive in nvidia-bumblebee-32bit

zypper --gpg-auto-import-keys --non-interactive in cuda
zypper --non-interactive in cuda-gdb-src-7-5

zypper --gpg-auto-import-keys --non-interactive in -f nvidia-bumblebee
cd /etc/ld.so.conf.d
echo -e "/usr/local/cuda-7.5/lib64" > cudald.conf
ldconfig

cd /home/peter
echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH\nexport PATH=/usr/local/cuda-7.5/bin:$PATH" >> .bashrc

chmod 777 -R programs
reboot

我不确定这是否是问题的根源,但重新启动后,您可能会打开一个新的 shell 并运行此文件。再次不要忘记自定义 shell 脚本。在开始之前,您应该扩展您的 sudo session 或再次以 super 用户身份运行它。

删除 rpm 可能附带的任何其他 opencv-libs。然后你可以启动这个代码片段来安装它。

-- 请注意,最后需要 optirun 命令以在所有步骤中都具有正确的体系结构。有时使用 make 或 make install 重新启动配置。为了保持配置,让它与 optimus 一起运行。
cd /home/peter/programs/SDK/nvenc_5.0.1_sdk
sudo cp Samples/common/inc/*  /usr/include/


cd /home/peter/programs/x264-snapshot*
./configure --enable-static --enable-shared --enable-pic
make
sudo make install
make distclean

cd /home/peter/programs/mstorsjo-fdk-aac*
autoreconf -fiv
./configure
make
sudo make install
make distclean

cd /home/peter/programs/lame-3.99.5
./configure --enable-nasm
make
sudo make install
make distclean

cd /home/peter/programs/xvidcore/build/generic
./configure
make 
sudo make install 
make distclean

cd /home/peter/programs/ffmpeg-2.6.1
./configure \
  --enable-shared \
  --enable-gpl \
  --enable-libass \
  --enable-libfdk-aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libtheora \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libxvid \
  --enable-nonfree \
  --enable-nvenc
make -j8
sudo make install
make distclean
hash -r
echo "Complete!"

cd /home/peter/programs/opencv-2.4.11/build
optirun cmake -D BUILD_EXAMPLES:BOOL=TRUE -D CUDA_ARCH_BIN:STRING=5.0 -D CUDA_ARCH_PTX:STRING=5.0 -D CUDA_BUILD_CUBIN:BOOL=TRUE -D CUDA_FAST_MATH:BOOL=TRUE -D CUDA_GENERATION:STRING=Auto -D INSTALL_C_EXAMPLES:BOOL=TRUE -D INSTALL_PYTHON_EXAMPLES:BOOL=TRUE -D WITH_CUDA:BOOL=ON -D INSTALL_TESTS:BOOL=TRUE -D WITH_CUBLAS:BOOL=TRUE -D WITH_NVCUVID:BOOL=TRUE -D WITH_OPENCLAMDBLAS:BOOL=FALSE -D WITH_OPENCLAMDFFT:BOOL=FALSE -D WITH_OPENGL:BOOL=TRUE -D WITH_UNICAP:BOOL=TRUE -D WITH_XINE:BOOL=TRUE -D WITH_QT:BOOL=TRUE -D CUDA_nvcuvid_LIBRARY:FILEPATH=/usr/lib64/libnvcuvid.so.1 /home/peter/programs/opencv-2.4.11/
optirun make -j8
sudo optirun make install

使用 optirun i 启动 qtcreator 后,您应该能够像其他所有 opencv 程序一样编译和运行 opencv_gpu 文件。

谢谢彼得

关于opencv - 使用 Cuda7.5 ffmpeg(最新)问题 OpenSUSE 13.2 编译 OpenCV3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32806247/

相关文章:

c++ - opencv C++ 神经网络 predict() 函数抛出 "Bad argument"错误

python-2.7 - 如何计算图像的直方图?

c++ - OpenCV 估计 Affine3D 共面点的断裂

c++ - 优化从子位掩码生成父位掩码

CMake:通过 NVCC 传递编译器标志列表

video - MP4的时间戳信息

python - 在anaconda3中安装opencv

c - 启动内核时共享内存和流

.net - 软件包安装在 docker 内,但实际命令提供异常

ffmpeg - 更改 fps while-loops 导出 ffmpeg