Hello everyone. I’m trying to work with CUDA with Java, because I believe that is quicker to develop rather than C code… however, i’m not able to even compile a simple sample like the piece of code bellow:
import java.util.*;
import jcuda.;
import jcuda.jcublas.;
import jcuda.jcudpp.;
import jcuda.jcufft.;
import jcuda.runtime.*;
public class Main
{
public static void main(String args[])
{
System.out.println(„Creating input data“);
// Create some input data
int complexElements = 100;
int floatElements = complexElements * 2;
int memorySize = floatElements * Sizeof.FLOAT;
float hostX[] = createRandomFloatData(floatElements);
float hostY[] = createRandomFloatData(floatElements);
System.out.println("Initializing device data using JCuda");
// Allocate memory on the device using JCuda
Pointer deviceX = new Pointer();
Pointer deviceY = new Pointer();
JCuda.cudaMalloc(deviceX, memorySize);
with the output:
Creating input data
Error while loading native library with base name „JCudaRuntime“
Initializing device data using JCuda
Operating system name: Windows 7
Architecture : x86
Architecture bit size: 32
Exception in thread „main“ java.lang.UnsatisfiedLinkError: Could not load native library
at jcuda.LibUtils.loadLibrary(LibUtils.java:79)
at jcuda.runtime.JCuda.assertInit(JCuda.java:225)
at jcuda.runtime.JCuda.cudaMalloc(JCuda.java:1513)
at cudatest.Main.main(Main.java:42)
Java Result: 1
i’ve downloaded all .jar libs from windows x64bits to netbeans and all DLL’s which came in the same package to c:\windows\system32… NOTHING changed that exception. Can anyone help, please?