简体   繁体   English

在Ubuntu 18.04上使用CUDA和FFMpeg编译OpenCV时出错

[英]Error during the compilation of OpenCV with CUDA and FFMpeg on Ubuntu 18.04

I have a requirement to install OpenCV compiled with CUDA and FFMpeg for an optical flow calculation. 我需要安装用CUDA和FFMpeg编译的OpenCV进行光流计算。

I followed this post to install on Ubuntu 18.04, but I am getting the following error shown in the below screenshot when I am trying to execute the following command: 我按照这篇文章在Ubuntu 18.04上安装,但是当我尝试执行以下命令时,在以下屏幕截图中显示了以下错误:

  cmake -D CMAKE_BUILD_TYPE=RELEASE \
            -D CMAKE_INSTALL_PREFIX=/usr/local \
            -D INSTALL_C_EXAMPLES=ON \
            -D INSTALL_PYTHON_EXAMPLES=ON \
            -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
            -D BUILD_EXAMPLES=ON \
            -D BUILD_opencv_python2=OFF \
            -D WITH_FFMPEG=1 \
            -D WITH_CUDA=ON \
            -D CUDA_GENERATION=Pascal \
            -D ENABLE_FAST_MATH=1 \
            -D CUDA_FAST_MATH=1 \
            -D WITH_CUBLAS=1 \
            -D PYTHON_DEFAULT_EXECUTABLE=/opt/anaconda/bin/python \
            -D PYTHON3_INCLUDE_DIR=/opt/anaconda/include/python3.5m \
            -D PYTHON3_LIBRARY=/opt/anaconda/lib/libpython3.5m.so \
            -D PYTHON3_PACKAGES_PATH=/opt/anaconda/lib/python3.5 \
            -D WITH_LAPACK=OFF \
            -D PYTHON3_NUMPY_INCLUDE_DIRS=/opt/anaconda/lib/python3.5/site-packages/numpy/core/include ..

在此处输入图片说明

I have installed the CUDA version 10.0 我已经安装了CUDA版本10.0

It would be of a great help, if you can guide me to fix this error or suggest me a different procedure to install OpenCV compiled with CUDA and FFMpeg on Ubuntu 18.04. 如果您可以指导我解决此错误,或建议我使用其他过程在Ubuntu 18.04上安装使用CUDA和FFMpeg编译的OpenCV,则将有很大的帮助。

Thanks! 谢谢!

Just to put the information as an answer 只是为了将信息作为答案

What you describe, seems to be the same issue as in this one in github of opencv. 您描述的内容似乎与opencv的github中的这个问题相同。 In which the CUDA_CUDA_LIBRARY is not found. 在其中找不到CUDA_CUDA_LIBRARY。 One can set this manually with: 可以使用以下方法手动设置:

-DCUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/stubs/libcuda.so

or you can also use: 或者您也可以使用:

-DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs

Which will give a hint of where to look for this library. 这将提示在哪里可以找到该库。

For the other problem in your comment, it seems like some python file could not be found. 对于您评论中的另一个问题,似乎找不到某些python文件。 Most probably related to this: 最可能与此有关:

        -D PYTHON_DEFAULT_EXECUTABLE=/opt/anaconda/bin/python \
        -D PYTHON3_INCLUDE_DIR=/opt/anaconda/include/python3.5m \
        -D PYTHON3_LIBRARY=/opt/anaconda/lib/libpython3.5m.so \
        -D PYTHON3_PACKAGES_PATH=/opt/anaconda/lib/python3.5 \

You should check if you have those folders/files. 您应该检查是否有那些文件夹/文件。 If the version is the correct one (3.5) or if it is a newer one (3.6 or 3.7). 如果版本是正确的版本(3.5)或较新的版本(3.6或3.7)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Ubuntu 18.04上安装OpenCV 3.4.2 - Installing OpenCV 3.4.2 on Ubuntu 18.04 CuPy 不适用于 Ubuntu 18.04 和 CUDA 9.0 - CuPy is not working on Ubuntu 18.04 with CUDA 9.0 在 Ubuntu 18.04(在 VMWare 内运行)中运行程序时出现此错误:AssertionError:Torch 未在启用 CUDA 的情况下编译 - While running program in Ubuntu 18.04 (Running inside VMWare) am getting this error: AssertionError: Torch not compiled with CUDA enabled 在 Ubuntu18.04 中使用 CUDA 使用 Python 库 Keops 的运行时错误 - Runtime error using Python Library Keops using CUDA in Ubuntu18.04 KivyMD 在 Ubuntu 18.04 上安装错误 - KivyMD installation error on Ubuntu 18.04 在 Ubuntu 18.04 上安装 Pandas 时出错 - Error in installation of Pandas on Ubuntu 18.04 Ubuntu 18.04编译opencv 3.4.3 python 3.5错误:ImportError:libjasper.so.4 - Ubuntu 18.04 Compiling opencv 3.4.3 python 3.5 error: ImportError: libjasper.so.4 编译错误 OpenCV 4.2.0 Ubuntu 18.04:目标 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' 失败 - Compile Error OpenCV 4.2.0 Ubuntu 18.04: target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed make 安装过程中ubuntu上的Opencv2.4编译错误 - Opencv2.4 compiling error on ubuntu during installation opencv安装ffmpeg错误 - opencv installation ffmpeg error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM