def METHOD_NAME(self, pid: int) -> float:
    """Return overall GPU utilization by pid if possible.
    Otherwise, returns aggregate utilization across all running processes."""
    if not self.has_gpu():
        return 0
    ngpus = self.__ngpus
    accounting_on = self.__has_per_pid_accounting
    utilization = 0
    for i in range(ngpus):
        h = self.__handle[i]
        if accounting_on:
            with contextlib.suppress(Exception):
                utilization += pynvml.nvmlDeviceGetAccountingStats(
                    h, pid
                ).gpuUtilization
        else:
            try:
                utilization += pynvml.nvmlDeviceGetUtilizationRates(h).gpu
            except pynvml.nvml.NVMLError_Unknown:
                # Silently ignore NVML errors. "Fixes" https://github.com/plasma-umass/scalene/issues/471.
                pass
    return (utilization / ngpus) / 100.0