We have a very large Java modelling application at work, the great majority of its cpu time is spent computing FFTs.
This app has too much work put into it to just toss and start over with C/CUDA to get a speed up. But the idea is that
since so much of the time is spent doing FFTs, JNI could call to CUDA to do the FFTs and the Java could remain as is.
My platform is: CUDA 2.2 (driver, sdk,toolkit), openjdk 18.104.22.168, gcc 4.3.2, Fedora Linux (Fedora 10 x86_64), Netbeans 6.1 IDE,
and the card is a 8800GTX.
The JNI calls some CUDA CUFFT functions like cufftPlan1d() and so on (the C shared object is compiled out of
the .cu file and the Java app loads this via System.loadLibrary(String) to do the FFTs.
I think the so file is found and looked into but I always get at runtime:
I’ve used System.getProperty() to confirm that the java.library.path is correct (ie the directory that contains my JNI CUDA so file)
“boolean isCudaAvailable()” is the first method in the so file I use, I wrote it to determine if the host has CUDA support (CUDA capable card + toolkit/driver). If not, I fall back to the legacy math library the java code is already using.
I pass the so file path to the java app via -Djava.library.path=/ on the command line
My suspicion is that JNI wants the function call like this in the CUDA so file:
blahblah_Java_Packagename_Classname_jnimethod (in my case :
but the nvcc compiler is setting up the function name differently than how g++ would do it?
This is my JNI so Makefile:
Is there a problem with my arguments in calling nvcc that makes this not work? I’m thinking the nvcc section might be missing a critical option.