HWLOC-GATHER-TOPOLOGY(1)
π HWLOC-GATHER-TOPOLOGY(1) π
ok so like, this page lives in the hwloc manual, and it's genuinely one of the most useful little tools ever β it's hwloc-gather-topology, and it's basically a screenshot button for your machine's whole soul. β¨
πΈ NAME πΈ
hwloc-gather-topology β saves all the relevant Linux and x86 topology files, plus the lstopo textual and XML outputs, so you can vibe with them later (possibly offline, bestie π).
π¦ SYNOPSIS π¦
hwloc-gather-topology [options] <path>
β¨ OPTIONS β¨
--ioβ also gathers I/O related files. heads up though: the gathering may be much slower, and the archive it makes may be much bigger. it's giving "worth it but be patient" π«Ά--dmiβ also gathers DMI/SMBIOS related files. this one requires root access, and thedmi-sysfskernel module should be loaded. no cap, it's a whole thing.--dtβ also gathers Device-Tree CPU files. these files aren't needed forhwlocitself, but they may be used for debugging what Linux exposes in/sys. lowkey just for the nerds (affectionate) π§--no-cpuidβ do not gather the x86 CPUID dump usinghwloc-gather-cpuid.--keepβ keep the temporary copy of the dumped files instead of destroying it. hoarder mode: activated π--versionβ report version and exit. short and iconic.-h,--helpβ display the help message and exit. we love a self-aware king π
π DESCRIPTION π
okay so here's the tea: hwloc-gather-topology saves all the relevant topology files into an archive (<path>.tar.bz2), the lstopo output (<path>.output), and the lstopo XML (<path>.xml). for example, it stores the /proc/cpuinfo file and the entire /sys/devices/system/node/ directory tree. like, the whole tree. π³
these files can be used later to explore the machine topology offline β main character energy for real. once the tarball has been extracted, it may for instance be given to some hwloc command-line utilities through their --input option. it is also possible to override the default topology that the hwloc library will read by setting the extracted path in the HWLOC_FSROOT environment variable. π₯
the archive and the lstopo textual and XML outputs may also be submitted to hwloc developers to debug issues remotely. remote debugging slay π
hwloc-gather-topology is a Linux specific tool β it is not installed on other operating systems. sorry to the BSD girlies π
NOTE: hwloc-gather-topology gathers many hardware details about the platform. the outputs and tarball should not be posted on public lists or websites unless it is clear that they contain no sensitive information. fr fr, do a vibe check before you post π¨
NOTE: the gathering may take several minutes, especially on large nodes. grab a snack, bestie. π
NOTE: it is highly recommended that you read the hwloc(7) overview page before reading this man page. homework first, then chaos π
π EXAMPLES π
to store topology information to be used later (possibly on a different host) please run:
$ hwloc-gather-topology /tmp/myhost
it will store all relevant topology files in the /tmp/myhost.tar.bz2 archive, the lstopo output in the /tmp/myhost.output file, and the lstopo XML in the /tmp/myhost.xml file. these files can be transferred on another host for later/offline analysis and/or as the input to various hwloc utilities. it's literally packing a little suitcase for your topology π§³
to use these data with hwloc utilities you should unpack myhost.tar.bz2 archive first:
$ tar jxvf /tmp/myhost.tar.bz2
a new directory named myhost now contains all topology files. then you ask various hwloc utilities to use this topology instead of the one of the real machine by passing --input myhost. to display the topology just run:
$ lstopo --input ./myhost
it is not necessary that the topology is extracted in the current directory β absolute or relative paths are also supported:
$ lstopo --input /path/to/remote/host/extracted/topology/
unpacking is actually only required for the hwloc C API. if the archivemount tool is available, command-line tools such as lstopo may actually read directly from the tarball. note however that this mode may be slow for large tarballs. we love a shortcut with a caveat π
$ lstopo --input /tmp/myhost.tar.bz2
to see how hwloc would distribute 8 parallel jobs on the original host:
$ hwloc-distrib --input myhost --single 8
to get the corresponding physical indexes in the previous command:
$ hwloc-calc --input myhost --po --li -I pu $(hwloc-distrib --input
myhost --single 8)
any program may actually override the default topology with a given archived one even if it does not have a --input option. the HWLOC_FSROOT environment variable should be used to do so:
$ HWLOC_FSROOT=myhost hwloc-calc --po --li -I pu $(hwloc-distrib
--single 8)
all these commands will produce the same output as if executed directly on the host on which the topology information was originally gathered by the hwloc-gather-topology script. it's giving time travel, honestly β
π RETURN VALUE π
upon successful execution, hwloc-gather-topology will exit with the code 0. we love a clean zero β¨
hwloc-gather-topology will return nonzero exit status if any kind of error occurs, such as (but not limited to) failure to create the archive or output files. if you see that, something's off and we're sad about it π
π SEE ALSO π
hwloc(7), lstopo(1), hwloc-gather-cpuid(1), hwloc-calc(1), hwloc-distrib(1)
and that's the whole page, bestie π«Ά this is version 2.15.0, dated Sep 23, 2026 β go gather some topology, you absolute icon ππ¦
π¦ where this page comes from
- arch rolling: hwloc 2.15.0-1 Β· BSD-3-Clause
- π the page's license: BSD-3-Clause
- Copyright Β© 2010 Jirka Hladky
- Copyright Β© 2010-2024 Inria. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms