Question

I'm using nsight eclipse edition, and I cant figure out how to view variables values in debug mode for now (meaning usual variables in host memory, debugging usual c++ code so far). "Variables" tab does not contain anything useful for me (nothing I can use now at least), and Memory tab, which should be able to display variables by their addresses and also monitor expressions does not work for me either.

Any suggestions?

Was it helpful?

Solution 2

I was using gcc 4.8, which caused problems. Now I downgraded to gcc 4.6 and it solved problem.

Robert Crovella, thanks for your effort.

OTHER TIPS

The following steps seemed to work for me:

  • open nsight
  • create a new project, select CUDA C/C++ project, and select CUDA Runtime project
  • the project will be populated with a simple "bitreverse" code. The initial configuration will be the debug configuration. Select Project...Build Project to build the sample code (debug version).
  • Now on the right hand side of the toolbar, press the "Debug" button, to switch to the Debug perspective.
  • on the left of the first CUDA_CHECK_RETURN(...) line of code, right click and select "Toggle Breakpoint" to set a breakpoint at that line of code.
  • select Run...Debug The program will then be started in debug mode, stopped at the first line of code, and the host variables will be filled in in the upper right hand corner "Variables" pane.
  • To the left of the idata variable, select the triangle to expand the sub-menu. The submenu is populated with the values of idata at each index. The data will be garbage, as it has not been initialized yet.
  • Select Run...Resume to continue program execution. Program execution will halted at the breakpoint previously set.
  • If we inspect the idata variable in the "Variables" pane, we see that the values have been changed (initialized) to 0, 1, 2, ... etc.

If you attempt to debug a project for which you have built the "Release" configuration instead of "Debug" configuration, you will have a variety of issues, and will get a message "no source available" and there will be no variables displayed in the "Variables" pane.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top