Sorry. I tried to post under jeffguy@gmail.com, since that email address is more reliable for me. I’ve included my post below.
Subject: CUFFT_INVALID_DEVICE on cufftPlan1d in NVIDIA’s Simple CUFFT example
Body:
I went to CUDA Samples :: CUDA Toolkit Documentation and downloaded “Simple CUFFT”, which I’m trying to get working.
I’m using Ubuntu 14.04, and installed the driver and stuff by adding Index of /compute/cuda/repos/ubuntu1404/x86_64 to my apt sources.
I ran a basic program that copies the 16 numbers from the fibonacci sequence from one host array to the GPU, then back to another host array, and verified that the result is right. I think this means my CUDA environment is set up properly. Then I tried the cufft sample code I downloaded.
$ cd 7_CUDALibraries/simpleCUFFT
$ make
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../common/inc -m64 -gencode arch=compute_11,code=sm_11 -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_50,code=compute_50 -o simpleCUFFT.o -c simpleCUFFT.cu
nvcc warning : The 'compute_11', 'compute_12', 'compute_13', 'sm_11', 'sm_12', and 'sm_13' architectures are deprecated, and may be removed in a future release.
../../common/inc/helper_cuda.h(253): error: identifier "cudaErrorHardwareStackError" is undefined
../../common/inc/helper_cuda.h(256): error: identifier "cudaErrorIllegalInstruction" is undefined
../../common/inc/helper_cuda.h(259): error: identifier "cudaErrorMisalignedAddress" is undefined
../../common/inc/helper_cuda.h(262): error: identifier "cudaErrorInvalidAddressSpace" is undefined
../../common/inc/helper_cuda.h(265): error: identifier "cudaErrorInvalidPc" is undefined
../../common/inc/helper_cuda.h(268): error: identifier "cudaErrorIllegalAddress" is undefined
../../common/inc/helper_cuda.h(272): error: identifier "cudaErrorInvalidPtx" is undefined
../../common/inc/helper_cuda.h(275): error: identifier "cudaErrorInvalidGraphicsContext" is undefined
8 errors detected in the compilation of "/tmp/tmpxft_00000c10_00000000-21_simpleCUFFT.compute_50.cpp1.ii".
make: *** [simpleCUFFT.o] Error 2
Uh oh. Those symbols are defined in my /usr/local/cuda/include/driver_types.h. They’re also mentioned in some libraries:
$ grep -R cudaErrorHardwareStackError /usr/local/cuda
Binary file /usr/local/cuda/lib64/libcufftw.so.6.5.14 matches
Binary file /usr/local/cuda/lib64/libcufftw.so matches
Binary file /usr/local/cuda/lib64/libcufft.so.6.5 matches
Binary file /usr/local/cuda/lib64/libcufft.so matches
Binary file /usr/local/cuda/lib64/libcufft.so.6.5.14 matches
Binary file /usr/local/cuda/lib64/libcufftw.so.6.5 matches
Binary file /usr/local/cuda/targets/x86_64-linux/lib/libcufftw.so.6.5.14 matches
Binary file /usr/local/cuda/targets/x86_64-linux/lib/libcufftw.so matches
Binary file /usr/local/cuda/targets/x86_64-linux/lib/libcufft.so.6.5 matches
Binary file /usr/local/cuda/targets/x86_64-linux/lib/libcufft.so matches
Binary file /usr/local/cuda/targets/x86_64-linux/lib/libcufft.so.6.5.14 matches
Binary file /usr/local/cuda/targets/x86_64-linux/lib/libcufftw.so.6.5 matches
but don’t appear to be symbols defined by those libraries:
$ readelf -a /usr/local/cuda/targets/x86_64-linux/lib/libcufft.so|grep -i cudaErrorHardwareStackError
(No output)
I found nothing by searching around, so I just commented out the relevant lines from common/inc/helper_cuda.h since they just seem to affect error handling, and if such an error is produced, I should at least see “”.
$ make
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../common/inc -m64 -gencode arch=compute_11,code=sm_11 -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_50,code=compute_50 -o simpleCUFFT.o -c simpleCUFFT.cu
nvcc warning : The 'compute_11', 'compute_12', 'compute_13', 'sm_11', 'sm_12', and 'sm_13' architectures are deprecated, and may be removed in a future release.
/usr/local/cuda/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_11,code=sm_11 -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_50,code=compute_50 -o simpleCUFFT simpleCUFFT.o -lcufft
nvcc warning : The 'compute_11', 'compute_12', 'compute_13', 'sm_11', 'sm_12', and 'sm_13' architectures are deprecated, and may be removed in a future release.
mkdir -p ../../bin/x86_64/linux/release
cp simpleCUFFT ../../bin/x86_64/linux/release
Excellent! Successful build!
$ ./simpleCUFFT
[simpleCUFFT] is starting...
GPU Device 0: "Quadro FX 880M" with compute capability 1.2
CUDA error at simpleCUFFT.cu:120 code=11(CUFFT_INVALID_DEVICE) "cufftPlan1d(&plan, new_size, CUFFT_C2C, 1)"
Ouch! I did some googling and couldn’t understand why I’m getting this error. I get the same CUFFT_INVALID_DEVICE from other sample cufft programs that I found elsewhere, though.
I’ve dumped about 6 hours into this problem, and am out of ideas. I probably should have turned to you guys sooner. I’ll be very grateful for any help you can give.
My laptop is an HP EliteBook 8540w.