So the FAQ didn't help

I am having that UnsatisfiedLinkerError. I have done literally everything in the FAQ about it, from altering the classpath, putting the .dlls and jars next to the files, etc. and even variations on that, pointing to different folders where I have copied the .jars and .dlls in the PATH and CLASSPATH, doing the same with the VM arguments, making a new PATH variable (I have a Path variable as well). I have told Java where the .jars are and had the .dlls next to them, I have configured the build path, I have done literally everything. I have googled the errors ambiguously and still have not been able to come up with a solution.

The only thing that worked is the Test file thing in the FAQ. However I do not know how to translate that to my current project (a lot of the code and organization is from someone else). I have placed the .dlls and .jars in every conceivable folder that could possibly remotely require them.

System info
Operating System: Windows XP Professional (5.1, Build 2600) Service Pack 3 (2600.xpsp_sp3_gdr.101209-1647) [Pretty sure it’s 32 bit, but there’s nowhere on my computer where it specifies]
Language: English (Regional Setting: English)
System Manufacturer: Hewlett-Packard
Model: HP Compaq dc7600 Convertible
BIOS: Default System BIOS
Processor: Intel® Pentium® 4 CPU 3.20GHz (2 CPUs)
Memory: 3320MB RAM
Page File: 1107MB used, 4094MB available

CUDA
I have both versoin 4.0 of the CUDA toolkit, tools, and sdk installed. I used the cudatoolkit_4.0.17_win_32.msi and
cudatools_4.0.17_win_32.msi
to install the files on my computer, took the .dlls and .jars from installed folder at C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin, and placed them in the proper folders. This was also one of the paths I used for the various VM arguments, PATH and CLASSPATH, etc.

Errors:
With VM Arguments of -Djava.library.path=C:\Documents and Settings<username>\workspace\RevEngr
java.lang.NoClassDefFoundError: and
Caused by: java.lang.ClassNotFoundException: and
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Exception in thread “main”

Without VM Arguments

Error while loading native library “JCudaDriver-windows-x86” with base name “JCudaDriver”
Operating system name: Windows XP
Architecture : x86
Architecture bit size: 32
Stack trace from the attempt to load the library as a resource:
java.lang.NullPointerException: No resource found with name ‘/lib/JCudaDriver-windows-x86.dll’
at jcuda.LibUtils.loadLibraryResource(LibUtils.java:144)
at jcuda.LibUtils.loadLibrary(LibUtils.java:80)
at jcuda.driver.JCudaDriver.(JCudaDriver.java:192)
at com.place.gds.NikolasWorkspace.NikolasWorkshop.(NikolasWorkshop.java:39)
at com.place.gds.NikolaTesla.main(NikolaTesla.java:19)
Stack trace from the attempt to load the library as a file:
java.lang.UnsatisfiedLinkError: C:\Documents and Settings<username>\workspace\RevEngr\JCudaDriver-windows-x86.dll: The specified procedure could not be found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1732)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at jcuda.LibUtils.loadLibrary(LibUtils.java:90)
at jcuda.driver.JCudaDriver.(JCudaDriver.java:192)
at com.place.gds.NikolasWorkspace.NikolasWorkshop.(NikolasWorkshop.java:39)
at com.place.gds.NikolaTesla.main(NikolaTesla.java:19)

Exception in thread “main” java.lang.UnsatisfiedLinkError: Could not load the native library
at jcuda.LibUtils.loadLibrary(LibUtils.java:122)
at jcuda.driver.JCudaDriver.(JCudaDriver.java:192)
at com.place.gds.NikolasWorkspace.NikolasWorkshop.(NikolasWorkshop.java:39)
at com.place.gds.NikolaTesla.main(NikolaTesla.java:19)

Directory example:
This is how the directory for my project is set up.

Folder:src
package:com.place.gds
package:com.place.gds.comm
package:com.place.gds.NikolasWorkspace
package:com.place.gds.optionsfutures
package:com.place.gds.quote

I have actually physically placed (in both Windows file system and Eclipse) every .jar and .dll that comes with the toolkit and sdk. I have included them in the src folder as well.

I have no idea what to do. Halp?

OK, a lot of information, I’ll try to break it into smaller pieces

You talked about different versions of the CUDA toolkit. Which versions do you mean? When you are talking about CUDA 4.0 RC2 (build 13), and the final version (build 17): By default, they have been installed into the same directory. Usually, I first UNinstalled the old Toolkit before I installed the new one, and I think that’s also recommended by NVIDIA - I’m not sure if installing the new version on top of the old one could cause problems… If you do not specifically need both versions, you might try to remove them and install only the latest one, namely the cudatoolkit_4.0.17_win_32.msi.

Which version of JCuda are you using? Make sure it’s “Version 0.4.0-beta1”.

The only thing that worked is the Test file thing in the FAQ. However I do not know how to translate that to my current project (a lot of the code and organization is from someone else). I have placed the .dlls and .jars in every conceivable folder that could possibly remotely require them.

The fact that the “Test file thing” (i.e. the JCudaRuntimeTest?) worked ist promising. However, copying files around into different direcories should not be necessary. With a properly installed toolkit, the CUDA DLLs should be found, because their path is added to the PATH Environment variable (“PATH” and “Path” should be the same here). Everything else should just be a matter of the classpath or the java.library path.

**took the .dlls and .jars from installed folder at C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin, and placed them in the proper folders. **

Sorry, can you elaborate that? What are the “proper” folders? Specifically:

  • Did you copy the DLL files from the NVIDIA directory into your project directory? (this should NOT be necessary!)
  • Did you copy the JAR and DLL from the JCuda download into the NVIDIA directory? (this should also NOT be necessary)
    After an installation of the CUDA Toolkit, it should not be necessary to touch any of its DLLs, and it should not be necessary to manually specify the path to the toolkit anywhere. To use JCuda, you usually will have the JARs and DLLs from the JCuda download in your project directory.

**
With VM Arguments of -Djava.library.path=C:\Documents and Settings<username>\workspace\RevEngr
java.lang.NoClassDefFoundError: and
**

This error message is solely due to missing ““quotation marks””: It interprets ‘and’ as a class name. It should be
-Djava.library.path=“C:\Documents and Settings<username>\workspace\RevEngr”
or alternatively a simple directory (which only must contain the JCuda DLLs) like
-Djava.library.path=C:\JCudaDLLs

Concerning the other error message:

java.lang.UnsatisfiedLinkError: C:\Documents and Settings<username>\workspace\RevEngr\JCudaDriver-windows-x86.dll: The specified procedure could not be found

This error message has been reported once in another thread, but the thread opener did not post anything afterwards. This error message is not (yet) covered in the FAQ, but admittedly, I’m not sure what causes it. A websearch brought some results which indicate that it might be related to an old version of a DLL that is referenced by the JCuda DLL, but this should only be one, namely the nvcuda.dll. Just as a rough indication, really just a guess: Could you check the date and size of your file
C:\Windows\system32
vcuda.dll
? For me it is 17.05.2011 and 5222400 Bytes (5100 KB). (But please do NOT attempt to modify the contents of this folder in any way, regardless of whether or not you have the same file there!)

bye
Marco

[QUOTE=Marco13]OK, a lot of information, I’ll try to break it into smaller pieces

You talked about different versions of the CUDA toolkit. Which versions do you mean? When you are talking about CUDA 4.0 RC2 (build 13), and the final version (build 17): By default, they have been installed into the same directory. Usually, I first UNinstalled the old Toolkit before I installed the new one, and I think that’s also recommended by NVIDIA - I’m not sure if installing the new version on top of the old one could cause problems… If you do not specifically need both versions, you might try to remove them and install only the latest one, namely the cudatoolkit_4.0.17_win_32.msi.

Which version of JCuda are you using? Make sure it’s „Version 0.4.0-beta1“.[/QUOTE]

Sorry, that was a bit of a typo. I meant version 4.0 of the tools, toolkit and sdk. The most current version downloadable from Nvidia. The version installed with cudatoolkit_4.0.17_win_32.msi. I do not have a previous version installed on the computer, nor do I have any sort of previous driver versions, as the onboard graphics card is ATI. I downloaded them within the past week.

Yes I did all of those things. Before I did them, it threw the same run-time error(s) and it continues to do them even after I did what the FAQ said.

[QUOTE=Marco13;15588]**With VM Arguments of -Djava.library.path=C:\Documents and Settings<username>\workspace\RevEngr
java.lang.NoClassDefFoundError: and
**

This error message is solely due to missing „„quotation marks““: It interprets ‚and‘ as a class name. It should be
-Djava.library.path=„C:\Documents and Settings<username>\workspace\RevEngr“
or alternatively a simple directory (which only must contain the JCuda DLLs) like
-Djava.library.path=C:\JCudaDLLs[/QUOTE]

It seems excessively silly that I didn’t figure this one out. I figured there was actually something referred to as an „and“ exception, due to being a former computer engineer. Haha, AND gates. I attempted the correction for this. It goes back to my original unsatisfiedlinkererror, just with whatever directory I point to and the .dll as the file. For instance C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\JCudaDriver-windows-x86.dll: the specified procedure could not be found.

[QUOTE=Marco13;15588]Concerning the other error message:

java.lang.UnsatisfiedLinkError: C:\Documents and Settings<username>\workspace\RevEngr\JCudaDriver-windows-x86.dll: The specified procedure could not be found

This error message has been reported once in another thread, but the thread opener did not post anything afterwards. This error message is not (yet) covered in the FAQ, but admittedly, I’m not sure what causes it. A websearch brought some results which indicate that it might be related to an old version of a DLL that is referenced by the JCuda DLL, but this should only be one, namely the nvcuda.dll. Just as a rough indication, really just a guess: Could you check the date and size of your file
C:\Windows\system32
vcuda.dll
? For me it is 17.05.2011 and 5222400 Bytes (5100 KB). (But please do NOT attempt to modify the contents of this folder in any way, regardless of whether or not you have the same file there!)

bye
Marco[/QUOTE]

So the size of my nvcuda.dll is 4.38 MB (4,595,712 bytes). The file version is 6.14.12.5896, the product name is NVIDIA CUDA 3.1.1 driver and the product version is the same as the file version. The date for it I believe is 10.7.2010, as in July 10th, 2010. This might be the problem.

Turns out it was the nvcuda.dll. I was apparently wrong about there not being previous driver versions on my computer. Why they were there I have no idea, as this machine has never seen an nvidia device before the Tesla C1060 I put in it yesterday. All well, I installed updated drivers and now it works. Perhaps that’s one solution to the unsatisfied linker error?

Good to hear that :slight_smile:

The first part of your post caused some confusion when you talked about your onboard ATI graphics - for a moment I thought you tried to run CUDA on this :smiley:

I’ll update the FAQ, mentioning that the „The specified procedure could not be found“-error might be caused by an out-dated DLL (which, in turn, may be related to older driver or toolkit installations).

Maybe I’ll also try to „generalize“ it, since the „UnsatisfiedLinkError“ is spookily common for everything and everybody working with JNI, and a collection of possible explainations for the error message might also be interesting for developers who not specifically work with JCuda.