Debugging and profiling tools

Note that the following examples are also possible to run with bazel, instead of dazel, but that requires the tools to be installed on your system.

The CUDA gdb debugger is an extension of the GNU debugger that enables debugging of both GPU and CPU code within the same application.

To invoke the debugger, use one of the following patterns:

Nsight Systems, is Nvidia’s system-wide performance analysis tool.

Install the GUI-frontend on your local system:

Copy
Copied!
            

sudo apt install cuda-nsight-systems-11-8

Invoke the profiler with a standard set of nsys parameters:

Copy
Copied!
            

dazel run --config nsys //MY_TARGET

Run with customized nsys parameters:

Copy
Copied!
            

dazel run --run_under `/usr/local/cuda-11.8/bin/nsys profile --MY_PARAMS //MY_TARGET`

Examine the last lines of the stdout log for the path to the generated .nsys-rep file and open it inside nsight-sys for analysis.

© Copyright 2018-2023, NVIDIA Corporation. Last updated on Oct 23, 2023.