1
votes

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 .

1
what kind of error? I can't see any - rafee
Edited..Please see again - user2865500
do not target lower than sm_20 then, as said by the error msg. choose only _35 if possible - kangshiyin
From where i can choose SM_35 .. can u please elaborate it ? - user2865500
This is the same discussion in Compiling code containing dynamic parallelism fails. Perhaps your error arises due to a misuse of Visual Studio that could be solved by asking someone (a colleague?) to revise the settings of your Visual Studio solution. - Vitality

1 Answers

2
votes

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.