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)
| 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 |
no test coverage detected