code: def test_nvidia_device(idx: int):
      from py3nvml import py3nvml as nvml
  
      handle = nvml.nvmlDeviceGetHandleByIndex(idx)
  
      pciInfo = nvml.nvmlDeviceGetPciInfo(handle)
  
      brands = {
          nvml.NVML_BRAND_UNKNOWN: "Unknown",
          nvml.NVML_BRAND_QUADRO: "Quadro",
          nvml.NVML_BRAND_TESLA: "Tesla",
          nvml.NVML_BRAND_NVS: "NVS",
          nvml.NVML_BRAND_GRID: "Grid",
          nvml.NVML_BRAND_GEFORCE: "GeForce",
      }
  
      inspect(
          idx=idx,
          # id=pciInfo.busId,
          # uuid=nvml.nvmlDeviceGetUUID(handle),
          name=nvml.nvmlDeviceGetName(handle),
          # brand=brands[nvml.nvmlDeviceGetBrand(handle)],
          # multi_gpu=nvml.nvmlDeviceGetMultiGpuBoard(handle),
          pcie_link=nvml.nvmlDeviceGetCurrPcieLinkWidth(handle),
          fan=nvml.nvmlDeviceGetFanSpeed(handle),
          # power=nvml.nvmlDeviceGetPowerState(handle),
          mem_total=nvml.nvmlDeviceGetMemoryInfo(handle).total,
          mem_used=nvml.nvmlDeviceGetMemoryInfo(handle).used,
          util_gpu=nvml.nvmlDeviceGetUtilizationRates(handle).gpu,
          # util_mem=nvml.nvmlDeviceGetUtilizationRates(handle).memory,
          temp=nvml.nvmlDeviceGetTemperature(
              handle, nvml.NVML_TEMPERATURE_GPU
          ),
          power=nvml.nvmlDeviceGetPowerUsage(handle),
          power_limit=nvml.nvmlDeviceGetPowerManagementLimit(handle),
          # display=nvml.nvmlDeviceGetDisplayMode(handle),
          display_active=nvml.nvmlDeviceGetDisplayActive(handle),
      )
  
      logger.log()
  
      procs = nvml.nvmlDeviceGetGraphicsRunningProcesses(handle)
      for p in procs:
          inspect(
              name=nvml.nvmlSystemGetProcessName(p.pid),
              pid=p.pid,
              mem=p.usedGpuMemory,
          )
  
      procs = nvml.nvmlDeviceGetComputeRunningProcesses(handle)
      for p in procs:
          inspect(
              name=nvml.nvmlSystemGetProcessName(p.pid),
              pid=p.pid,
              mem=p.usedGpuMemory,
          )
  
      logger.log()
  
imports: from labml import lab, logger
  from labml.logger import inspect
label_desc: Use image node_id 1 for calling a global function with example usage: test_nvidia_device(idx) without return types