MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _gather_gpu_devices_proc

Function _gather_gpu_devices_proc

tensorflow/tools/test/gpu_info_lib.py:29–43  ·  view source on GitHub ↗

Try to gather NVidia GPU device information via /proc/driver.

()

Source from the content-addressed store, hash-verified

27
28
29def _gather_gpu_devices_proc():
30 """Try to gather NVidia GPU device information via /proc/driver."""
31 dev_info = []
32 for f in gfile.Glob("/proc/driver/nvidia/gpus/*/information"):
33 bus_id = f.split("/")[5]
34 key_values = dict(line.rstrip().replace("\t", "").split(":", 1)
35 for line in gfile.GFile(f, "r"))
36 key_values = dict((k.lower(), v.strip(" ").rstrip(" "))
37 for (k, v) in key_values.items())
38 info = test_log_pb2.GPUInfo()
39 info.model = key_values.get("model", "Unknown")
40 info.uuid = key_values.get("gpu uuid", "Unknown")
41 info.bus_id = bus_id
42 dev_info.append(info)
43 return dev_info
44
45
46class CUDADeviceProperties(ct.Structure):

Callers 1

gather_gpu_devicesFunction · 0.85

Calls 5

replaceMethod · 0.80
stripMethod · 0.80
splitMethod · 0.45
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected