CUFFT & Driver API

I want to use cufft32_32_16.dll and only driver API (not CUDART). But I get strange bugs with this.
I create context with cuGLCtxCreate and manage it by cuCtxPush/Pop to bind to main thread.
When I make context be floating, cufftPlan** succeeds, but cufftExecR2C return error: CUFFT failed to execute an FFT on the GPU.
When I context current for thread, cufftPlan** return error: The user specifies a bad memory pointer.
Looks like CUFFT manage own context by CUDART internal variable. I look at examples of GPU Computing SDK 3.2 and all of them used CUDART,
so it is possible to use only driver API and CUFFT?

Sorry, I’m not checking forums for same topic, now find this
Possible bug on beta 3.0 when using cufft and driver api‎
CUFFT and Driver API interoperability
As has already been passed some time, please answer whether this is will possible at all, or better to abandon cufft library and make own one?
Hopefully someone will answer.

I’m using driver api only, and cufft. and seem to have no problems. Though I don’t switch the context after setting it up once.


Please, can you post some simple example with exe compiled on your side?

If thinking logically, the problem should be not in a context switch.

PS: Who can answer the question why the source library is closed, it’s commercial secret? It was much faster to look inside and understand the problem.




Do you have a simple example which fails ? Would be easier for me to look into.

I have may own framework written on Delphi and write it on C++ will be difficult for me, but I’ll try to remake some example from SDK and post it in this topic.

Okay, I remake oceanFFT into driver style and it’s work fine even with context management :wacko:
So I must find problem in my framework.
Thanks for your attention.

oceanFFTDRV.rar (16.3 KB)

I still can not achieve success. I trace machine code of cufft and find the first call of cudart return different result in EAX: $00 for C++ program and $31 for Delphi, i.e. cudaErrorIncompatibleDriverContext. Then cufftPlan2d return with error CUFFT_ALLOC_FAILED.

This is strange, the version of nvcuda.dll and cudart32_32_16.dll is 3020, but cufft still wont work :ermm:

Okay, I’m find a root of problem. Many functions of nvcuda.dll has *_v2 version, like cuGLCtxCreate_v2. Headers in VC++ has conditions #if defined(__CUDA_API_VERSION_INTERNAL) || __CUDA_API_VERSION >= 3020 which I did not notice at the beginning.
Some one can tell why developers do this? When I replace entry names a cufft began to work as need.
Any way, :thanks: topic is closed.

Wonders of keeping the backward compatibility with older api versions.