我正在使用CMAKE在Windows上使用CUDA支持编译OpenCV 3.0.0.单击"configure"时,会发生以下错误:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cufft_LIBRARY (ADVANCED)
linked by target "opencv_hal" in directory E:/dev-lib/opencv3/sources/modules/hal
...
CUDA_nppc_LIBRARY (ADVANCED)
...
CUDA_nppi_LIBRARY (ADVANCED)
...
CUDA_npps_LIBRARY (ADVANCED)
Run Code Online (Sandbox Code Playgroud)
我在条目中检查了"WITH_CUDA"和"WITH_CUFFT".如果我也检查"WITH_CUBLAS",上面的输出将再添加一个CUDA_cublas_LIBRARY错误.
但在所有这些错误消息之前,它表明了这一点
CUDA detected: 7.5
CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_30,code=compute_30
Run Code Online (Sandbox Code Playgroud)
这表明CUDKE可以检测到CUDA.但是,找不到所需的4个库.
我之前已经安装了CUDA 7.5并使用Visual Studio 2012进行了编译.CUDA样品运行完美.所以我的CUDA库应该正确安装.
我想知道即使我必须手动设置这些值,我该怎么办呢?
我的规格:Windows 7 x64,Visual Studio 2012,CMAKE 3.4.0,CUDA Toolkit 7.5
Joh*_*any 22
感谢评论中Drop的提示,我解决了这个问题.为了结束这个问题,我正在回答我自己的问题.
这是一个"Win32或x64"架构问题.由于NVIDIA只提供cufft,nvblas,nppc,nppi,npps库为64位,这自然是不可能的CMake的找到这些库配置一个Win32 OpenCV库.
我的解决方案是在CMAKE中选择Visual Studio 11 Win64而不是Visual Studio 11作为生成器.这样CMAKE就会自动加载lib <CUDA_DIR>\lib\x64而不是<CUDA_DIR>\lib\Win32.此外,我还需要加载OpenCV在64位版本中所需的所有其他库,例如OpenGL.我还需要在x64架构中编译OpenCV.我将来要写的所有代码都只需要在x64中构建和调试.
如果您在阅读中文资料时没有遇到任何问题,我很乐意提供一个关于在VS2012上使用CUDA支持构建OpenCV 3.0的完整指南的帖子链接.
| 归档时间: |
|
| 查看次数: |
19262 次 |
| 最近记录: |