Java Lookup Error

Cuda 4.0
Latest Jcuda 0.4
Linux Redhat 5.3

Trying to run VectorAdd and getting:

java: symbol lookup error: /tmp/ undefined symbol: cuCtxCreate_v2

any insights?

Thank you!


The path looks strange - where does the
come from? Did you put the native libs into the JAR? (In general, this should work, but not “officially”, since it was not really tested yet).

The “undefined symbol” error message once occurred because of the Linux64 binaries not being built properly, but recently, recently, they have usually been working.

Although I have doubts that many people will read this: Can anyone using Linux64 confirm that the Linux64 binaries work in the current version?

Could you test other programs, like the “Basic Test” from ? Or maybe even the original CUDA samples from NVIDIA, to see whether CUDA is working in general?


BasicTest works without errors, not sure why I get “/tmp/”


This is just a guess, but it helped with a similar problem recently: Did you previously have any older CUDA version installed? At the bottom of this post, I described a rough hint of how this may be found out, but only for Windows (Right click on C:\Windows\system32
vcuda.dll -> Select “Properties” -> Tab: Version, to see whether this DLL really belongs to CUDA 4.0). Maybe something similar is possible on Linux…?

However, this still does not explain the strange path name. Could you post the full stack trace of the error message?

If this does not help, I’ll ask the contributor of the library whether he has an idea.


I did have an older CUDA version but It was completely removed. All I get is this one line:

/slc/swb/java_sdks/Linux64/jdk1.6.0_21/bin/java: symbol lookup error: /tmp/ undefined symbol: cuCtxCreate_v2

At the moment, I have no idea what this might mean. Can you have a look at your “tmp”-directory, to see whether this file actually exists, and maybe compare its size and date to the “” from the downloaded package?

The file exists in my /tmp path. With the same size of the file from the package.

I noticed that each time I run the code it creates a new copy of the file with a different name.

Well, this is strange.

The mechansim for loading the native library has been extended int order to provide the option to put the native libraries into the JAR file (and load them directly from the JAR). It tries to read the native library from the JAR and store it as a temporary file in the ‘tmp’ directory. This is not yet fully supported, and in any case, when it does not find the library in the JAR, it should fallback to the usual method of taking the native library from the file system.

It seems that this does not work properly in this case: Somehow it creates the temporary file, and somehow it seems to be able to fill it with data (no idea where this data comes from, since it can definitely not be found in the JAR).

I’ll try to create a JAR where this functionality is switched off, and where it only tries to load the library in the “usual” way, and send you a link via PN.

I assume that this will not solve the actual problem (“undefined symbol: cuCtxCreate_v2”), but it might help to narrow down the possible reasons for this error. In doubt, I’ll contact the contributor of the library.

Now I get this:

/slc/swb/java_sdks/Linux64/jdk1.6.0_21/bin/java: symbol lookup error: /home/ecc_14/hashfa0a/JCUDA/ undefined symbol: cuCtxCreate_v2

So the/tmp thing is gone, like you expected.

OK, then I’ll ask the contributor of the library if he knows what might be wrong there, and post the response here as soon as possible.

EDIT: BTW, still no more detailed error message? That’s stange, it should at least print a stack trace (although this would probably also not help so much now)