DllNotFoundException nvcuda on mono ubuntu 14.04



I'm trying to use managedCuda under linux.
It compiles fine but crash on run time with dllnotfoundexception nvcuda
I have installed cuda 7.0 x64 toolkit and can run c++ cuda kernels.
I have also set PATH and DYLD_LIBRARY_PATH as cuda doc suggests. But there are no traces of nvcuda.dll in the cuda lib64 folder.

I have installed from nuget managed cuda 7.0 x64.

Thank you

file attachments


lighplex wrote Jun 30, 2015 at 2:30 AM

I solved my problem. The library under linux is called libcuda.so instead of libnvcuda.so. (and is located in a specific place).
Using locate we can find where the x64 version is located.
Then you just create a symbolic link next to your application using ln -s path/to/libcuda.so libnvcuda.so.
You will also have to use this symbolic link trick for other native libraries.
(Alternatively you could correct the native library names in the source code)
Thank you

kunzmi wrote Jun 30, 2015 at 9:39 AM

When using mono on Linux you can also use the mono's capabilities of configuring shared libraries for .net in config-files; this also avoids the hustles with manually set symlinks when updating to a newer cuda version. See the attached files for an example on how to do this.
But you're right to file an issue on this topic, as these config-files should be part of every managedCuda release. I will include these in future releases.

lighplex wrote Jul 1, 2015 at 6:17 PM

Thank you for your neater solution.