I am unable to read the values of local variables in Optix 7.1 and the latest Nsight Cuda Debugger(Next-Gen). When the debugger hits a break point all I get in the “locals” window is an entry called Launch Details. Here’s a screen grab of the Optix 7.1 sample optixHello. I modified the NVRTC compiler options to include -G. Is there anything else that needs to be done to read local variables?
Nsight Visual Studio Edition 2020.1
You’re right, inspecting locals does not currently work. I tried it and reproduced the same behavior, and then confirmed with the team that it’s not expected to work right now. I apologize for suggesting the optimization and lineinfo flags would help, I had thought it was all working. The team intends to fix this in the near future. In the mean time, maybe I can suggest some alternatives?
The register view should be working in the CUDA debugger just fine, so if you can map any of your locals to a specific register, you’ll be able to see the value. That isn’t normally very easy to do.
Another option, and my personal favorite, is to define a print macro that only activates when you click on a pixel. I’ve posted example code at the bottom of this comment:
I am compiling it with NVRTC through Visual Studios with the cmake file provided in the Optix 7.1 samples. My CUDA toolkit version is 11.0, but Visual Studio can’t find the cuPrintf files so I haven’t been able to use it.
Will local symbol support require a new version of OptiX7? Or will it be added via a new driver or new version of Nsight? It’s still not working here using Cuda 11.1.1, OptiX7.2 and Nsight 2020.2.1.20303.