{"id":5576,"date":"2018-01-02T02:24:49","date_gmt":"2018-01-02T02:24:49","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=5576"},"modified":"2018-01-02T02:24:49","modified_gmt":"2018-01-02T02:24:49","slug":"add-cuda-sbt-project","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/add-cuda-sbt-project\/","title":{"rendered":"Add CUDA to an SBT project"},"content":{"rendered":"<p>At the easiest, changing from the CPU version of ND4J \/ ND4S should be as simple as changing the dependency in your build.sbt:<\/p>\n<pre lang=\"scala\">\nlibraryDependencies += \"org.nd4j\" % \"nd4j-cuda-8.0-platform\" % \"0.9.1\"\nlibraryDependencies += \"org.nd4j\" % \"nd4j-native-platform\" % \"0.8.0\"\n<\/pre>\n<p>If you get a module resolution error, you need to delete ~\/.ivy.<\/p>\n<pre>\nfailed cuda;8.0-6.0-1.3!cuda.jar\n<\/pre>\n<p>I had to switch back to 2.11:<\/p>\n<pre lang=\"scala\">\nscalaVersion := \"2.11.11\"\n<\/pre>\n<p>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).<\/p>\n<pre lang=\"scala\">\nimport org.nd4j.linalg.cpu.nativecpu.NDArray\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Use cuda in sbt<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9],"tags":[131,479,480],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5576"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=5576"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5576\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=5576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=5576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=5576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}