OpenCvSharp installed using NUGET PAckage Manager not detecting a CUDA Device

我们两清 提交于 2019-12-25 05:44:10

问题


I am trying to include GPU using OpenCvSharp. I installed the OpenCvSharp by using Nuget Package Manager in Microsoft Visual Studio 2013.

I have included these lines already

                 using OpenCvSharp;
                 using OpenCvSharp.CPlusPlus;
                 using OpenCvSharp.CPlusPlus.Gpu;

but when i check the device count

  //GPU
                int count = Cv2Gpu.GetCudaEnabledDeviceCount();
                //int count = Cv2Gpu.ge
                Console.WriteLine("The GPU Device count is " +  count.ToString());

it always returns 0.

Now it also says if OpenCv is not compiled with CUDA then it always returns 0. it does not even get DeviceDetails.


回答1:


I have resolved this problem by building the opencv_core.dll and opencv_gpu.dll.

Make the source code of opencv with Cmake and dont forget to select "withcuda" option while configuring the source code first.

after generation then open OpenCv solution in build folder and first build opencv_core and then opencv_gpu.

once you got the dll in the bin folder replace them in the opencvsharp package folder. Now build the project again. Now the project will copy the new dll's to the required folder.



来源:https://stackoverflow.com/questions/32484659/opencvsharp-installed-using-nuget-package-manager-not-detecting-a-cuda-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!