MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / main

Function main

python/1_GettingStarted/systemInfo/systemInfo.py:171–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169
170
171def main() -> int:
172 import argparse
173
174 parser = argparse.ArgumentParser(
175 description="Print CUDA system / NVML information via cuda.core.system"
176 )
177 parser.add_argument(
178 "--no-topology",
179 action="store_true",
180 help="Skip cross-device topology/P2P queries",
181 )
182 args = parser.parse_args()
183
184 print_driver_info()
185
186 num_devices = system.get_num_devices()
187 print_header(f"Devices detected: {num_devices}")
188 if num_devices == 0:
189 print("No CUDA-capable devices found.")
190 return 0
191 if not CUDA_BINDINGS_NVML_IS_COMPATIBLE:
192 print(
193 "NVML is not compatible with the installed driver; skipping device detail."
194 )
195 return 0
196
197 devices = [system.Device(index=i) for i in range(num_devices)]
198 for device in devices:
199 print_device_info(device)
200
201 if not args.no_topology:
202 print_topology(devices)
203
204 print("\nDone")
205 return 0
206
207
208if __name__ == "__main__":

Callers 1

systemInfo.pyFile · 0.70

Calls 4

print_driver_infoFunction · 0.85
print_headerFunction · 0.85
print_topologyFunction · 0.85
print_device_infoFunction · 0.70

Tested by

no test coverage detected