Kernel Launcher problem NoSuchMethodException

Hi everyone,
I am new to this board (and in fact for some reason unregistered although I thought I did) so please excuse me if I post in the wrong thread.

However, I have a problem calling a formerly compiled kernel using the KernelLauncher from jcuda.utils.
I tried various different kernels and for the sake of testing even the sample from jcuda.org which you hopefully see here:


__global__ void add( float *result, float *a, float *b ) {
	
	int i = threadIdx.x;
	result** = a** + b**;
}```

My code (sample code as well) is the following:

```KernelLauncher kernelLauncher = KernelLauncher.load( "C:\\kernel.cubin", "add" );
//... creating input data and so on. Copied from KernelLauncherSample.java found at jcuda.org.

System.out.println("Calling the kernel...");
kernelLauncher.setBlockSize(size, 1, 1); // size := 10
kernelLauncher.call(dResult, dA, dB);

In kernelLauncher.call() I get the following exception:

	at jcuda.utils.KernelLauncher.call(KernelLauncher.java:938)
	at alp4.gameoflife.Test.main(Test.java:75)```

I tried to find out what the problem is and I am almost sure its some kind of compatibility issue with CUDA 4.0.

Im using:
- CUDA 4.0
- jCUDA 0.4.0 RC2 (latest)
- jCUDA utils 0.0.2 (latest)
- cl.exe from Visual Studio 10 (if that may cause issues as well)

on the following architecture:
- Win 7 x64
- Geforce GTX 470 (Compute Capability 2.1 I think)

When compiling the kernel with nvcc I use the following command:
    nvcc kernel.cu -arch=sm_21 -cubin -m64 (but also trid arch=sm_20 -> compiling works, same error)

Compling works fine and Im pretty lost right now since not even the samples are running.

Does anyone know about the problem? I googled and searched within this board but found nothing...

I'd be glad if anyone could help me but its not an urgent matter as I just want to learn about CUDA.

Thanks in advance,

Roman

Hello, and welcome

This issue is related to the internal refactoring that was done during the update to CUDA 4.0. The KernelLauncher will be adjusted for JCuda 0.4.0.

At the moment, I’m not at my „development PC“, but I’ll update the KernelLauncher accordingly as soon as possible, probably early next week.

Just as a background info: The functions for invoking kernels have changed significantly between CUDA 3.2 and 4.0. However, the current incompatibility is not directly related to the update to CUDA 4.0, because the old functions should still work (although they are deprecated). I know that many people are using the KernelLauncher, because the API for invoking kernels with plain CUDA may be tedious. So fixing this issue soon has high priority, regardless of further, internal restucturing for avoiding the deprecated functions (and the update to CUDA 4.0 final, the update of CUBLAS, JNpp, an update of the samples, and other things which are also in the queue…).

I’m not sure what is the best advice for now: The „JCudaDriverCubinSample.java“ shows how to invoke a kernel with plain CUDA, but still using the Version 3.2 functions - and using the deprecated functions is probably not the best strategy for „getting started“. You might want to have a look at the CUDA programming guide, to see the new kernel invocation functions - and hopefully be relieved when you don’t have to use these functions after the update next week :wink:

bye
Marco

EDIT: Concerning the registration: Maybe you have blocked Cookies in your browser for this site? If the problem persists and you can not log in, you can write me a mail, in doubt to this address on the JCuda hopepage.

Hello

The primary issue should have been resolved by a plain recompilation with the new “Pointer” class. The updated JAR is available at the website.

The secondary issue of changing the internals to avoid the deprecated functions is still in progress. Additionally, a better support of PTX JIT compilation in the Driver API is also related to the KernelLauncher, and this is under construction as well, besides the general upate to CUDA 4.0 final.

bye
Marco