Intel engineers are working on contributing upstream support to the GNU Debugger (GDB) for debugging software running on Intel GPUs.
Intel has been carrying GDB debugger support for Intel graphics within their downstream repository while in recent weeks have been working to add the support into upstream GDB, the widely-used debugger on Linux that is part of the GNU toolchain.
“We (Intel) would like to submit patches to enable fundamental debug support for Intel GPU devices. In the future, we plan to add more patches that improve the performance and the user experience. Those patches are already available in the downstream “Intel Distribution for GDB” debugger.
…
GPU threads operate in a SIMD (single instruction multiple data) manner: they are vectorized, where each lane (also known as “execution channel”) executes the same instruction but using different data values. Lanes of the same thread execute in a lock-step movement. Displaying the value of a source program variable therefore requires not only a thread context but also a lane context. GDB currently does not have this knowledge built-in. Furthermore, some DWARF extensions are necessary to express data locations in a lane-relative way, which are currently under discussion of or to be submitted to the DWARF committee. Hence, with this submission, variables may appear with an error like ““. Similar restrictions apply also to the AMD ROCm (AMDGPU) target in the upstream GDB for the same reasons. The downstream “Intel Distribution for GDB” debugger implements lane support as well as DWARF extensions and hence is able to print lane-relative values properly.”
More details on this Intel graphics debugging support for GDB can be found via this patch series.
This Intel graphics debugging target depends upon the Intel oneAPI Level Zero Debug API and in turn the GNU Debugger focus appears to be largely focusing on Level Zero / SYCL workloads. The Intel graphics port for GDB currently comes in at around 11k lines of code.