CUFFT: allocation error

Performing 2000x2000 complex-to-complex FFT. cuMemInfo() reports 80mb free, but cufftPlan2d() fails with CUFFT_ALLOC_FAILED.

Any idea why I wouldn’t be able to generate a plan despite having so much free global memory? I’m on a 256mb GeForce 8600M GT.

I haven’t used CUFFT much, but off the top of my head:

  1. cuMemInfo() reports 80mb free…but is there enough free, consecutive memory to store your array? Perhaps the memory is fragmented and the plan can’t be generated.

  2. I know from using FFTW (which CUFFT is modeled after), that you can do both in-place and out-of-place FFT’s. I remember reading something about how it needs to be specified in the CUFFT manual (you’ll have to look it up though). If you’re doing out-of-place calculations, this may contribute to (1) if there’s not enough consecutive memory to store two copies of the array.