0

i'm writing a simple code for fast fourier transform with cufft cuda library. My source file work well with visual studio in windows7 but with eclipse nsight, in ubuntu 14.04, not work! i've installed nvidia 346.72 driver and cuda toolkit 7.0 and my video hardware is geforce 410M. When i build my source code i have following message:

16:56:24 **** Incremental Build of configuration Debug for project cufft_double ****
make all 
Building target: cufft_double
Invoking: NVCC Linker
/usr/local/cuda-7.0/bin/nvcc --cudart static -L/usr/local/cuda-7.0/lib64 --relocatable-device-code=false -gencode arch=compute_20,code=compute_20 -gencode arch=compute_20,code=sm_20 -m64 -link -o  "cufft_double"  ./cufft_double.o   
./cufft_double.o: In function `main':
/home/marco/cuda-workspace/cufft_double/Debug/../cufft_double.cu:79: undefined reference to `cufftPlan1d'
/home/marco/cuda-workspace/cufft_double/Debug/../cufft_double.cu:85: undefined reference to `cufftExecZ2Z'
/home/marco/cuda-workspace/cufft_double/Debug/../cufft_double.cu:108: undefined reference to `cufftDestroy'
/home/marco/cuda-workspace/cufft_double/Debug/../cufft_double.cu:111: undefined reference to `cufftPlan1d'
/home/marco/cuda-workspace/cufft_double/Debug/../cufft_double.cu:117: undefined reference to `cufftExecZ2Z'
/home/marco/cuda-workspace/cufft_double/Debug/../cufft_double.cu:136: undefined reference to `cufftDestroy'
collect2: error: ld returned 1 exit status
make: *** [cufft_double] Error 1

16:56:27 Build Finished (took 2s.792ms)

i tried to set library path but in preferences windows i read "no CUDA-compatible devices detected" please help me! Best reguards marco


now i can build source code but my program not work!

i read this error: modprobe: ERROR: could not insert 'nvidia_331_uvm': Invalid argument

and i receive a message programmed by me if "cudaGetLastError() != cudaSuccess" after "cudaMalloc" For best clarification i read "cuda error: allocazione fallita" for this frame of code:

cudaMalloc((void**)&out_device, sizeof(cufftDoubleComplex)*NX*BATCH);
if (cudaGetLastError() != cudaSuccess){
    printf("Cuda error: allocazione fallita\n");
    return 0;
};
Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • 2
    how is the linker error related to the title of your question? anyway, you need to link against the cuFFT library, so `-lcufft` is necessary after `-L/usr/local/cuda-7.0/lib64`. – m.s. Jun 02 '15 at 15:32
  • Thank you!! now i can build source code! i solved this problem with this : project->properties->build-> settings->tool settings->NVCC linker->Libraries and i add 'cufft' . – Marco Jammajalla Mangraviti Jun 02 '15 at 17:40
  • 1
    CUDA 7 and driver 346.xx are not compatible with the `nvidia_331_uvm` module. You have a corrupted machine configuration, i.e. you have not installed CUDA correctly on your machine. Refer to the [linux getting started guide](http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#abstract). It will also probably be easier if you can start with a clean load of the OS. – Robert Crovella Jun 02 '15 at 21:30
  • thank you for your response. I tried to format my laptop and i've installed again cuda toolkit with only one difference: now, i've installed nvidia driver from cuda toolkit (cuda toolkit 7 installs 346 driver version). In this way nsight eclipse detects my cuda capable geforce 410M. However i can't compile my source code because, when compiling, software not writes '-lcufft' despite i set 'cufft' in the same way that before i did. i read this new error: Gcc: Error Trying to Exec 'Cc1plus': Execvp: No Such File or Directory – Marco Jammajalla Mangraviti Jun 04 '15 at 10:20
  • finally work!!! I solved installing g++ typing "sudo apt-get install g++" – Marco Jammajalla Mangraviti Jun 04 '15 at 12:12

1 Answers1

1

Run these commands in sequence:

  • sudo apt-get remove --purge nvidia-*

  • sudo apt-get install cuda-drivers

  • sudo apt-get install nvidia-nsight

    Restart the machine and open nsight and look at the properties whether you see the detected driver.

Community
  • 1
  • 1