def METHOD_NAME() -> List[GPU]:
    try:
        proc = subprocess.Popen(
            ["nvidia-smi", "--query-gpu=" + ",".join(gpu_fields), "--format=csv,noheader,nounits"],
            stdout=subprocess.PIPE,
            universal_newlines=True,
        )
    except FileNotFoundError:
        logging.info("detected 0 gpus (nvidia-smi not found)")
        # This case is expected if NVIDIA drivers are not available.
        return []
    except Exception as e:
        logging.warning(f"detected 0 gpus (error with nvidia-smi: {e})")
        return []
    gpus = []
    with proc:
        for field_list in csv.reader(proc.stdout):  # type: ignore
            if len(field_list) != len(gpu_fields):
                logging.warning(f"Ignoring unexpected nvidia-smi output: {field_list}")
                continue
            fields = dict(zip(gpu_fields, field_list))
            try:
                gpus.append(
                    GPU(
                        id=int(fields["index"]),
                        uuid=fields["uuid"].strip(),
                        load=float_or_default(fields, "utilization.gpu", 0.0) / 100,
                        memoryUtil=float_or_default(fields, "memory.used", 0.0)
                        / float_or_default(fields, "memory.total", 1.0),
                    )
                )
            except ValueError:
                logging.warning(f"Ignoring GPU with unexpected nvidia-smi output: {fields}")
    if proc.returncode:
        logging.warning(f"`nvidia-smi` exited with failure status code {proc.returncode}")
    logging.info(f"detected {len(gpus)} gpus")
    return gpus