Windows7 64位机上,OpenCV中配置CUDA,实现GPU操作步骤

按语:首先感谢这个博主的原创方法,在这个基础上编译之后发现了很多问题,所以进行了改正,有了以下方法:

重新编译opencv

NVIDIA GeForce GT630;

CUDA Toolkit6.0 64位,安装,,并通过样本程序验证其安装正确;

Where to buildthe binaries

View–> Properties Manager–>Executable Directories

(需要说明的是:opencv里面要选择build文件夹下面的路径才对)

VC++ Directories,IncludeDirectories:

D:\soft\OpenCV2.4.6\TBB\tbb41_20130613oss\include

C:\Program Files\NVIDIAGPU ComputingToolkit\CUDA\v5.0\include

D:\opencv\build\include

D:\opencv\build\include\opencv

D:\opencv\build\include\opencv2

Library Directories:

D:\soft\OpenCV2.4.6\TBB\tbb41_20130613oss\lib\ia64\vc10

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\lib\Win64

D:\opencv\build\x64\vc10\lib

Executable Directories:

D:\soft\OpenCV2.4.6\TBB\tbb41_20130613oss\bin\ia64\vc10

C:\Program Files\NVIDIA GPU ComputingToolkit\CUDA\v5.0\bin

D:\opencv\build\x64\vc10\bin

Properties–>Linker–>Input–>IgnoreSpecificDefault Libraries

Solution OpenCV

补充说明

Debug过程

编译错误解决:

解决方法:

把这个附件放在上述目录里面:附件

2、错误:

CMakeFiles/example_gpu_driver_api_multi.dir/driver_api_multi.cpp.o: Infunction `destroyContexts()’:

driver_api_multi.cpp:(.text._Z15destroyContextsv+0xc): undefined referenceto `cuCtxDestroy_v2′

driver_api_multi.cpp:(.text._Z15destroyContextsv+0x1c): undefinedreference to `cuCtxDestroy_v2′

CMakeFiles/example_gpu_driver_api_multi.dir/driver_api_multi.cpp.o: Infunction `Worker::operator()(int) const’:

driver_api_multi.cpp:(.text._ZNK6WorkerclEi+0x19): undefined reference to`cuCtxPushCurrent_v2′

driver_api_multi.cpp:(.text._ZNK6WorkerclEi+0x6bf): undefined reference to`cuCtxPopCurrent_v2′

解决方法:

Only two example will affect by this bug,"example_gpu_driver_api_multi" and"example_gpu_driver_api_stereo_multi"

Modify line 39

target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS}${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})

to

target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS}${OPENCV_GPU_SAMPLES_REQUIRED_DEPS} cuda)

in "opencv-2.4.6.1/samples/gpu/CMakeLists.txt" can easily fixthis problem

“..\..\lib\Debug\opencv_superres248d.lib”D:\opencv\opencv248GPU\modules\superres\LINKopencv_test_superres分析:是链接库链接不上造成的,添上这些库就可以了。

5、错误

Unable to cast COM object of type’System.__ComObject’ to interface type ‘EnvDTE.DTE’.

解决办法:可能是这个或者可以放在这里不解决,继续编译可以没有问题

The exception seems to indicate the crashwas caused due to an interface not being found. This indicates thatsomething’s wrong with proxy/stubs onthe machine. At leastIServiceProvider is failing. IE is usually the owner of the IServiceProviderproxy.From the dump, it showed devenv.exe process crashed shortly afterloading: C:\Windows\SysWOW64\actxprxy.dll andC:\Windows\System32\mssprxy.dll

The issue turned out to be brokenregistration for IServiceProvider. The proxy-stub CLSID was wrong (it wasreferring to actxprxy.dll instead of ieproxy.dll on Windows 7 x64). Registeringieproxy.dll from an elevated cmd prompt resolved the issue.regsvr32"C:\Program Files (x86)\Internet Explorer\ieproxy.dll"

On x86 systems,regsvr32"C:\Program Files\Internet Explorer\ieproxy.dll"

新编译的opencv使用方法

View–>Properties Manager–>VC++ DirectoriesLibrary Directories

1.#include"stdafx.h"

2.#include<opencv2/opencv.hpp>

3.#include<opencv2/gpu/gpu.hpp>

4.

5.usingnamespacecv;

6.usingnamespacecv::gpu;

7.

8.int_tmain(intargc,_TCHAR*argv[])

9.{

10.intiDevicesNum=getCudaEnabledDeviceCount();

11.

12.cout<<iDevicesNum<<endl;

13.

14.return0;

15.}

参考文献

世俗的纷扰,生活的琐碎使人精疲力尽,

Windows7 64位机上,OpenCV中配置CUDA,实现GPU操作步骤

相关文章:

你感兴趣的文章:

标签云: