0

I am using ALEA GPU for GPU Programming (C#). If I use an Atomic Operation like atomic_add in the Kernel, I get "Could not resolve name" error in CUDA WarpWatch window for my variables during Kernel debugging. I see the values of blockIdx.x, blockDim.x, threadIdx.x and arrays but variable names cannot be resolved. The kernel works as expected but variables cannot be monitored during debugging, thus making it difficult to fix any bug. CUDA 8 Toolkit is installed and I am using Visual Studio 2015.

Any ideas?

  • 1
    Did you compile debug code, i.e. a debug project? – Robert Crovella Jan 07 '17 at 23:34
  • Yes. I did everything written in ALEAGPU site. The project works in Debug mode. I can already debug it and step through the Kernel. If there isn't any atomic operation, I can see the values of the variables. Otherwise I see "Could not resolve name" error in the Warp Watch window. I had to write variable values to console (in Kernel code) so that I could follow what was going on. – Mehmet Bingöl Jan 08 '17 at 11:18
  • @RobertCrovella, given my understanding of ALEA GPU, I am not sure any CUDA compilation is involved here. Debug information does not seem to be managed by CUDA compiler, rather by ALEA solution. – Florent DUGUET Jan 10 '17 at 12:57

1 Answers1

1

This is happening because of some optimizations that are done by the NVIDIA NVVM backend, regardless if it is compiled in Debug or Release mode. It assigns some values to registers and there is currently no way to turn that of. The behavior of CUDA C is very similar. The only way to get the results is to write them to global memory to trick the register allocation or to write them to the console in the kernel as you have done. As of now, I do not know of any other approach.

Daniel
  • 1,522
  • 1
  • 12
  • 25