"Invisible" error

Hello,

I have a little problem with a program :

There is the idea :

someCode();

fft(src, dst);

someCode();

and the fft returns the error CUFFT_EXEC_FAILED.

At that point, I think I’m doing something wrong. But, 1st weird thing :

someCode();

fft(src, dst);

fft(src, dst);

someCode();

the first fft (it is cufftExecR2C) fails, but if I put it a second time, it works.

Also ;

someCode();

cudaGetLastError();

fft(src, dst);

someCode();

is working too, but cudaGetLastError() returns no error !

And… I don’t catch any non-zero error code in my program. Valgrind is not telling me anything, so I don’t know where to look. And I’d like to avoid to put the magical cudaGetLastError() before the FFT… !

Any idea on how to debug this ?

Thank you very much !

NB : Tested with CUDA 3.2, 4.0 RC2 and 4.0 on a GTX 560 Ti.
Most strange thing is the bug exists only if one of the FFT 2D size is a power of 2, 128 or lower. For other sizes, I don’t have the bug.

But it is not reproducible outside of my project, so it sounds like an error in my program rather in cuFFT. But it is strange though…

Any help and debugging advice will be appreciated !