Add support for CUDA 10.2 (#89)

master
Samuel Audet 2019-11-29 14:31:03 +09:00 committed by Alex Black
parent 009007120b
commit 5e07998e59
89 changed files with 193 additions and 147 deletions

View File

@ -91,7 +91,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -70,7 +70,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -56,7 +56,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -37,7 +37,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -151,7 +151,7 @@
<skip>${skipTestResourceEnforcement}</skip>
<rules>
<requireActiveProfile>
<profiles>test-nd4j-native,test-nd4j-cuda-10.1</profiles>
<profiles>test-nd4j-native,test-nd4j-cuda-10.2</profiles>
<all>false</all>
</requireActiveProfile>
</rules>
@ -333,11 +333,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${nd4j.version}</version>
<scope>test</scope>
</dependency>

View File

@ -20,7 +20,7 @@
set -e
VALID_VERSIONS=( 9.2 10.0 10.1 )
VALID_VERSIONS=( 9.2 10.0 10.1 10.2 )
usage() {
echo "Usage: $(basename $0) [-h|--help] <cuda version to be used>
@ -47,6 +47,10 @@ check_cuda_version() {
check_cuda_version "$VERSION"
case $VERSION in
10.2)
VERSION2="7.6"
VERSION3="1.5.2"
;;
10.1)
VERSION2="7.6"
VERSION3="1.5.2"

View File

@ -117,7 +117,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -56,7 +56,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -110,7 +110,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -72,7 +72,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -59,7 +59,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -126,7 +126,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -67,7 +67,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -58,7 +58,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -58,7 +58,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -49,7 +49,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -67,7 +67,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -65,7 +65,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -88,7 +88,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -59,7 +59,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -65,7 +65,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -58,7 +58,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -52,7 +52,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -171,7 +171,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -38,7 +38,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -138,7 +138,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -112,7 +112,7 @@
<skip>${skipTestResourceEnforcement}</skip>
<rules>
<requireActiveProfile>
<profiles>test-nd4j-native,test-nd4j-cuda-10.1</profiles>
<profiles>test-nd4j-native,test-nd4j-cuda-10.2</profiles>
<all>false</all>
</requireActiveProfile>
</rules>
@ -365,11 +365,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${nd4j.version}</version>
<scope>test</scope>
</dependency>

View File

@ -40,7 +40,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -163,11 +163,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -16,7 +16,7 @@
<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>deeplearning4j-cuda-10.1</artifactId>
<artifactId>deeplearning4j-cuda-10.2</artifactId>
<name>deeplearning4j-cuda</name>
<parent>
<groupId>org.deeplearning4j</groupId>
@ -26,7 +26,7 @@
<properties>
<!-- CUDA version is linked with the artifact name so cannot move to parent pom.xml -->
<cuda.version>10.1</cuda.version>
<cuda.version>10.2</cuda.version>
<cudnn.version>7.6</cudnn.version>
<javacpp-presets.cuda.version>1.5.2</javacpp-presets.cuda.version>
</properties>
@ -106,7 +106,7 @@
</build>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -51,7 +51,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -46,7 +46,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -48,7 +48,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -38,7 +38,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -116,11 +116,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -58,7 +58,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -62,7 +62,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -41,7 +41,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -302,11 +302,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -115,11 +115,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -119,11 +119,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -54,7 +54,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -53,7 +53,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -83,11 +83,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -44,7 +44,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -66,7 +66,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -68,7 +68,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -61,7 +61,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -79,7 +79,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -84,7 +84,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -42,7 +42,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -124,7 +124,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -93,14 +93,14 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -24,7 +24,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -93,7 +93,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -102,11 +102,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -97,7 +97,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -39,7 +39,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -67,7 +67,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -72,7 +72,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -73,7 +73,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -98,7 +98,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -181,7 +181,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -74,7 +74,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -106,7 +106,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -32,7 +32,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -72,7 +72,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -440,7 +440,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -49,7 +49,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -52,7 +52,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -78,7 +78,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>

View File

@ -113,7 +113,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -122,7 +122,7 @@
<id>test-nd4j-native</id>
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
</profile>
</profiles>
</project>

View File

@ -226,7 +226,7 @@
<skip>${skipBackendChoice}</skip>
<rules>
<requireActiveProfile>
<profiles>test-nd4j-native,test-nd4j-cuda-10.1</profiles>
<profiles>test-nd4j-native,test-nd4j-cuda-10.2</profiles>
<all>false</all>
</requireActiveProfile>
</rules>
@ -501,7 +501,7 @@
</profile>
<!-- For running unit tests with nd4j-cuda-8.0: "mvn clean test -P test-nd4j-cuda-8.0" -->
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
@ -514,7 +514,7 @@
</dependency>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${nd4j.version}</version>
<scope>test</scope>
</dependency>

View File

@ -10,17 +10,8 @@ weight: 3
Deeplearning4j supports CUDA but can be further accelerated with cuDNN. Most 2D CNN layers (such as ConvolutionLayer, SubsamplingLayer, etc), and also LSTM and BatchNormalization layers support CuDNN.
The only thing we need to do to have DL4J load cuDNN is to add a dependency on `deeplearning4j-cuda-9.2`, `deeplearning4j-cuda-10.0`, or `deeplearning4j-cuda-10.1`, for example:
The only thing we need to do to have DL4J load cuDNN is to add a dependency on `deeplearning4j-cuda-10.0`, `deeplearning4j-cuda-10.1`, or `deeplearning4j-cuda-10.2` for example:
```xml
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-cuda-9.2</artifactId>
<version>{{page.version}}</version>
</dependency>
```
or
```xml
<dependency>
<groupId>org.deeplearning4j</groupId>
@ -38,6 +29,16 @@ or
</dependency>
```
or
```xml
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-cuda-10.2</artifactId>
<version>{{page.version}}</version>
</dependency>
```
The actual library for cuDNN is not bundled, so be sure to download and install the appropriate package for your platform from NVIDIA:
* [NVIDIA cuDNN](https://developer.nvidia.com/cudnn)
@ -48,39 +49,20 @@ Note there are multiple combinations of cuDNN and CUDA supported. At this time t
<th>CUDA Version</th>
<th>cuDNN Version</th>
</tr>
<tr><td>9.2</td><td>7.2</td></tr>
<tr><td>10.0</td><td>7.4</td></tr>
<tr><td>10.1</td><td>7.6</td></tr>
<tr><td>10.2</td><td>7.6</td></tr>
</table>
To install, simply extract the library to a directory found in the system path used by native libraries. The easiest way is to place it alongside other libraries from CUDA in the default directory (`/usr/local/cuda/lib64/` on Linux, `/usr/local/cuda/lib/` on Mac OS X, and `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\`, `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\`, or `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\` on Windows).
To install, simply extract the library to a directory found in the system path used by native libraries. The easiest way is to place it alongside other libraries from CUDA in the default directory (`/usr/local/cuda/lib64/` on Linux, `/usr/local/cuda/lib/` on Mac OS X, and `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\`, `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\`, or `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\` on Windows).
Alternatively, in the case of CUDA 10.1, cuDNN comes bundled with the "redist" package of the [JavaCPP Presets for CUDA](https://github.com/bytedeco/javacpp-presets/tree/master/cuda). [After agreeing to the license](https://github.com/bytedeco/javacpp-presets/tree/master/cuda#license-agreements), we can add the following dependencies instead of installing CUDA and cuDNN:
Alternatively, in the case of CUDA 10.2, cuDNN comes bundled with the "redist" package of the [JavaCPP Presets for CUDA](https://github.com/bytedeco/javacpp-presets/tree/master/cuda). [After agreeing to the license](https://github.com/bytedeco/javacpp-presets/tree/master/cuda#license-agreements), we can add the following dependencies instead of installing CUDA and cuDNN:
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>cuda</artifactId>
<version>10.1-7.6-1.5.2</version>
<classifier>linux-x86_64-redist</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>cuda</artifactId>
<version>10.1-7.6-1.5.2</version>
<classifier>linux-ppc64le-redist</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>cuda</artifactId>
<version>10.1-7.6-1.5.2</version>
<classifier>macosx-x86_64-redist</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>cuda</artifactId>
<version>10.1-7.6-1.5.2</version>
<classifier>windows-x86_64-redist</classifier>
<artifactId>cuda-platform-redist</artifactId>
<version>10.2-7.6-1.5.2</version>
</dependency>
Also note that, by default, Deeplearning4j will use the fastest algorithms available according to cuDNN, but memory usage may be excessive, causing strange launch errors. When this happens, try to reduce memory usage by using the [`NO_WORKSPACE` mode settable via the network configuration](/api/{{page.version}}/org/deeplearning4j/nn/conf/layers/ConvolutionLayer.Builder.html#cudnnAlgoMode-org.deeplearning4j.nn.conf.layers.ConvolutionLayer.AlgoMode-), instead of the default of `ConvolutionLayer.AlgoMode.PREFER_FASTEST`, for example:

View File

@ -64,7 +64,7 @@
<properties>
<!-- CUDA version is linked with the artifact name so cannot move to parent pom.xml -->
<cuda.version>10.1</cuda.version>
<cuda.version>10.2</cuda.version>
<cudnn.version>7.6</cudnn.version>
<libnd4j.build>release</libnd4j.build>
<libnd4j.chip>cpu</libnd4j.chip>

View File

@ -22,12 +22,12 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>nd4j-cuda-10.1-platform</artifactId>
<artifactId>nd4j-cuda-10.2-platform</artifactId>
<name>nd4j-cuda-platform</name>
<properties>
<!-- CUDA version is linked with the artifact name so cannot move to parent pom.xml -->
<cuda.version>10.1</cuda.version>
<cuda.version>10.2</cuda.version>
<cudnn.version>7.6</cudnn.version>
<javacpp-presets.cuda.version>1.5.2</javacpp-presets.cuda.version>
<nd4j.backend>nd4j-cuda-${cuda.version}</nd4j.backend>

View File

@ -22,12 +22,12 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<name>nd4j-cuda</name>
<properties>
<!-- CUDA version is linked with the artifact name so cannot move to parent pom.xml -->
<cuda.version>10.1</cuda.version>
<cuda.version>10.2</cuda.version>
<cudnn.version>7.6</cudnn.version>
<javacpp-presets.cuda.version>1.5.2</javacpp-presets.cuda.version>
</properties>
@ -95,6 +95,17 @@
<artifactId>nd4j-native-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>cuda</artifactId>
<version>${cuda.version}-${cudnn.version}-${javacpp-presets.cuda.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>cuda</artifactId>
<version>${cuda.version}-${cudnn.version}-${javacpp-presets.cuda.version}</version>
<classifier>${dependency.platform}</classifier>
</dependency>
</dependencies>
<configuration>
<properties>${javacpp.platform}</properties>

View File

@ -7627,9 +7627,9 @@ public static final int PREALLOC_SIZE = 33554432;
* the given shape info buffer
* represents a scalar shape
*/
@Namespace("shape") public static native int isScalar(@Cast("Nd4jLong*") LongPointer info);
@Namespace("shape") public static native int isScalar(@Cast("Nd4jLong*") LongBuffer info);
@Namespace("shape") public static native int isScalar(@Cast("Nd4jLong*") long[] info);
@Namespace("shape") public static native int isScalar(@Cast("const Nd4jLong*") LongPointer info);
@Namespace("shape") public static native int isScalar(@Cast("const Nd4jLong*") LongBuffer info);
@Namespace("shape") public static native int isScalar(@Cast("const Nd4jLong*") long[] info);
/**
* Returns whether
@ -8033,6 +8033,9 @@ public static final int PREALLOC_SIZE = 33554432;
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") LongPointer shape, @Cast("Nd4jLong*") LongPointer coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") LongBuffer shape, @Cast("Nd4jLong*") LongBuffer coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") long[] shape, @Cast("Nd4jLong*") long[] coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") LongPointer shape, IntPointer coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") LongBuffer shape, IntBuffer coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") long[] shape, int[] coords);
/**
* take into account only dimensions stored in tadDims, tadDims must be sorted in increasing order!
*/
@ -9127,6 +9130,8 @@ public static final int PREALLOC_SIZE = 33554432;
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

View File

@ -16,6 +16,10 @@
package org.nd4j.nativeblas;
import java.util.List;
import org.bytedeco.javacpp.ClassProperties;
import org.bytedeco.javacpp.LoadEnabled;
import org.bytedeco.javacpp.Loader;
import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.Properties;
import org.bytedeco.javacpp.tools.Info;
@ -111,7 +115,42 @@ import org.bytedeco.javacpp.tools.InfoMapper;
@Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}),
@Platform(value = "linux-ppc64", preloadpath = {"/usr/powerpc64-linux-gnu/lib/", "/usr/powerpc64le-linux-gnu/lib/", "/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}),
@Platform(value = "windows", preload = {"libwinpthread-1", "libgcc_s_seh-1", "libgomp-1", "libstdc++-6", "libnd4jcpu"}) })
public class Nd4jCudaPresets implements InfoMapper {
public class Nd4jCudaPresets implements LoadEnabled, InfoMapper {
@Override public void init(ClassProperties properties) {
String platform = properties.getProperty("platform");
List<String> preloads = properties.get("platform.preload");
List<String> resources = properties.get("platform.preloadresource");
// Only apply this at load time since we don't want to copy the CUDA libraries here
if (!Loader.isLoadLibraries()) {
return;
}
int i = 0;
String[] libs = {"cudart", "cublasLt", "cublas", "cusolver", "cusparse", "cudnn"};
for (String lib : libs) {
switch (platform) {
case "linux-arm64":
case "linux-ppc64le":
case "linux-x86_64":
case "macosx-x86_64":
lib += lib.equals("cudnn") ? "@.7" : lib.equals("cudart") ? "@.10.2" : "@.10";
break;
case "windows-x86_64":
lib += lib.equals("cudnn") ? "64_7" : lib.equals("cudart") ? "64_102" : "64_10";
break;
default:
continue; // no CUDA
}
if (!preloads.contains(lib)) {
preloads.add(i++, lib);
}
}
if (i > 0) {
resources.add("/org/bytedeco/cuda/");
}
}
@Override
public void map(InfoMap infoMap) {
infoMap.put(new Info("thread_local", "ND4J_EXPORT", "INLINEDEF", "CUBLASWINAPI", "FORCEINLINE",

View File

@ -7630,9 +7630,9 @@ public static final int PREALLOC_SIZE = 33554432;
* the given shape info buffer
* represents a scalar shape
*/
@Namespace("shape") public static native int isScalar(@Cast("Nd4jLong*") LongPointer info);
@Namespace("shape") public static native int isScalar(@Cast("Nd4jLong*") LongBuffer info);
@Namespace("shape") public static native int isScalar(@Cast("Nd4jLong*") long[] info);
@Namespace("shape") public static native int isScalar(@Cast("const Nd4jLong*") LongPointer info);
@Namespace("shape") public static native int isScalar(@Cast("const Nd4jLong*") LongBuffer info);
@Namespace("shape") public static native int isScalar(@Cast("const Nd4jLong*") long[] info);
/**
* Returns whether
@ -8036,6 +8036,9 @@ public static final int PREALLOC_SIZE = 33554432;
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") LongPointer shape, @Cast("Nd4jLong*") LongPointer coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") LongBuffer shape, @Cast("Nd4jLong*") LongBuffer coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") long[] shape, @Cast("Nd4jLong*") long[] coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") LongPointer shape, IntPointer coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") LongBuffer shape, IntBuffer coords);
@Namespace("shape") public static native void index2coords(@Cast("Nd4jLong") long index, int rank, @Cast("const Nd4jLong*") long[] shape, int[] coords);
/**
* take into account only dimensions stored in tadDims, tadDims must be sorted in increasing order!
*/
@ -9130,6 +9133,8 @@ public static final int PREALLOC_SIZE = 33554432;
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

View File

@ -225,7 +225,7 @@
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@ -208,7 +208,7 @@
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

View File

@ -107,7 +107,7 @@
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -163,7 +163,7 @@
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -284,7 +284,7 @@
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
@ -316,12 +316,12 @@
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1-platform</artifactId>
<artifactId>nd4j-cuda-10.2-platform</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

View File

@ -312,11 +312,11 @@
</profile>
<profile>
<id>test-nd4j-cuda-10.1</id>
<id>test-nd4j-cuda-10.2</id>
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -127,7 +127,7 @@
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

View File

@ -293,7 +293,7 @@
<dependencies>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-cuda-10.1</artifactId>
<artifactId>nd4j-cuda-10.2</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>