Try using CUDA 7.5. And I believe you may have errors in your compile command sequence, which you haven’t shown. (My guess is you are not invoking separate compilation with device linking correctly, which is required for this sample code and for cufft callbacks in general, since the callback function must be linked across compilation units).
On CUDA 7.5, I did the following:
- Copy all the files from /usr/local/cuda/samples/7_CUDALibraries/simpleCUFFT_callback to a working directory. (I did the remaining steps in the working directory.)
- Modify the following line in the Makefile from:
INCLUDES := -I../../common/inc
to:
INCLUDES := -I$(CUDA_PATH)/samples/common/inc
- Modify the following line in the Makefile from:
SMS ?= 20 30 35 50 52
to:
SMS ?= 20 30 35 37 50 52
- I then issued
make
and got the following output:
$ make
"/usr/local/cuda-7.5"/bin/nvcc -ccbin g++ -I"/usr/local/cuda-7.5"/samples/common/inc -m64 -dc -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o simpleCUFFT_callback.o -c simpleCUFFT_callback.cu
"/usr/local/cuda-7.5"/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o simpleCUFFT_callback simpleCUFFT_callback.o -lcufft_static -lculibos
mkdir -p ../../bin/x86_64/linux/release
cp simpleCUFFT_callback ../../bin/x86_64/linux/release
$
There were no compile errors or warnings.
On CUDA 7.0, the situation was a little different. The compile successfully completed, but I had a variety of warnings. It appears that the static cufft libraries in CUDA 7.0 may have been built without cc 3.7 binary support. If you must use CUDA 7.0, you may have better luck just running the binaries built using the standard Makefile with cc 3.5 support. cc 3.5 code should be binary-compatible with a cc 3.7 device.
For example, change the first line of the Makefile to point to CUDA 7.0 instead of CUDA 7.5, and change the SMS line to:
SMS ?= 35
Then, when I issue make, I get the following:
$ make
"/usr/local/cuda-7.0"/bin/nvcc -ccbin g++ -I"/usr/local/cuda-7.0"/samples/common/inc -m64 -dc -gencode arch=compute_35,code=sm_35 -gencode arch=compute_35,code=compute_35 -o simpleCUFFT_callback.o -c simpleCUFFT_callback.cu
"/usr/local/cuda-7.0"/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_35,code=compute_35 -o simpleCUFFT_callback simpleCUFFT_callback.o -lcufft_static -lculibos
mkdir -p ../../bin/x86_64/linux/release
cp simpleCUFFT_callback ../../bin/x86_64/linux/release
$
Again, no errors or warnings.