0

I have a cuda application which I am trying to debug using parallel Nsight debugger. I have a breakpoint in my kernel function. But when I am trying to debug the code the debugger is not stopping at the breakpoint and printing out the result straight away. I have searched about this and I also got a post like this one. But I have checked "Generate GPU Debug Information" in the property page of my project and it is already turned to "Yes (-G0)". I have also set breakpoints in one of the Nvidia sample program like matrixMulCUDA and I can easily debug their program and able to see the details. So I don't know exactly what I should do or what other settings I need to change so that I could debug my program. There are few more information I would like to provide : 1. I am using Microsoft visual studio 2010 2. My GPU card is NVidia 560ti. 3 I am using CUDA 5.0 and parallel NSight visual studio version 2.2.

Here are some screenshots of the the host code function from where I am calling the kernel and also a portion of the kernel function where I have set the breakpoint. Any help would be very much appreciated.

duttasankha
  • 717
  • 2
  • 10
  • 32
  • One possibility is that your kernel is not executing at all. Are you doing [proper cuda error checking](http://stackoverflow.com/questions/14038589/what-is-the-canonical-way-to-check-for-errors-using-the-cuda-runtime-api)? I don't see any in the host code picture you provided. You might also try running your code with `cuda-memcheck` to see if any errors are reported. – Robert Crovella Apr 27 '13 at 03:17
  • No, you are right. I haven't done a proper cuda error checking. But there is one thing.The result I am getting from the printf after copying back the matrix to the cpu, I am getting a desired result. So I believe that the kernel is executing. But still I will do as you have suggested and I will let you know. But could there be any other viable reason behind this behaviour? – duttasankha Apr 27 '13 at 03:37
  • HI! I just tested my kernel using cudaGetLastError()(somewhat mentioned in this website: http://www.visualization.hpc.mil/wiki/Handling_CUDA_error_messages) and the kernel is executing without any error. So what else is to be done to perform the debugging? – duttasankha Apr 27 '13 at 04:15
  • Just wondering where did you set the brsakpount? Is that instruction executed by a thread? – pQB Apr 27 '13 at 13:10
  • HI! I have set the breakpoint where the thread id is getting evaluated as shown in the kernel image that I have uploaded. – duttasankha Apr 27 '13 at 16:26
  • When you do a clean build, do you see the kernel files being compiled with the -G debugging flag? If not, right click on the files containing your CUDA kernels, and click Properties. Expand the CUDA C/C++ tree, and select Device. Ensure you have selected Yes (-G) for the Generate GPU Debug Information option. Also, I recommend upgrading to Nsight 3.0 RC2. It is a free download available from the Nsight Registered Developer Program. – Jeff Davis Apr 30 '13 at 00:56
  • @JeffDavis Hi! Thank you for your reply. But my GPU debug information is already turned to "Yes-G"and as I have mentioned that I have done a kernel error check and my kernel is also running without any error. Though I can upgrade to the latest version but my only concern is that I am able to debug the other sample codes without any problem. – duttasankha Apr 30 '13 at 18:27
  • @JeffDavis Hi! Thanks for the suggestion of upgrading the Nsight version. That worked and now I am able to hit the breakpoint. So I think now I can debug. It would be helpful if you could post this as answer and I will accept it. Thanks again for all your help. – duttasankha Apr 30 '13 at 19:57

1 Answers1

2

We've fixed many bugs such as these in NVIDIA Nsight 3.0 RC2. I recommend all users upgrade to to NVIDIA Nsight 3.0 as soon as possible. It is a free download available from the Nsight Registered Developers Program.

Jeff Davis
  • 161
  • 4