EmguCV: no kernel image is available for execution on the device - c#

I receive error, when running application: no kernel image is available for execution on the device.
I have installed these packages from NuGet:
Emgu.CV
Emgu.CV.runtime.windows.cuda
I have this error, only when trying to use CUDA. CudaInvoke.HasCuda returns true. But CudaDeviceInfo.IsCompatible returns false.
I have installed NVIDIA CUDA Developement 12.0 pack.
My GPU is Nvidia GeForce 940MX. I am using Visual Studio 2019.
Other people solve this problem, with adding "compute_50,sm_50" to code generation properties, but that works only with c/c++. I am building software using c#.
Any ideas, how to solve this problem?
I tried installing different GPU drivers, different version of EmguCV Nothing changed.

Related

Unable to use OpenCvSharp on Unity when the target platform is Android

I am trying to use OpenCvSharp on Unity targeting for Android.
Here is my steps of configration:
Used NuGet for Unity to download OpenCvSharp4 & OpenCvSharp4's runtimes for windows, ubuntu and linux-arm.
Wrote a script using OpenCvSharp and run it on Editor. Editor throwed the error: DllNotFoundException: OpenCvSharpExtern.
It appears NuGet for Unity only resolved the OpenCvSharp4 nupkg for me but not all other runtimes. So I unziped the rumtimes' packages myself and put the OpenCvSharpExtern.dll and two libOpenCvSharpExtern.so files under Assets/Plugins.
Run the project again on Editor, and it works, as shown here
However when I build the Unity project into the apk and run it on my Samsung S22 ultra, it asked for the promission of using camera but not showing my face.
I used logcat and it throw the same error: DllNotFoundException: OpenCvSharpExtern again.
However, I unziped the APK file and confirmed that the libOpenCvSharpExtern.so is packed in the APK.
Because I am a newby in terms of developing Android apps, I tried to use both libOpenCvSharpExtern.so I unziped from linux and ubuntu, because I am not sure which one I have to use. And as for the library import setting, I set the CPU for ARMv7, since logcat shows my phone's cpu is armeabi-v7a.
Sadly, they didn't work.
Thanks for your time, and I will be glad if anyone can help me :) .

Unity3D - problem with Google Play 64-bit requirement

I cannot deploy the .abb nor .apk as I keep getting the 64-bit requirement error in the Google Play Console.
I have tried everything from this answer: Unity Export Android 64-bit
but still the same problem.
Unity3D version: 2017.4.30f1
NDK: r13b (Unity is not supporting newer versions but this should not be a problem)
SDK API Level: 28
JDK: 1.8.0_221
Player Settings:
When the Unity builds the package I can see it is building for 64-bit devices so I don't get what is the issue.
Build your app without x86.
x86 usage is very low and it even got deprecated in 2019.2, so you wont miss anything by removing it.

Profiling managedCuda in Nsight or Visual Profiler

I'm trying to profile an CUDA-application written in C# with managedCuda using either Nsight Visual Studio Edition or Visual Profiler. Both profilers work well with a plain C++ CUDA app. To test the profilers with managedCuda I want to profile the project "vectorAdd" in ManagedCudaSamples.
First I tried to use Nvidia Nsight Visual Studio Edition 5.0 integrated in VS 2013. I use the x64 Debug configuration. If I try to launch the app in "Application Control" in Nsight Performance Analysis I get an error message:
Analysis Session - Start Application
Unable to launch 64-bit managed application '...\ManagedCudaSamples\vectorAdd\bin\x64\Debug\vectorAdd.exe'.
Additionally I tried to use Nvidia Visual Profiler 7.5 for profiling the same application. On running vectorAdd.exe nvprof console shows the following output:
==2944== NVPROF is profiling process 2944, command: ...\ManagedCudaSamples\vectorAdd\bin\x64\Debug\vectorAdd.exe
==2944== Warning: Some profiling data are not recorded. Make sure cudaProfilerStop() or cuProfilerStop() is called before application exit to flush profile data.
==2944== Generated result file: ...\nvvp_workspace\.metadata\.plugins\com.nvidia.viper\launch\7\api_2944.log
I'm new to CUDA and would be thankful for any advice how to profile managedCuda applications.
You need to call CudaContext.ProfilerStop() just before you exit the application (or destroy the context) in order to flush the collected data to the profiler. The managedCuda samples don't include this call why the profiler doesn't see the collected info. This explains the second error you get.
And regarding the first error:
In the release notes of Nsight 5.0 you can find a known issue:
Managed applications built with the AnyCpu configuration are not supported. The target application must be built using either the Win32 or x64 configurations.
The VS-project for vectorAdd is always set to AnyCPU, regardless what the solution platform is, see the configuration manager of the managedCuda samples-solution to change that.

How do I publish my Monogame game?

Back then when I had Visual Studio 2011 installed, there was a "ClickOnce deployment" option in the project properties window that created self-extracting installation packages that also verified application dependencies (DirectX, ...). I have updated to VS2012 and switched to Monogame due to Microsoft cancelling any further XNA development. That also caused the "ClickOnce" deployment tab to be gone. Nobody I send the Release directory to (it includes some but apparently not all required libraries) can't get the game started - it always crashes, usually due to lack of some OpenAL DLL. Could you provide me with links and/or instructions on Monogame apps deployment/publishing? I've already tried Google but maybe I've overseen something.
I'm targetting Windows.
I found this article while googling for "Monogame Required Dlls":
http://xnameetingpoint.weebly.com/monogameintro.html
Basically, besides the assemblies in your Release folder the user would need to have OpenGL drivers installed.

C# exe running issue with EMGU CV

I have been working on Microsoft Visual C# 2010 for an image processing program. The software uses EMGU CV 2.4.0. The program is very long (consists of 8 very lengthy functions) so i cannot post it here. Now, the program works perfectly on my pc. I have finished it. I can just run the exe file, and it works. My problem is that the .exe file doesnt work on another computer. Actually, I have 2 separate projects, But both are using EMGU CV. No error message shows to me when I run the first exe on another pc ( although it shows to me sometimes that ( project1 stopped working, windows is trying to collect information, this might take minutes ) but that's not always. Now the error message that shows to me when i run the second exe on another pc is (microsoft .net framework, EMGU.CV.CVInvoke exception error). then the exe work and a window appear ( which is expected ) but the real task of the program which is doing some image processing is not being done.
Note that both of the projects are windows applications output type.
Note that .NET framework 4 client profile is the target framework
I don't think this is .NET framework issue. Because I have tried to do a simple program and the exe file works on the other pc (it was just a simple streamwriter program which creates .txt) These are the EMGU CV libraries I'm using:
EMGU.CV.dll
EMGU.CV.GPU.dll
EMGU.CV.UI.dll
EMGU.CV.UTIL.dll
Just for your information, I have downloaded EMGU CV 2.4.0 on the other pc as well ( after failing in running it with putting the libraries with the .exe in 1 file ) but still nothing works. I have no clue what on earth can be the problem!
I don't know if this is useful, but the program uses SURFFEATURE example as the one in the EMGU CV but with lots and lots of modifications ( I have worked on it since the last Novermber) and basically it is a program for object recognition purpose.
have you installed the Visual C++ redistributibale on the machine, you are trying to run the file on?
If it's a x64 machine you will need the x64 version. But I would still also install the x86 version, just in case...
I know that this is an old question but..
If your OS is 64 bit you should use EmguCV x64 but if your OS is 32 bit then use x86 dlls. I built my solution as 'Any CPU' and it still worked.
Also as #Pogo the Jotz mentioned, you need to install Visual C++ Redistributable on that machine, same as on your visual studio version in which you compiled your exe file. The .Net framework also should be the same.

Categories