lstopo [ options ]... [ filename ]
lstopo-no-graphics [ options ]... [ filename ]
hwloc-ls [ options ]... [ filename ]
Note that hwloc(7) provides a detailed explanation of the hwloc system; it should be read before reading this man page
- --of <format>, --output-format <format>
Enforce the output in the given format. See the Output Formats section below.
- -i <file>, --input <file>
Read topology from XML file <file> (instead of discovering the topology on the local machine). If <file> is "-", the standard input is used. XML support must have been compiled in to hwloc for this option to be usable.
- -i <directory>, --input <directory>
Read topology from <directory> instead of discovering the topology of the local machine. On Linux, the directory may contain the topology files gathered from another machine topology with hwloc-gather-topology. On x86, the directory may contain a cpuid dump gathered with hwloc-gather-cpuid.
- -i <specification>, --input <specification>
Simulate a fake hierarchy (instead of discovering the topology on the local machine). If <specification> is "node:2 pu:3", the topology will contain two NUMA nodes with 3 processing units in each of them. The <specification> string must end with a number of PUs.
- --if <format>, --input-format <format>
Enforce the input in the given format, among xml, fsroot, cpuid and synthetic.
- --export-xml-flags <flags>
Enforce flags when exporting to the XML format. These flags are passed to hwloc_topology_export_xml(). A value of 1 reverts to the format of hwloc v1.x.
- --export-synthetic-flags <flags>
Enforce flags when exporting to the synthetic format. These flags are passed to hwloc_topology_export_synthetic(). A value of 2 reverts to the format of hwloc v1.9. A value of 3 reverts to the original minimalistic format (before v1.9).
- -v --verbose
Include additional detail. The hwloc-info tool may be used to display even more information about specific objects.
- -s --silent
Reduce the amount of details to show.
Only display distance matrices.
- -f --force
If the destination file already exists, overwrite it.
- -l --logical
Display hwloc logical indexes instead of physical/OS indexes (default for console output). These indexes are prefixed with "L#". The physical indexes of some objects (PU and Node by default, all objects if verbose) will appear as object attribute "P#...".
- -p --physical
Display OS/physical indexes instead of hwloc logical indexes (default for graphical output). These indexes are prefixed with "P#" instead of "L#" in the console output.
- -c --cpuset
Display the cpuset of each object.
- -C --cpuset-only
Only display the cpuset of each object; do not display anything else about the object.
Show CPU set strings in the format recognized by the taskset command-line program instead of hwloc-specific CPU set string format. This option should be combined with --cpuset or --cpuset-only, otherwise it will imply --cpuset.
- --only <type>
Only show objects of the given type in the textual output.
- --filter <type>:<kind>, --filter <type>
Filter objects of type <type>, or of any type if <type> is "all". "io", "cache" and "icache" are also supported.
<kind> specifies the filtering behavior. If "none" or not specified, all objects of the given type are removed. If "all", all objects are kept as usual. If "structure", objects are kept when they bring structure to the topology. If "important" (only applicable to I/O), only important objects are kept. See hwloc_topology_set_type_filter() for more details.
hwloc supports filtering any type except PUs and NUMA nodes. lstopo also offers PU and NUMA node filtering by hiding them in the graphical and textual outputs, but any object included in them (for instance Misc) will be hidden as well. Note that PUs and NUMA nodes may not be ignored in the XML output. Note also that the top-level object type cannot be ignored (usually Machine or System).
- --ignore <type>
This is the old way to specify --filter <type>:none.
Do not show caches. This is identical to --filter cache:none.
This is identical to --filter cache:structure.
This is identical to --filter icache:none.
Do not consider administration limitations.
- --flags <flags>
Enforce topology flags. The default is 0. These flags are passed to hwloc_topology_set_flags().
Do not show levels that do not have a hierarchical impact. This sets HWLOC_TYPE_FILTER_KEEP_STRUCTURE for all object types. This is identical to --filter all:structure.
Do not collapse identical PCI devices. By default, identical sibling PCI devices (such as many virtual functions inside a single physical device) are collapsed.
- --restrict <cpuset>
Restrict the topology to the given cpuset.
- --restrict binding
Restrict the topology to the current process binding. This option requires the use of the actual current machine topology (or any other topology with --thissystem or with HWLOC_THISSYSTEM set to 1 in the environment).
- --restrict-flags <flags>
Enforce flags when restricting the topology. The default is 0. These flags are passed to hwloc_topology_restrict().
Do not show any I/O device or bridge. This is identical to --filter io:none. By default, common devices (GPUs, NICs, block devices, ...) and interesting bridges are shown.
Do not show any I/O bridge except hostbridges. This is identical to --filter bridge:none. By default, common devices (GPUs, NICs, block devices, ...) and interesting bridges are shown.
Show all I/O devices and bridges. This is identical to --filter io:all. By default, only common devices (GPUs, NICs, block devices, ...) and interesting bridges are shown.
Assume that the selected backend provides the topology for the system on which we are running. This is useful when using --restrict binding and loading a custom topology such as an XML file.
- --pid <pid>
Detect topology as seen by process <pid>, i.e. as if process <pid> did the discovery itself. Note that this can for instance change the set of allowed processors. Also show this process current CPU and Memory binding by marking the corresponding PUs and NUMA nodes (in Green in the graphical output, see the Colors section below, or by appending (binding) to the verbose text output). If 0 is given as pid, the current binding for the lstopo process will be shown.
- --ps --top
Show existing processes as misc objects in the output. To avoid uselessly cluttering the output, only processes that are restricted to some part of the machine are shown. On Linux, kernel threads are not shown. If many processes appear, the output may become hard to read anyway, making the hwloc-ps program more practical.
- --children-order <order>
Change the order of the different kinds of children with respect to their parent in the graphical output.
The default order is memoryabove: it displays memory children above other children (and above the parent if it is a cache). PUs are therefore below their local NUMA nodes, like hwloc 1.x did.
If the order is changed to plain, lstopo displays the topology in a basic manner that strictly matches the actual tree: memory children are listed below their parent just like any other child. PUs are therefore on the side of their local NUMA nodes, below a common ancestor.
- --fontsize <size>
Set size of text font.
- --gridsize <size>
Set size of margin between elements.
- --horiz, --horiz=<type1,...>
Horizontal graphical layout instead of nearly 4/3 ratio. If a comma-separated list of object types is given, the layout only applies to the corresponding container objects. Ignored for bridges since their children are always vertically aligned.
- --vert, --vert=<type1,...>
Vertical graphical layout instead of nearly 4/3 ratio. If a comma-separated list of object types is given, the layout only applies to the corresponding container objects.
- --rect, --rect=<type1,...>
Rectangular graphical layout with nearly 4/3 ratio. If a comma-separated list of object types is given, the layout only applies to the corresponding container objects. Ignored for bridges since their children are always vertically aligned.
- --no-text, --no-text=<type1,...>
Do not display any text in boxes in the graphical output. If a comma-separated list of object types is given, text is disabled for the corresponding objects. This is mostly useful for removing text from Group objects. This feature is currently ignored for Bridges and PCI Devices.
- --text, --text=<type1,...>
Display text in boxes in the graphical output (default). If a comma-separated list of object types is given, text is reenabled for the corresponding objects (if it was previously disabled with --no-text).
- --no-index, --no-index=<type1,...>
Do not show object indexes in the graphical output. If a comma-separated list of object types is given, indexes are disabled for the corresponding objects.
- --index, --index=<type1,...>
Show object indexes in the graphical output (default). If a comma-separated list of object types is given, indexes are reenabled for the corresponding objects (if they were previously disabled with --no-index).
- --no-attrs, --no-attrs=<type1,...>
Do not show object attributes (such as memory size, cache size, PCI bus ID, PCI link speed, etc.) in the graphical output. If a comma-separated list of object types is given, attributes are disabled for the corresponding objects.
- --attrs, --attrs=<type1,...>
Show object attributes (such as memory size, cache size, PCI bus ID, PCI link speed, etc.) in the graphical output (default). If a comma-separated list of object types is given, attributes are reenabled for the corresponding objects (if they were previously disabled with --no-attrs).
Remove the text legend at the bottom.
- --append-legend <line>
Append the line of text to the bottom of the legend in graphical mode. If the line is too long, it will be truncated in the output. If adding multiple lines, each line should be given separately by passing this option multiple times.
Report version and exit.
lstopo and lstopo-no-graphics are capable of displaying a topological map of the system in a variety of different output formats. The only difference between lstopo and lstopo-no-graphics is that graphical outputs are only supported by lstopo, to reduce dependencies on external libraries. hwloc-ls is identical to lstopo-no-graphics.
The filename specified directly implies the output format that will be used; see the Output Formats section, below. Output formats that support color will indicate specific characteristics about individual CPUs by their color; see the Colors section, below.
By default, if no output filename is specific, the output is sent to a graphical window if possible in the current environment (DISPLAY environment variable set on Unix, etc.). Otherwise, a text summary is displayed in the console.
The filename on the command line usually determines the format of the output. There are a few filenames that indicate specific output formats and devices (e.g., a filename of "-" will output a text summary to stdout), but most filenames indicate the desired output format by their suffix (e.g., "topo.png" will output a PNG-format file).
The format of the output may also be changed with "--of". For instance, "--of pdf" will generate a PDF-format file on the standard output, while "--of fig toto" will output a Xfig-format file named "toto".
The list of currently supported formats is given below. Any of them may be used with "--of" or as a filename suffix.
Send the output to a window or to the console depending on the environment.
Send a text summary to stdout. Binding or unallowed processors are only annotated in this mode if verbose; see the Colors section, below.
Output an ASCII art representation of the map (formerly called txt). If outputting to stdout and if colors are supported on the terminal, the output will be colorized.
Output a representation of the map that can be loaded in Xfig.
If lstopo was compiled with the proper support, lstopo outputs a PDF representation of the map.
If lstopo was compiled with the proper support, lstopo outputs a Postscript representation of the map.
If lstopo was compiled with the proper support, lstopo outputs a PNG representation of the map.
If lstopo was compiled with the proper support, lstopo outputs an SVG representation of the map.
If the topology is symmetric (which requires that the root object has its symmetric_subtree field set), lstopo outputs a synthetic description string. This output may be reused as an input synthetic topology description later. See also the Synthetic topologies section in the documentation. Note that Misc and I/O devices are ignored during this export.
If lstopo was compiled with the proper support, lstopo outputs an XML representation of the map. It may be reused later, even on another machine, with lstopo --input, the HWLOC_XMLFILE environment variable, or the hwloc_topology_set_xml() function.
The following special names may be used:
Send a text summary to stdout.
Send a text summary to stdout. It is effectively the same as specifying "-".
If the entire filename is "-.<format>", lstopo behaves as if "--of <format> -" was given, which means a file of the given format is sent to the standard output.
See the output of "lstopo --help" for a specific list of what graphical output formats are supported in your hwloc installation.
Individual CPUs and NUMA nodes are colored in the graphical output formats to indicate different characteristics:
The topology is reported as seen by a specific process (see --pid), and the given CPU or NUMA node is in this process CPU or Memory binding mask.
The CPU or NUMA node is in the allowed set (see below). If the topology is reported as seen by a specific process (see --pid), the object is also not in this process binding mask.
The CPU or NUMA node is not in the allowed set (see below).
The "allowed set" is the set of CPUs or NUMA nodes to which the current process is allowed to bind. The allowed set is usually either inherited from the parent process or set by administrative qpolicies on the system. Linux cpusets are one example of limiting the allowed set for a process and its children to be less than the full set of CPUs or NUMA nodes on the system.
Different processes may therefore have different CPUs or NUMA nodes in the allowed set. Hence, invoking lstopo in different contexts and/or as different users may display different colors for the same individual CPUs (e.g., running lstopo in one context may show a specific CPU as red, but running lstopo in a different context may show the same CPU as white).
Some lstopo output modes, e.g. the console mode (default non-graphical output), do not support colors at all. The console mode displays the above characteristics by appending text to each PU line if verbose messages are enabled.
The color of each object in the graphical output may be enforced by specifying a "lstopoStyle" info attribute in that object. Its value should be a semi-colon separated list of "<attribute>=#rrggbb" where rr, gg and bb are the RGB components of a color, each between 0 and 255, in hexadecimal (00 to ff). <attribute> may be
Sets the background color of the main object box.
Sets the color of the text showing the object name, type, index, etc.
Sets the color of the additional text near the object, for instance the link speed behind a PCI bridge.
The "lstopoStyle" info may be added to a temporarily-saved XML topologies with hwloc-annotate, or with hwloc_obj_add_info(). For instance, to display all core objects in blue (with white names):
hwloc-annotate save.xml save.xml core:all info lstopoStyle "Background=#0000ff;Text=#ffffff"
lstopo -i save.xml
In its graphical output, lstopo uses simple rectangular heuristics to try to achieve a 4/3 ratio between width and height. Although the hierarchy of resources is properly reflected, the exact physical organization (NUMA distances, rings, complete graphs, etc.) is currently ignored. The layout of a level may be changed with --vert, --horiz, and --rect.
The position of memory children with respect to other children objects may be changed using --children-order.
To display the machine topology in textual mode:
To display the machine topology in ascii-art mode:
To display in graphical mode (assuming that the DISPLAY environment variable is set to a relevant value):
To export the topology to a PNG file:
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:
To get more details about the topology:
To only show cores:
lstopo --only core
To show cpusets:
To only show the cpusets of package:
lstopo --only package --cpuset-only
Simulate a fake hierarchy; this example shows with 2 NUMA nodes of 2 processor units:
lstopo --input "node: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)"
hwloc(7), hwloc-info(1), hwloc-bind(1), hwloc-annotate(1), hwloc-ps(1), hwloc-gather-topology(1), hwloc-gather-cpuid(1)
hwloc(7), hwlocality_info_attr(3), hwloc-annotate(1), hwloc-bind(1), hwloc-calc(1), hwloc-compress-dir(1), hwloc-diff(1), hwloc-dump-hwdata(1), hwloc-gather-cpuid(1), hwloc-gather-topology(1), hwloc-info(1), hwloc-patch(1), hwloc-ps(1).
The man page lstopo-no-graphics(1) is an alias of lstopo(1).