class_docstr: How many tasks are on each worker
class_docstr_tok: ["How","many","tasks","are","on","each","worker"]
code: def update(self):
      workers = list(self.scheduler.workers.values())
  
      utilization = []
      memory = []
      gpu_index = []
      y = []
      memory_total = 0
      memory_max = 0
      worker = []
  
      for idx, ws in enumerate(workers):
          try:
              info = ws.extra["gpu"]
          except KeyError:
              continue
          metrics = ws.metrics["gpu"]
          u = metrics["utilization"]
          mem_used = metrics["memory-used"]
          mem_total = info["memory-total"]
          memory_max = max(memory_max, mem_total)
          memory_total += mem_total
          utilization.append(int(u))
          memory.append(mem_used)
          worker.append(ws.address)
          gpu_index.append(idx)
          y.append(idx)
  
      memory_text = [format_bytes(m) for m in memory]
  
      result = {
          "memory": memory,
          "memory-half": [m / 2 for m in memory],
          "memory_text": memory_text,
          "utilization": utilization,
          "utilization-half": [u / 2 for u in utilization],
          "worker": worker,
          "gpu-index": gpu_index,
          "y": y,
          "escaped_worker": [escape.url_escape(w) for w in worker],
      }
  
      self.memory_figure.title.text = "GPU Memory: {} / {}".format(
          format_bytes(sum(memory)),
          format_bytes(memory_total),
      )
      self.memory_figure.x_range.end = memory_max
  
      update(self.source, result)
  
file_path: distributed/distributed/dashboard/components/nvml.py
imports: from __future__ import annotations
  import math
  from bokeh.core.properties import without_property_validation
  from bokeh.models import BasicTicker, ColumnDataSource, HoverTool, NumeralTickFormatter, OpenURL, TapTool
  from bokeh.plotting import figure
  from tornado import escape
  from dask.utils import format_bytes
  from distributed.dashboard.components import DashboardComponent, add_periodic_callback
  from distributed.dashboard.components.scheduler import BOKEH_THEME, TICKS_1024, env
  from distributed.dashboard.utils import update
  from distributed.utils import log_errors
label_desc: Use image node_id 2 for calling the GPUCurrentLoad obj's underlying member method code with example usage: obj.update() without return types