To display the machine topology in textual mode:
lstopo-no-graphics
To display the machine topology in pseudo-graphical mode:
lstopo-no-graphics -.txt
To display in graphical mode (assuming that the DISPLAY environment variable is set to a
relevant value):
lstopo
To export the topology to a PNG file:
lstopo file.png
To export an XML file on a machine and later display the corresponding graphical output on
another machine:
machine1$ lstopo file.xml
<transfer file.xml from machine1 to machine2>
machine2$ lstopo --input file.xml
To save the current machine topology to XML and later reload it faster while still
considering it as the current machine:
$ lstopo file.xml
<...>
$ lstopo --input file.xml --thissystem
To restrict an XML topology to only physical processors 0, 1, 4 and 5:
lstopo --input file.xml --restrict 0x33 newfile.xml
To restrict an XML topology to only numa node whose logical index is 1:
lstopo --input file.xml --restrict $(hwloc-calc --input file.xml node:1) newfile.xml
To display a summary of the topology:
lstopo -s
To get more details about the topology:
lstopo -v
To only show cores:
lstopo --only core
To show cpusets:
lstopo --cpuset
To only show the cpusets of sockets:
lstopo --only socket --cpuset-only
Simulate a fake hierarchy; this example shows with 2 NUMA nodes of 2 processor units:
lstopo --input "n:2 2"
To count the number of logical processors in the system
lstopo --only pu | wc -l
To append the kernel release and version to the graphical legend:
lstopo --append-legend "Kernel release: $(uname -r)" --append-legend "Kernel version:
$(uname -v)"