When diagnosing hardware connectivity, configuring virtualization passthrough (VFIO/IOMMU), or auditing high-performance peripheral routing on an Ubuntu workstation or server, standard linear device listings can be difficult to interpret. The standard lspci command outputs an unformatted sequential list of devices, which obscures how physical root complexes, bridges, PCIe switches, and endpoint peripherals connect to the motherboard. To visualize the exact physical hierarchy, the lspci -t command renders a clear architectural tree diagram directly in the Ubuntu terminal.
Understanding PCI Topology in Linux
Every motherboard manages communication between the CPU and hardware peripherals via a network of PCI host bridges and Root Complexes. Downstream from these root controllers sit intermediate PCIe switches and root ports that fan out into endpoint devices—including NVMe solid-state drives, dedicated graphics cards (GPUs), network interface controllers (NICs), and USB host controllers.
The tree mode in lspci maps these relationships into an ASCII branching diagram, displaying domain identifiers, bus numbers, device slots, and function sub-channels.
Running lspci -t for Basic Tree Output
To inspect the raw topological tree structure on your Ubuntu system:
- Open the Terminal application on Ubuntu (press Ctrl + Alt + T).
- Execute the basic tree command:
lspci -t - The terminal displays an ASCII hierarchy diagram resembling the following structure:
-[0000:00]-+-00.0 +-01.0-[01]----00.0 +-02.0 +-14.0 +-17.0 \-1c.0-[02-04]--+-00.0-[03]----00.0 \-00.1-[04]----00.0
In this diagram, [0000:00] denotes the root PCI domain and root bus. Numbers positioned after the hyphens indicate device and function slots, while numbers encased in brackets represent secondary bus domains created by bridge chips.
Adding Verbose Device Names with lspci -tv
While the compact tree view illustrates bus routing, it only displays hexadecimal slot IDs without identifying what hardware is attached. To append descriptive device names, manufacturer details, and class designations to the tree, combine the tree flag with verbose reporting:
lspci -tv
The resulting output maps human-readable hardware descriptions directly beside each branching node:
-[0000:00]-+-00.0 Intel Corporation 12th Gen Core Processor Host Bridge/DRAM Registers
+-01.0-[01]----00.0 NVIDIA Corporation AD104 [GeForce RTX 4070]
+-14.0 Intel Corporation Alder Lake-S PCH USB 3.2 Gen 2x2 (20 Gb/s) Controller
+-17.0 Intel Corporation Alder Lake-S PCH SATA Controller [AHCI Mode]
\-1c.0-[02]----00.0 Samsung Electronics Co Ltd NVMe SSD Controller PM9A1/980PRO
Filtering and Tracing Specific Bus Segments
On enterprise multi-socket servers with dozens of PCIe slots and virtual function endpoints, the full topology tree can exceed several hundred lines. You can restrict the output to a specific PCI domain or filter specific branches using standard Linux command chaining:
- Page Through Large Trees: Pipe the output into the
lesspager to navigate with arrow keys:lspci -tv | less - Locate Specific Peripherals: Filter for dedicated graphics, storage, or network cards:
lspci -tv | grep -E -i "VGA|3D|Ethernet|Non-Volatile" - Inspect Numeric Bus and Vendor IDs: Run
lspci -tvnto view both the tree structure and raw numeric vendor and device IDs (useful when binding kernel driver modules likevfio-pci).