Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

lstopo

📅 2016-Mar-09 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ architecture, hwloc, lstopo, topology ⬩ 📚 Archive

20160309_lstopo

lstopo is a tool provided by the Portable Hardware Locality (HWLOC) project. It is a great tool to get a graphical topological diagram of the architecture of the computer. Primarily it shows the CPUs, the cores and caches of the CPUs, NUMA nodes, PCI buses and how devices like GPUs are connected to the buses.

Commands

$ sudo apt install hwloc
$ lstopo

The default format might be a GUI window or a text output or ASCII graphics or something else dependent on your system.

$ lstopo --of console

This displays the topology in indented text format.

$ lstopo --of txt

On my system, this showed a colorful and pretty block diagram of the CPU, NUMA nodes and the dies inside it. It is ironic that the txt format actually shows the topology graphically!

Other formats that can be used include svg and pdf.

$ lstopo --whole-io

Topology

A brief introduction to the various components that might be listed or drawn by the tool:

Tried with: lstopo 2.1.0 and Ubuntu 20.04