kunzmi / managedCuda

ManagedCUDA aims an easy integration of NVidia's CUDA in .net applications written in C#, Visual Basic or any other .net language.
Other
440 stars 79 forks source link

BadImageFormatException when trying to use CuBLASS/CuDNN in custom project #57

Open maskrtnik01 opened 6 years ago

maskrtnik01 commented 6 years ago

Hello,

I am getting this exception, when I try to use these libraries in a custom project.

An unhandled exception of type 'System.BadImageFormatException' occurred in mscorlib.dll

Additional information: Could not load file or assembly 'CudaBlas, Version=8.0.13.0, Culture=neutral, PublicKeyToken=539d54d12e99fedb' or one of its dependencies. An attempt was made to load a program with an incorrect format.

May I request compiled(and signed) library files from you?

Sorry to contact you here, but I can´t find any better way. You can contact me on email address maskrtnik01@hotmail.sk .

Thanks in advance, Stanislav

maskrtnik01 commented 6 years ago

Update: I have loaded your NuGet packages into my project. Didn´t solve the issue, What should I try next?

Also tried on other machine. When I try to use CuDNN/CuBlas, I get BadImageFormatException. When I try to just use core library, I get DllNotFoundException - that is okay, because the machine does not have nVidia GPU and CUDA.

kunzmi commented 6 years ago

Sounds like an 32/64 bit issue. All additional libraries are 64-bit only, if you run your application as "All CPU" .net usually defaults to 32 bit and you'll get this error. Try to compile your application to 64 bit and it should run.

maskrtnik01 commented 6 years ago

Thanks for reply. This solved my issue. However there is a new problem. What version of CuDNN should I use? Your library wants cudnn64_6.dll . I had CUDA8 and CuDNN5. I have installed CUDA9.1 and CuDNN6. That is cudnn64_7.dll . What library should I install? Or, are you planning to update your wrapper to this new library in the near future?

kunzmi commented 6 years ago

I haven't managed to update CUDNN to the latest version yet, currently that's still v6. The repository is since a few minutes updated to Cuda 9.1, fell free to test. The Nuget packages will follow soon after some more testing...