Breakpoints in .cu files in Visual Studio 2013 work fine when using the "Local Windows Debugger". But when using nsight's "Start CUDA debugging" the breakpoints are neglected. How is this possible? At nsight's site they state: "Use the familiar Visual Studio Locals, Watches, Memory and Breakpoints windows". So I guess the normal breakpoints can be used?
Edit:
Enable CUDA Memory Checker
: On/Off makes no differenceGenerate GPU Debug Information
: No/Yes (-G0) makes no differenceStart CUDA/Graphics debugging
: breakpoints neglectednvcc
-> bunch of preprocessing
-> cudafe++
-> cicc
toolchain path.nvcc
-> bunch of preprocessing
-> cl
or just cl
.It does not matter in which file,.cpp
, .cu
or .h
your code is. The only thing that matters is if your code is annotated as __device__
or __global__
or not.
As of CUDA 7.5 RC (Aug 2015), on Windows you can only debug one of those at a time. On Linux and OSX you can debug both at the same time with cuda-gdb
.
See also: NVIDIA CUDA Compiler Driver NVCC
Other things that could lead to frustration during debugging on Windows:
.pdb
files for host and device modules. Check nvcc
, cl
, nvlink
and link
options. For example host and device debug info could be written in the same file, overwriting each other.