# UnsatisfiedLinkError with cudnn on Windows 10

**URL:** <https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856>\
**Category:** DL4J\
**Created:** [September 16, 2020, 10:24pm UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856 "2020-09-16T22:24:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawood](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dawood](https://community.konduit.ai/u/dawood)\
**Post date:** [September 16, 2020, 10:24pm UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856/1 "2020-09-16T22:24:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [September 16, 2020, 10:32pm UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856/2 "2020-09-16T22:32:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dawood](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dawood](https://community.konduit.ai/u/dawood)\
**Post date:** [September 16, 2020, 10:39pm UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856/3 "2020-09-16T22:39:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [September 16, 2020, 11:56pm UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856/4 "2020-09-16T23:56:33Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![dawood](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dawood](https://community.konduit.ai/u/dawood)\
**Post date:** [September 17, 2020, 12:02am UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856/5 "2020-09-17T00:02:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [September 17, 2020, 8:22am UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856/6 "2020-09-17T08:22:35Z")

</div>

@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):

> **[javacpp-presets/cuda at master · bytedeco/javacpp-presets](https://github.com/bytedeco/javacpp-presets/tree/master/cuda)**
>
> master/cuda

Anaconda also redistributes anaconda fine: [Cudnn :: Anaconda.org](https://anaconda.org/anaconda/cudnn)

---

<div class="post-metadata">

**Author:** ![dawood](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dawood](https://community.konduit.ai/u/dawood)\
**Post date:** [September 17, 2020, 1:58pm UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856/7 "2020-09-17T13:58:15Z")

</div>

In fact, I was able to find the cudnn7 downloads on NVidia at [cuDNN Archive | NVIDIA Developer](https://developer.nvidia.com/rdp/cudnn-archive). I’m up and running and running into other issues. I’ll make a separate post.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [September 18, 2020, 1:07am UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856/8 "2020-09-18T01:07:52Z")

</div>

Thanks yes please do!

---

<div class="post-metadata">

**Author:** ![dawood](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dawood](https://community.konduit.ai/u/dawood)\
**Post date:** [September 18, 2020, 1:36am UTC](https://community.konduit.ai/t/unsatisfiedlinkerror-with-cudnn-on-windows-10/856/9 "2020-09-18T01:36:25Z")

</div>

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