2
  1. NVidia does not distribute the NSight IDE for Windows (only Linux and MacOSX)
  2. I don't want to use Visual Studio because I'm not familiar with it; being a Java developer I prefer Eclipse.
  3. I want to use Maven, because well everyone should, and Mavenized JCuda seems like a good start.

So here's what I did:

  1. Downloaded version 6.5 of CUDA Developer Toolkit from the NVidia website.
  2. Got Eclipse J2EE edition, because it has built-in Maven support.
  3. Cloned the mavenized-jcuda project into my workspace.
  4. Tried to run the example program, but got errors.

Stack Trace:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load the native library.
Error while loading native library "JCudaRuntime-windows-x86_64" with base name "JCudaRuntime"
...
java.lang.NullPointerException: No resource found with name '/lib/JCudaRuntime-windows-x86_64.dll'
...
java.lang.UnsatisfiedLinkError: no JCudaRuntime-windows-x86_64 in java.library.path
...

I tried adding a bunch of paths to my -Djava.library.path="..." JVM argument, including:

  • C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5
  • C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin
  • C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\lib\x64
  • etc...

But still getting the same error. What's even more concerning is that there is no such file anywhere on my computer by that name (JCudaRuntime-windows-x86_64.dll). So how do I resolve these linking issues?

talonmies
  • 70,661
  • 34
  • 192
  • 269
James Watkins
  • 4,806
  • 5
  • 32
  • 42
  • Does the test that is described on the github site work for your (basically `mvn clean package` and then `mvn exec:exec` at the console), or does it also result in an UnsatisfiedLinkError? – Marco13 Feb 04 '15 at 23:16
  • Running through Maven alone is successful. Sorry for not mentioning that. But not through eclipse, even with Maven dependency management enabled. – James Watkins Feb 04 '15 at 23:20
  • 2
    I only tried it on the console until now, but if there's no answer until tomorrow, I'll give it a try in eclipse. In any case, the `-Djava.library.path` should point to the directory that contains the native *JCuda* DLL files (this will probably be in some "`target/lib`" subdirectory that is created by Maven during the build) – Marco13 Feb 04 '15 at 23:24
  • so, the problem is only if you try to run it inside Eclipse? – Mysterion Feb 04 '15 at 23:28
  • @JamesWatkins, could you list you target/lib directory? – Mysterion Feb 04 '15 at 23:29
  • Added the following to JVM arguments: -Djava.library.path=${workspace_loc:mavenized-jcuda}\target\lib now it's working. Thanks! – James Watkins Feb 04 '15 at 23:30
  • but maven should do it itself without adding java.library.path, that's the trick of mavenized jcuda itself :) could you please provide more information on how you run mavenized jcuda project? – Mysterion Feb 04 '15 at 23:33
  • 1
    @Mysterion, I wanted to invoke the app from eclipse without getting Maven involed (for cleaner console output). So I just had to duplicate the JVM arg from the exec config in the pom.xml to the eclipse run config and it worked. At least now Google will have a search result when someone has the same problem :) – James Watkins Feb 04 '15 at 23:37
  • One more thing, just in case it helps anyone, if you go to Project->Properties->Java Build Path->src/main/java->Native library location and add the /target/lib folder, you don't need to edit your run configurations. – James Watkins Feb 04 '15 at 23:55
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70274/discussion-between-james-watkins-and-mysterion). – James Watkins Feb 05 '15 at 03:11
  • 2
    @Mysterion or James Please add your answer as an answer. – Aleksandr Dubinsky Jul 05 '15 at 01:36

0 Answers0