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

Interested in Scala? I send out weekly, personalized emails with articles and conference talks. Click here to see an example and subscribe.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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