简体   繁体   English

OpenCV:不支持GPU(该库在编译时不支持CUDA)

[英]OpenCV: No GPU support (The library is compiled without CUDA support)

I installed opencv 2.4.6.1 with cmake and with option WITH_CUDA=ON. 我使用cmake和选项WITH_CUDA = ON安装了opencv 2.4.6.1。 I tryed some samples code and it worked well. 我尝试了一些示例代码,效果很好。 But some trouble lies with gpu library. 但是gpu库带来了一些麻烦。 I add in the source file: 我在源文件中添加:

cv::gpu::printShortCudaDeviceInfo(cv::gpu::getDevice());

And it returned: OpenCV Error: No GPU support (The library is compiled without CUDA support) in getDevice, file /build/buildd/opencv-2.4.2+dfsg/modules/core/src/gpumat.cpp, line 182 terminate called after throwing an instance of 'cv::Exception' what(): /build/buildd/opencv-2.4.2+dfsg/modules/core/src/gpumat.cpp:182: error: (-216) The library is compiled without CUDA support in function getDevice How could I fix it? 它返回: OpenCV Error: No GPU support (The library is compiled without CUDA support) in getDevice, file /build/buildd/opencv-2.4.2+dfsg/modules/core/src/gpumat.cpp, line 182 terminate called after throwing an instance of 'cv::Exception' what(): /build/buildd/opencv-2.4.2+dfsg/modules/core/src/gpumat.cpp:182: error: (-216) The library is compiled without CUDA support in function getDevice如何解决?

You seem to have a mix of two different versions of OpenCV on your system (2.4.6.1 and 2.4.2). 您的系统上似乎混合了两种不同版本的OpenCV(2.4.6.1和2.4.2)。 The older version (2.4.2) appears to be built without GPU support. 较早版本(2.4.2)似乎是在没有GPU支持的情况下构建的。

You might try removing any older versions of OpenCV completely and start your build process for 2.4.6.1 over again. 你可以尝试完全删除所有旧版本的OpenCV和重新开始你的构建过程2.4.6.1。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM