Zhidaily AI · Intelligence · Daily
Zhidaily
Issue 12 · November 11, 2026 · Wed
Today's stories
36 stories · 13 companies
Home / November 11, 2026 / Meta extends LLDB with a plugin to debug CPUs and GPUs in one session
← Back
Release Official News · Meta Score72

Meta extends LLDB with a plugin to debug CPUs and GPUs in one session

In brief
Meta splits CPU and GPU into two separate LLDB targets and uses a plugin to coordinate debugging within a single session. The authors argue that adding new hardware in future will only require writing a plugin, not building another debugger.
Meta Engineering engineering.fb.com
Nov 10 · 01:00 Read the original ↗
01Summary

Modern AI applications often switch back and forth between CPU and GPU, and when a bug crosses that boundary, developers need to understand both host and device at once. Traditional debuggers assume a process has one architecture, one set of threads and one memory view, but a GPU's instruction set, registers, address space and execution model all differ from the CPU's, and the same address can even point to different places on each side. In the past, AMD's ROCgdb and NVIDIA's CUDA-GDB each implemented their own device debugger, so common capabilities were built and maintained repeatedly.

02Background

Modern AI applications often switch back and forth between CPU and GPU, and when a bug crosses that boundary, developers need to understand both host and device at once. Traditional debuggers assume a process has one architecture, one set of threads and one memory view, but a GPU's instruction set, registers, address space and execution model all differ from the CPU's, and the same address can even point to different places on each side. In the past, AMD's ROCgdb and NVIDIA's CUDA-GDB each implemented their own device debugger, so common capabilities were built and maintained repeatedly.

03Approach

Meta built a vendor-neutral accelerator plugin architecture into lldb-server. The core idea is not to force CPU and GPU into one process model, but to represent them as two separate LLDB targets, each with its own architecture, threads, registers and address space, presented to the developer within a single debugging session. The plugin translates a vendor's device debugging API into concepts LLDB already understands, such as processes, threads, registers, memory and stop reasons. When a debugging session starts, LLDB first discovers available plugins. A plugin can set an internal breakpoint in the host process to mark when GPU debugging can start. When the host reaches that point, lldb-server tells the plugin to initialise the vendor API and prepare the device endpoint. LLDB then creates a second target and connects to it. The authors show the result with a HIP vector dot-product example: a breakpoint set on a GPU kernel function starts out pending, resolves automatically once the kernel launches and the module loads, and switching targets shows the GPU-side call stack. The team also built a mock plugin so the LLVM test suite can verify plugin discovery, breakpoint coordination and connection creation without a real GPU. The framework supports both live debugging and post-mortem debugging of GPU core dumps, and it only activates when an application uses a supported GPU runtime; pure CPU applications take the existing path with no added runtime overhead. Most of the general framework has now been upstreamed to LLVM, including the lldb-server plugin interface, the GDB remote protocol packets used for plugin discovery and GPU connection creation, multi-address-space support, and hardware-independent mock tests.

04Implications

The authors argue that adding new hardware will only require writing a vendor plugin, rather than maintaining a separate debugger. For teams using heterogeneous GPU clusters, this means the common debugging layer can stay stable while each backend accurately describes its own devices.