0

I am trying to use dynamic parallelism with CUDA, but I cannot go through the compilation step.

I am working on a GPU with Compute Capability 3.5 and the CUDA version 7.5.

Depending on the switches in the compile command I use, I am getting different error messages, but using the documentation,

  • I arrived to one line leading to a successful compilation:

    nvcc -arch=compute_35 -rdc=true cudaDynamic.cu -o cudaDynamic.out -lcudadevrt
    

    But when the program is launched, all the program fails. With CUDA-memcheck, for each call to an API function, I get the same error message:

    ========= CUDA-MEMCHECK
    ========= Program hit cudaErrorUnknown (error 30) due to "unknown error" on CUDA API call to ...
    
  • I have also tried this line (taken from CUDA dynamic samples makefile):

    nvcc -ccbin g++ -I../../common/inc -m64 -dc -gencode arch=compute_35,code=compute_35 -o cudaDynamic.out -c cudaDynamic.cu
    

    But upon execution, I get:

    cudaDynamic.out: Permission denied
    

I would like to understand how to correctly compile a CUDA dynamic code, because all the other compilation lines that I have tried so far have failed.

einpoklum
  • 118,144
  • 57
  • 340
  • 684
VincentN
  • 63
  • 6
  • Just because a code fails when you run it does not mean that your compilation command line is incorrect. In general your command line looks correct. Your error could be any sort of problem with your code. Are you certain that CUDA is installed correctly on your machine? Do other CUDA codes (e.g. CUDA samples) run correctly? If this is on windows, are you possibly running into a WDDM timeout? There is not enough information in your question to diagnose what is actually wrong. – Robert Crovella Jun 20 '16 at 15:30
  • CUDA has been correctly installed of the machine: I have been working on non-dynamic CUDA for a long time. I am running on Ubuntu. I tried compiling the sample cdpSimplePrint, but I was getting the following error: make: /usr/local/cuda/bin/nvcc: Command not found Makefile:196: recipe for target 'cdpSimplePrint.o' failed make: *** [cdpSimplePrint.o] Error 127 – VincentN Jun 20 '16 at 15:36
  • what is the result of running `which nvcc` on your machine? – Robert Crovella Jun 20 '16 at 15:44
  • I tried compiling the cdpSimplePrint dynamic sample, but compilation failed. I'm running on Tesla K40, which is the only GPU on the machine. – VincentN Jun 20 '16 at 15:45
  • $ which nvcc /usr/bin/nvcc – VincentN Jun 20 '16 at 15:46
  • That is an unusual place for it, and it explains why the `make` command is failing. Your CUDA install was not done correctly if the `nvcc` you are using for compilation is in `/usr/bin/nvcc` but your CUDA samples makefiles are set up to expect it in `/usr/local/cuda/bin/nvcc` – Robert Crovella Jun 20 '16 at 15:48
  • Is there a way to move `nvcc` to the correct folder or should CUDA be reinstalled? – VincentN Jun 20 '16 at 15:53
  • Did you install nvidia-cuda-toolkit from apt? – merelyMark Jun 20 '16 at 16:58
  • Yes I did, though I do not remember setting manually a location for nvcc. – VincentN Jun 20 '16 at 18:42
  • How should I proceed? Is it necessary to reinstall the CUDA toolkit? – VincentN Jun 22 '16 at 09:31

1 Answers1

0

I fixed the problem by fully reinstalling CUDA.

I'm now able to compile both the CUDA samples and my own code.

VincentN
  • 63
  • 6