Tutorial: Debugging with Intel® Distribution for GDB*

Multi-GPU Debugging

The debugger supports debugging a program that offloads kernels to multiple GPU devices. Each device appears in the debugger as a separate inferior. The auto-attach feature initializes the devices for debugging and creates the corresponding inferiors. For example, for a program that runs on a machine with two GPUs (one integrated, one discrete), when you execute the run command from the (gdb) prompt:

run

A possible output is as follows:

Starting program: ./multi-device-program
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread
0x7ffff4871700 (LWP 394698)]
intelgt: gdbserver-gt started for process 394694.
[...]
intelgt: attached to device 1 of 2; id 0x3e92 (Gen9) on inferior 2.
[...]
intelgt: attached to device 2 of 2; id 0x9a40 (Gen12) on inferior 3.

Note

Switching between the inferiors and threads is the same as explained in the Basic Debugging section.