class_docstr: GPU power usage in percent for each GPU.
class_docstr_tok: ["GPU","power","usage","in","percent","for","each","GPU","."]
code: def sample(self) -> None:
      power_usage = []
      device_count = pynvml.nvmlDeviceGetCount()  # type: ignore
      for i in range(device_count):
          handle = pynvml.nvmlDeviceGetHandleByIndex(i)  # type: ignore
          power_watts = pynvml.nvmlDeviceGetPowerUsage(handle)  # type: ignore
          power_capacity_watts = pynvml.nvmlDeviceGetEnforcedPowerLimit(handle)  # type: ignore
          power_usage.append((power_watts / power_capacity_watts) * 100)
      self.samples.append(power_usage)
  
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 2 for calling the GPUPowerUsagePercent obj's underlying member method code with example usage: obj.sample() without return types