MCPcopy Create free account
hub / github.com/mlco2/codecarbon / _get_gpu_utilization

Method _get_gpu_utilization

codecarbon/core/gpu_nvidia.py:106–110  ·  view source on GitHub ↗

Returns the % of utilization of the kernels during the last sample https://docs.nvidia.com/deploy/nvml-api/structnvmlUtilization__t.html#structnvmlUtilization__t

(self)

Source from the content-addressed store, hash-verified

104 return None
105
106 def _get_gpu_utilization(self):
107 """Returns the % of utilization of the kernels during the last sample
108 https://docs.nvidia.com/deploy/nvml-api/structnvmlUtilization__t.html#structnvmlUtilization__t
109 """
110 return pynvml.nvmlDeviceGetUtilizationRates(self.handle).gpu
111
112 def _get_compute_mode(self) -> int:
113 """Returns the compute mode of the GPU

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected