MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / utilization

Method utilization

tensorpack/utils/nvml.py:115–138  ·  view source on GitHub ↗

Percent of time over the past second was utilized. Details: Percent of time over the past second during which one or more kernels was executing on the GPU. Percent of time over the past second during which global (device) memory was being read or written Examp

(self)

Source from the content-addressed store, hash-verified

113 return {'total': c_memory.total, 'free': c_memory.free, 'used': c_memory.used}
114
115 def utilization(self):
116 """Percent of time over the past second was utilized.
117
118 Details:
119 Percent of time over the past second during which one or more kernels was executing on the GPU.
120 Percent of time over the past second during which global (device) memory was being read or written
121
122 Example:
123
124 >>> print(ctx.device(0).utilization())
125 {'gpu': 4L, 'memory': 6L}
126
127 """
128 class GpuUtilizationInfo(Structure):
129
130 _fields_ = [
131 ('gpu', c_uint),
132 ('memory', c_uint),
133 ]
134
135 c_util = GpuUtilizationInfo()
136 _check_return(_NVML.get_function(
137 "nvmlDeviceGetUtilizationRates")(self.hnd, byref(c_util)))
138 return {'gpu': c_util.gpu, 'memory': c_util.memory}
139
140 def name(self):
141 buflen = 1024

Callers 2

nvml.pyFile · 0.80
workerMethod · 0.80

Calls 3

GpuUtilizationInfoClass · 0.85
_check_returnFunction · 0.85
get_functionMethod · 0.80

Tested by

no test coverage detected