Prepare to debug CUDA GPU code

You might need to add additional compiler command line options to enable GPU debugging.

For NVIDIA’s nvcc compiler, kernels must be compiled with the -g -G flags. This enables generation of information for debuggers in the kernels, and also disables some optimizations that would hinder debugging. To use memory debugging with CUDA, --cudart shared must also be passed to nvcc.

For other compilers, see NVIDIA GPU language support, and your vendor’s own documentation.

Note

OpenCL debugging of GPUs is not supported.