Still a no jniNd4j error

I try to run MultiGpuLenetMnistExample under DL4J 1.0.0-beta7 dl4j-cuda-specific-examples on windows 10 but get a “no jniNd4j” error as following:

o.n.l.f.Nd4jBackend - Loaded [JCublasBackend] backend
o.n.n.NativeOpsHolder - Number of threads used for linear algebra: 32
o.n.l.a.o.e.DefaultOpExecutioner - Backend used: [CUDA]; OS: [Windows 10]
o.n.l.a.o.e.DefaultOpExecutioner - Cores: [8]; Memory: [16.0GB];
o.n.l.a.o.e.DefaultOpExecutioner - Blas vendor: [CUBLAS]
o.n.l.j.JCublasBackend - ND4J CUDA build version: 10.2.89
o.n.l.j.JCublasBackend - CUDA device 0: [Quadro M1200]; cc: [5.0]; Total memory: [4294967296]
**java.lang.UnsatisfiedLinkError: no jniNd4j in java.library.path: [C:\Java\jdk-12.0.2\bin,** C:\WINDOWS\Sun\Java\bin, C:\WINDOWS\system32, C:\WINDOWS, C:/Java/jdk-12.0.2/bin/server, C:/Java/jdk-12.0.2/bin, C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin, C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\Java\jdk-12.0.2\bin, C:\hadoop-2.7.1\bin, C:\spark-2.4.3\bin, C:\scala\bin, C:\Program Files\Git\cmd, C:\Users\LDLC\Anaconda3\Scripts, C:\Users\LDLC\Anaconda3, C:\Users\LDLC\Anaconda3\Library\bin, C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0\, C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\redist\intel64_win\mkl, C:\maven-3.6.3\bin, D:\projects\eclipse\deeplearning4j-examples-master\cuda\windows-x86_64, C:\Program Files\dotnet\, C:\python3.7\Scripts\, C:\python3.7\, C:\Users\LDLC\AppData\Local\Microsoft\WindowsApps, C:\maven-3.6.3\bin, C:\Users\LDLC\Desktop, ., .]
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2660)
	at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:827)
	at java.base/java.lang.System.loadLibrary(System.java:1902)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1631)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1265)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1125)
	at org.deeplearning4j.examples.multigpu.MultiGpuLenetMnistExample.main(MultiGpuLenetMnistExample.java:68)
Exception in thread "main" java.lang.NullPointerException
	at org.deeplearning4j.examples.multigpu.MultiGpuLenetMnistExample.main(MultiGpuLenetMnistExample.java:73)

I follow instruction on https://jrmerwin.github.io/deeplearning4j-docs/quickstart to add a VM parameter “-Djava.library.path=”"", but the result is the same.

The pom.xml file on my projects is as below. Is there any idea about this problem?

<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~ Copyright (c) 2015-2019 Skymind, Inc.
  ~
  ~ This program and the accompanying materials are made available under the
  ~ terms of the Apache License, Version 2.0 which is available at
  ~ https://www.apache.org/licenses/LICENSE-2.0.
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  ~ License for the specific language governing permissions and limitations
  ~ under the License.
  ~
  ~ SPDX-License-Identifier: Apache-2.0
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>dl4j-cuda-specific-examples</artifactId>

    <parent>
        <groupId>org.deeplearning4j</groupId>
        <artifactId>deeplearning4j-examples-parent</artifactId>
        <version>1.0.0-beta7</version>
    </parent>

    <name>DeepLearning4j CUDA special examples</name>
    <properties>
      <nd4j.backend>nd4j-cuda-10.2-platform</nd4j.backend>
    </properties>

    <repositories>
        <repository>
            <id>snapshots-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>


    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus snapshot repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.nd4j</groupId>
                <artifactId>nd4j-cuda-10.2-platform</artifactId>
                <version>${nd4j.version}</version>
                <classifier>windows-x86_64</classifier>
            </dependency>
      </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Dependency for parallel wrapper (for multi-GPU parameter averaging -->
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-parallel-wrapper</artifactId>
            <version>${dl4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-core</artifactId>
            <version>${dl4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-ui</artifactId>

            <version>${dl4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-zoo</artifactId>
            <version>${dl4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>${nd4j.backend}</artifactId>
            <version>${dl4j.version}</version>
        </dependency>
        <!-- datavec-data-codec: used only in video example for loading video data -->
        <dependency>
            <artifactId>datavec-data-codec</artifactId>
            <groupId>org.datavec</groupId>
            <version>${datavec.version}</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bytedeco</groupId>
            <artifactId>cuda-platform-redist</artifactId>
            <version>10.2-7.6-1.5.2</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${exec-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>java</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${maven-shade-plugin.version}</version>
                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <shadedClassifierName>${shadedClassifier}</shadedClassifierName>
                    <createDependencyReducedPom>true</createDependencyReducedPom>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>org/datanucleus/**</exclude>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>reference.conf</resource>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Are you trying to run it from the examples project directly, or have you copied this submodule and are trying to run it that way?

It seems that the problem is resolved someway. But I’m sorry I forget what work I have done during the process. Maybe two ways: copy some dlls to directory where the system can find them by PATH; or, I installed VS studio 2019 to test whether dirver version and cuda version are the same.

Thank you very much. Later, I will record more details about how “bugs” occur and are resolved.

In principle, it should be working out of the box, esp. when you have the cuda runtime as a dependency.

Also just note that the official docs can be found at https://deeplearning4j.konduit.ai/.