-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need clear instructions on how to build opencvsharp with cuda to use gpu acceleration? #1673
Comments
Here is my opencv build cmake logs and i was able to make a build from it, but whats next? Details
|
guys, i have built the opencvextern.dll but now i am getting error on trying to compile opencvsharp with x64 release config:
total 565 error of this type, where do i need to reference the OpenCvSharpExtern release files? i tried putting them in opencvsharp solution folder and a x64 folder with this config in csproj folder:
still the issue remains the same. |
Hi @aloksharma1, I want to start by saying that I don't have the same level of knowledge as @AvenSun, as I'm still new to this stuff, but I'll do my best to help. Let's begin with some basic checks. Just to be sure, is the NuGet package for OpenCvSharp (not the runtime) installed in your project? (Sorry if this seems like a basic question.) |
Are you trying to use the old OpenCvSharp implementation of GpuMat.cs, Stream.cs, etc? I think the OpenCvSharp implementation has changed so much that it is not compatible. I can't write up the solution to that here. This is probably not a problem on the C++ side, but on the C# implementation.
As for the error message about the Util namespace not being found, there is currently an implementation at |
Hi Guys, @shimat i will try your solution and will let you know before eod. i simply want gpu accelaration tow owkr with project. Also one more question for you, my build log says:
so its downloading ffmpeg, is cmake making the cuda version of this dll? my thinking is since we have enabled cuda flags it should be doing that internally? thanks |
This is my guess, but there is only one opencv_videoio_ffmpeg(_64).dll available in the repository. The CUDA flag of the OpenCV cmake has no effect on the ffmpeg DLL selection. |
Hello @shimat i tried your suggestion and the util folder is already present in in the code. please check the screenshot here as for the gpu mat error, i dont understand it much i downloaded and followed instructions given by you in here https://github.com/shimat/opencv_files |
The remaining This is my last reply, but perhaps the errors in your screenshot could be solved by changing namespace from OpenCvSharp to OpenCvSharp.Internal. In addition, the corresponding functions on the C++ side must be included in the compilation beforehand. Currently they are excluded by macros.
|
Hi @aloksharma1 sorry for late response, for my case after all the compilations i just took advantage of the performance gain obtained by changing the target from CPU to GPU(for example on the Computer Vision model). |
thanks after @shimat said he disabled gpu support, i switched back to original compiled opencv with cuda support on python and used zero mq for cross process communication. |
hello i am using windows 11 and i have already checked 967 & #1668 , but as a c# dev i dont work with c++ much and these instructions are not clear for me (too advanced atm). I was hoping if you or anyone here can provide me with a step by step guide (please add a documentation for it, it will be big help instead of this "If you want to use the CUDA features, you need to customize the native bindings yourself.").
Thank you
@shimat @AvenSun
The text was updated successfully, but these errors were encountered: