1

I am having little trouble in double parallelism in CUDA. i have a file named First.cu and a main file named main.cpp

I was getting error.

error : calling a __global__ function("kernel_6") from a __global__ function("kernel_5") is only allowed on the compute_35 architecture or above>

then I followed this thread and configured my properties like this again.

  1. View -> Property Pages
  2. Configuration Properties -> CUDA C/C++ -> Common -> Generate Relocatable Device Code -> Yes (-rdc=true)
  3. Configuration Properties -> CUDA C/C++ -> Device -> Code Generation -> compute_35,sm_35
  4. Configuration Properties -> Linker -> Input -> Additional Dependencies -> cudadevrt.lib

now I am getting error like this.

nvcc : fatal error : nvcc supports '--relocatable-device-code=true (-rdc=true)', '--device-c (-dc)', and '--device-link (-dlink)' only when targeting sm_20 or higher

Please help me. What should I do to remove this error?

I have added all the required CUDA Libraries. I installed CUDA 5.5 and I have GTX780 .

talonmies
  • 70,661
  • 34
  • 192
  • 269
user2865500
  • 81
  • 1
  • 4

1 Answers1

3

Even though you say you've set the proper compute properties (code generation) in visual studio, you haven't. Visual Studio can be confusing because there are multiple ways to set properties which can override each other, such as at a per-file level (which can override the global properties you set).

If you study the actual nvcc compile and link command lines being generated by visual studio which immediately precede the error output you have shown in this question, you'll discover that the proper sm_35 switches are not getting applied. You'll need to fix that and it's a visual studio configuration issue.

You may also wish to study or re-use one of the dynamic parallelism sample projects that get installed with the cuda toolkit. You should be able to compile these without error under visual studio, and you can study the correct project settings there. Or you can just simply re-use one of these projects to compile your own code.

Robert Crovella
  • 143,785
  • 11
  • 213
  • 257