code: def probe(self) -> dict:
      info = {}
      try:
          pynvml.nvmlInit()  # type: ignore
          # todo: this is an adapter for the legacy stats system:
          info["gpu"] = pynvml.nvmlDeviceGetName(pynvml.nvmlDeviceGetHandleByIndex(0))  # type: ignore
          info["gpu_count"] = pynvml.nvmlDeviceGetCount()  # type: ignore
  
          device_count = pynvml.nvmlDeviceGetCount()  # type: ignore
          devices = []
          for i in range(device_count):
              handle = pynvml.nvmlDeviceGetHandleByIndex(i)  # type: ignore
              gpu_info = pynvml.nvmlDeviceGetMemoryInfo(handle)  # type: ignore
              devices.append(
                  {
                      "name": pynvml.nvmlDeviceGetName(handle),
                      "memory_total": gpu_info.total,
                  }
              )
          info["gpu_devices"] = devices
  
      except pynvml.NVMLError:
          pass
  
      return info
  
imports: import logging
  import threading
  from collections import deque
  from typing import TYPE_CHECKING, List
  from wandb.vendor.pynvml import pynvml
  from .aggregators import aggregate_mean
  from .asset_registry import asset_registry
  from .interfaces import Interface, Metric, MetricsMonitor
label_desc: Use image node_id 5 for calling the GPU obj's underlying member method code with example usage: obj.probe() and returns: info