You will need to use a debugger. Some people are in denial about that, and it costs them dearly.
These instructions are for debugging CPU (host) code and CUDA GPU (device) code. Device code is debugged using cuda-gdb a version of the GNU Debugger, gdb, extended for Nvidia GPU debugging. Both gdb and cuda-gdb can be used for debugging CPU code.
The makefiles provided with course assignments will build up to three versions of executable one will have suffix -debug and one, if produced, will have suffix -cuda-debug. For example, suppose the main file is named hw03.cu. The three executables will be named hw03, hw03-debug, and hw03-cuda-debug. All versions are compiled with CPU debugging turned on, since this has no performance penalty under the GNU toolchain. File hw03-debug has optimization turned off and hw03-cuda-debug has optimization turned off, event (performance) counter data turned off, and CUDA debugging turned on.
File hw03 is best for collecting timing data, though if timing is for activities on the GPU then hw03-debug should be about as fast. Use hw03-debug for debugging CPU code with gdb and hw03-cuda-debug for debugging device code with cuda-gdb.
|David M. Koppelman - firstname.lastname@example.org||Modified 31 Jul 2018 14:21 (1921 UTC)|
|Provide Website Feedback • Accessibility Statement|