Cufft Size

Is there any limit for the size of R2C and C2R FFT?
I tried to do fft to a image. If the image size is 36563656, cufft always give wrong result. But if I change the size to 36503650 or 3658*3658, cufft works and give correct result.

Does your application carefully check the return status of every CUDA and CUFFT API call? Depending on the memory size of your GPU, there may be an out-of-memory condition. The CUFFT manual states the transform size limits as follows:

“Transform sizes up to 64 million elements in single precision and up to 128 million
elements in double precision in any dimension, limited by the available GPU memory”

The memory size is enough. I only do single-precision 2D fft, and use GTX480 with 1.5Gb device memory, CUDA4.2.

cuFFT of 36563656(float) R2C doesn’t work, but a little bit larger cuFFT of 36583658 works.

Now I tried more 2D R2C and C2R float cuFFT, found cuFFT gave wrong results in some special dimension, even its dimension is small.

Is it a bug, or a real limit so that I have to use the dimension of power of 2,3,5 or 7?

From your description, it appears that you have done some due diligence and that there could be indeed a bug in CUFFT. Since you are using CUDA 4.2 I would suggest filing a bug, attaching a self-contained repro app. There is a link to the bug reporting form on the registered developer website. You might want to try the CUDA 5.0 preview to see whether the issue persist. Fair warning: the preview does not provide the same level of maturity as our normal release candidates.

Thank you for your help.

It is very easy to reproduce the problem and find a bad size, just run 2D R2C fft(float) at a special size, such as 3656, 1828, 914, 3056,…

This will cause wrong results or many weird error.

I used vs2010, win7, cuda4.2, GTX480 .

I don’t know where to submit the bug report. Could you do that? I hope NVIDA can solve the problem in next version. This really introduce big trouble in my program.

I am sorry to hear that CUFFT is causing trouble for your application. Customers filing bugs is the fastest and surest way to get CUDA issues fixed. Bug reports provide an opportunity for customers to track the progress of any issues they reported, and you may be advised of possible workarounds by the team who provides the affected functionality, if available. Below are the directions to the bug reporting form. Thank you for your help!

(1) Go to http://developer.nvidia.com/
(2) Click on the green link “Registered Developers Website” in the upper right corner
(3) Log in with your user name / password
(4) Click on the green link “CUDA/GPU Computing Registered Developer Program”
(5) Under the section heading “Reporting an Issue” click on the green link “The Submit a Bug Form”
(6) Please provide all requested information, and attach self-contained repro code as needed (there is a “Browse” button in the “Attachment” section at the bottom of the form)