-3

Recently I started to build the application which uses CUDA 8.0 on Visual Studio 2015. Because I have to use Dynamic Parallelism I had to change Code Generation into compute_35, sm_35 from compute_20, sm_20 (defualt). Since I have changed it, invoked printf() inside a Kernel does not print anything. Do you know the way that I can use Dynamic Parallelism and print something from inside the Kernel?

Perhaps it is worth mentioning that my graphic card is GeForce GTX 760.

talonmies
  • 70,661
  • 34
  • 192
  • 269
hegendroffer
  • 123
  • 1
  • 13
  • 4
    This isn't a problem with `printf` in the kernel, or Dynamic Parallelism (DP) and `printf`. Most likely you have an error in your code that is preventing the kernel from running successfully. Any time you are having trouble with a cuda code, it's good practice to use [proper CUDA error checking](http://stackoverflow.com/questions/14038589/what-is-the-canonical-way-to-check-for-errors-using-the-cuda-runtime-api) and run your code with `cuda-memcheck`. The error checking methodology can even be used for child-launched kernels in a DP case, from within the parent kernel code. – Robert Crovella Mar 16 '17 at 16:45

1 Answers1

3

Your GeForce GTX 760 is of compute capability 3.0 and doesn't support dynamic parallelism.

Compiling for the virtual compute_35 architecture prevents your kernel from running at all, as the virtual architecture needs to be less or equal your device's compute capability. Thus you see no output from printf() inside the kernel.

As Robert Crovella has remarked above, you would have noticed this with proper error checking.

tera
  • 7,080
  • 1
  • 21
  • 32