Add CUDA to an SBT project

At the easiest, changing from the CPU version of ND4J / ND4S should be as simple as changing the dependency in your build.sbt:

libraryDependencies += "org.nd4j" % "nd4j-cuda-8.0-platform" % "0.9.1"
libraryDependencies += "org.nd4j" % "nd4j-native-platform" % "0.8.0"

If you get a module resolution error, you need to delete ~/.ivy.

failed cuda;8.0-6.0-1.3!cuda.jar

I had to switch back to 2.11:

scalaVersion := "2.11.11"

If you let Intellij fill in references for you, you may need to remove bad references to NDArray in the cpu namespace (use INDArray instead).

import org.nd4j.linalg.cpu.nativecpu.NDArray

Leave a Reply

Your email address will not be published. Required fields are marked *