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

Function gather_gpu_devices

tensorflow/tools/test/gpu_info_lib.py:162–181  ·  view source on GitHub ↗

Gather gpu device info. Returns: A list of test_log_pb2.GPUInfo messages.

()

Source from the content-addressed store, hash-verified

160
161
162def gather_gpu_devices():
163 """Gather gpu device info.
164
165 Returns:
166 A list of test_log_pb2.GPUInfo messages.
167 """
168 try:
169 # Prefer using /proc if possible, it provides the UUID.
170 dev_info = _gather_gpu_devices_proc()
171 if not dev_info:
172 raise ValueError("No devices found")
173 return dev_info
174 except (IOError, ValueError, errors.OpError):
175 pass
176
177 try:
178 # Fall back on using libcudart
179 return _gather_gpu_devices_cudart()
180 except (OSError, ValueError, NotImplementedError, errors.OpError):
181 return []

Callers

nothing calls this directly

Calls 2

_gather_gpu_devices_procFunction · 0.85

Tested by

no test coverage detected