class_docstr: This worker will send requests to a backend process, and measure the
  throughput and latency of those requests as well as GPU utilization.
docstr: This function will poll nvidia-smi for GPU utilization every 100ms to
  record the average GPU utilization.
docstr_tok: ["This","function","will","poll","nvidia-smi","for","GPU","utilization","every","100ms","to","record","the","average","GPU","utilization","."]
code: def _run_gpu_utilization(self, metrics_lock):
      """
      This function will poll nvidia-smi for GPU utilization every 100ms to
      record the average GPU utilization.
      """
  
      def get_gpu_utilization():
          try:
              nvidia_smi_output = subprocess.check_output(
                  [
                      "nvidia-smi",
                      "--query-gpu=utilization.gpu",
                      "--id=0",
                      "--format=csv,noheader,nounits",
                  ]
              )
              gpu_utilization = nvidia_smi_output.decode().strip()
              return gpu_utilization
          except subprocess.CalledProcessError:
              return "N/A"
  
      gpu_utilizations = []
  
      while self.poll_gpu:
          gpu_utilization = get_gpu_utilization()
          if gpu_utilization != "N/A":
              gpu_utilizations.append(float(gpu_utilization))
  
      with metrics_lock:
          self.metrics_dict["gpu_util"] = (
              torch.tensor(gpu_utilizations).mean().item()
          )
  
imports: import argparse
  import asyncio
  import os.path
  import subprocess
  import threading
  import time
  from concurrent.futures import ThreadPoolExecutor
  from queue import Empty
  import numpy
  import pandas
  import torch
  import torch.multiprocessing
label_desc: Use image node_id 3 for calling the FrontendWorker obj's underlying member method code with example usage: obj._run_gpu_utilization(metrics_lock) and returns: gpu_utilization, str