code: def gather_gpu_devices():
      """Gather gpu device info.
  
      Returns:
        A list of test_log_pb2.GPUInfo messages.
      """
      try:
          # Prefer using /proc if possible, it provides the UUID.
          dev_info = _gather_gpu_devices_proc()
          if not dev_info:
              raise ValueError("No devices found")
          return dev_info
      except (IOError, ValueError, errors.OpError):
          pass
  
      try:
          # Fall back on using libcudart
          return _gather_gpu_devices_cudart()
      except (OSError, ValueError, NotImplementedError, errors.OpError):
          return []
  
file_path: tensorflow/tensorflow/tools/test/gpu_info_lib.py
imports: import ctypes
  import platform
  from tensorflow.core.util import test_log_pb2
  from tensorflow.python.framework import errors
  from tensorflow.python.platform import gfile
label_desc: Use image node_id 3 for calling a global function with example usage: gather_gpu_devices() and returns: dev_info, _gather_gpu_devices_cudart, list