5. Static Topology and Hardware Configuration#
GDS supports two independent static files that can reduce library initialization time:
Static topology: Defines routing preferences between GPUs and storage or network devices. Available starting with GDS 1.17.
Static hardware configuration: Caches GPU BAR size and PCI P2PDMA support to reduce runtime discovery during initialization. Supported in GDS 1.20.
Both files can be generated using gdscheck.py. The native gdscheck command supports the same export options.
5.1. Topology discovery methods#
gdscheck.py can generate a topology file using one of the following methods:
sysfs Reads system files to collect PCIe topology information.
cufile Gathers topology information using
cuFileExportPCIeTopology().latency Measures transaction latency between GPUs and NVMe devices, and between GPUs and NICs, and uses those values as a heuristic.
This method requires all of the following:
Root privileges.
The Perftest package is installed.
The
nvidia-peermemdriver is loaded.ib_read_latis available onPATH.socket,numa_node, andpcie_groupare determined by the user.
This method is most useful for CSP environments where the underlying bare-metal topology cannot be determined.
5.2. Using the topology file#
After generating the topology file, enable cuFile to use it by setting the following in cufile.json:
miscellaneous.enable_static_routing: Set totrue.miscellaneous.static_routing_filepath: Set to the generated file’s path, for example/etc/cufile-static-topology.json.
cuFile uses the file to build an internal topology according to the following rules:
Lower preference orders have higher priority.
The preference order range is from
0x1(minimum) to0x7000(maximum).Penalties are applied as follows:
Different root port: apply a penalty.
Different root port and NUMA node or socket: apply a larger penalty.
Different root port, NUMA node, and socket: apply the largest penalty.
cuFile rejects malformed JSON and negative socket, numa_node, or pcie_group values. If the topology file cannot be loaded or fails validation, cuFile falls back to runtime topology discovery.
5.3. Static GPU hardware configuration#
The hardware configuration file stores GPU properties separately from the topology file. Generate it using the config export mode:
$ gdscheck.py -e config -o /etc/cufile-static-config.json
After generating the hardware cache, enable cuFile to pick it up by setting the following configurations in cufile.json:
miscellaneous.enable_static_config: Set totrue.miscellaneous.static_config_filepath: Set to/etc/cufile-static-config.json.
These settings are independent of static routing. Regenerate the file after hardware or driver changes that could affect the cached properties. If the hardware configuration file cannot be loaded or a cached property is unavailable, cuFile falls back to runtime discovery.