UnsatisfiedLinkError with cudnn on Windows 10

I’ve done the following

  1. built my Java program with beta7 and Cuda 10.2 dependencies on Windows 10.
  2. installed Cuda10.2 and cudnn10.2. (copied dlls from cudnn/bin into Cuda10.2 bin)
  3. Set “-Djava.library.path=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin”

and get the following…

[main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [JCublasBackend] backend
[main] INFO org.nd4j.nativeblas.NativeOpsHolder - Number of threads used for linear algebra: 32
[main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Backend used: [CUDA]; OS: [Windows 10]
[main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Cores: [8]; Memory: [7.1GB];
[main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Blas vendor: [CUBLAS]
[main] INFO org.nd4j.linalg.jcublas.JCublasBackend - ND4J CUDA build version: 10.2.89
[main] INFO org.nd4j.linalg.jcublas.JCublasBackend - CUDA device 0: [Quadro M2200]; cc: [5.2]; Total memory: [4294967296]
[main] INFO org.deeplearning4j.nn.multilayer.MultiLayerNetwork - Starting MultiLayerNetwork with WorkspaceModes set to [training: ENABLED; inference: ENABLED], cacheMode set to [NONE]
[main] WARN org.deeplearning4j.nn.layers.convolution.ConvolutionLayer - Could not initialize CudnnConvolutionHelper
java.lang.reflect.InvocationTargetException

Caused by: java.lang.UnsatisfiedLinkError: no jnicudnn in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)

Caused by: java.lang.UnsatisfiedLinkError: C:\Users\DavidWood.javacpp\cache\cuda-10.2-7.6-1.5.3-windows-x86_64.jar\org\bytedeco\cuda\windows-x86_64\jnicudnn.dll: The specified procedure could not be found

If I run the following (recommended on other posts):

		try {
		    Loader.load(cudnn.class);
		} catch (UnsatisfiedLinkError e) {
		    String path = Loader.cacheResource(cudnn.class, "windows-x86_64/jnicudnn.dll").getPath();
		    new ProcessBuilder("c:/temp/dependencies/DependenciesGui.exe", path).start().waitFor();
		}

I see that it can’t find cudnn64_7.dll. The cudnn 10.2 I installed contains cudnn64_8.dll. I copied this file to cudnn64_7.dll, but no joy.

Thoughts?

Just include deeplearning4j-cudnn as a dependency. No need to do anything manually.
More here: https://deeplearning4j.konduit.ai/config/backends/config-cudnn

I already have this dependency

<dependency>
    <groupId>org.deeplearning4j</groupId>
    <artifactId>deeplearning4j-cuda-10.2</artifactId>
    <version>1.0.0-beta7</version>
</dependency>

The page you reference above says that dependency plus a manual installation of cudnn is what is required. Are you suggesting something like this

<dependency>
    <groupId>org.deeplearning4j</groupId>
    <artifactId>deeplearning4j-cudnn</artifactId>
    <version>1.0.0-beta7</version>
</dependency>

I see no such artifact on the maven repo, so probably not?

Ah sorry yeah. Ok I thought you only had nd4j cuda. Try to use the redist artifact (this is also covered in the page I linked.)

I’d prefer not to use this solution as it would require me to distribute Nvidia’s code per their license. I would like to have my end customers download their code and accept the license themselves.

Alternatively, if I could find the cudnn v7 to download that would probably work, but I can’t find it at the NVidia site. Might there be a way to gracefully, in the future, allow an upgrade of cudnn or other libraries (I’m surprised renaming the file didn’t work), otherwise dl4j w/gpu on windows may age out like this in the future.

@dawood just use it for now for development. We don’t have that risk in practice. We always upgrade to the latest version of cuda/cudnn before doing a release.
If you’re paranoid about cudnn and co here’s how we handle that (we maintain javacpp as well):

Anaconda also redistributes anaconda fine: Cudnn :: Anaconda.org

In fact, I was able to find the cudnn7 downloads on NVidia at cuDNN Archive | NVIDIA Developer. I’m up and running and running into other issues. I’ll make a separate post.

Thanks yes please do!

Actually its all good and I’m up and running! Thanks for your help.