Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugging CUDA code

Tags:

c++

c

cuda

i am using Nsight along with VS 2008 to debug my cuda code.
I have 2 Geforce GTX 460 SE cards in my computer.
i read Nsight's user guide and updated Nvidia Control panel as stated in the guide.
but i still have a problem. in my code when i set cudaSetDevice(0); i get an error in nsight stating that i cannot debug since the device is attached to a monitor, which is true.
but when i set cudaSetDevice(1); and start cuda debugging, nsight gives no errors, but the program does not break at the breakpoint that i put in the code!.
does anybody know whats wrong?

like image 206
lin Avatar asked Dec 28 '25 03:12

lin


1 Answers

Set the -G0 flag in the CUDA Build Rule to enable debug information in the compiled code. Your breakpoint should be hit after that.

(Reply contributed originally by Jawad Masood, so I have made the reply Community Wiki.)

like image 151
Ashwin Nanjappa Avatar answered Dec 30 '25 16:12

Ashwin Nanjappa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!