Hi all,
I’m trying to get a CUDA Event set up to record GPU run times, and am getting
[SIZE=1][LEFT]Exception in thread “main” [/SIZE][SIZE=1]jcuda.CudaException[/SIZE][SIZE=1]: CUDA_ERROR_NOT_INITIALIZED
at jcuda.driver.JCudaDriver.checkResult([/SIZE][SIZE=1]JCudaDriver.java:153[/SIZE][SIZE=1])[/LEFT]
at jcuda.driver.JCudaDriver.cuEventCreate([/SIZE][SIZE=1]JCudaDriver.java:3446[/SIZE][SIZE=1])[/SIZE]
[SIZE=1]…
[/SIZE]
I couldn’t find any examples of how to get the JCudaDriver working on the cuda events, but here’s the code I tried:
[LEFT]CUevent start = [SIZE=1]new[/SIZE] CUevent();
CUevent stop = [SIZE=1]new[/SIZE] CUevent();
JCudaDriver.cuEventCreate(start, 1);
JCudaDriver.cuEventCreate(stop, 1);
[SIZE=1]float[/SIZE][] runTime = [SIZE=1]new[/SIZE] [SIZE=1]float[/SIZE][1];
[SIZE=1]…code which works fine without CUevent…[/LEFT]
[/SIZE][LEFT]
JCudaDriver.cuEventRecord( start, [SIZE=1]null[/SIZE]);
kernelLauncher.call(dResult, dA, dB);
JCudaDriver.cuEventRecord( stop, [SIZE=1]null[/SIZE]);
JCudaDriver.cuEventSynchronize( stop );
JCudaDriver.cuEventElapsedTime( runTime, start, stop );
JCudaDriver.cuEventDestroy( start );
JCudaDriver.cuEventDestroy( stop );
System.[SIZE=1]out[/SIZE].println([SIZE=1]"Run time: "[/SIZE] + runTime); [/LEFT]
Any feedback on how t