(gpu_id)
| 29 | |
| 30 | |
| 31 | def print_gpu_usage(gpu_id): |
| 32 | print( |
| 33 | f">>>> GPU memoy: {pynvml.nvmlDeviceGetMemoryInfo(gpu_device).used / 1024**3:.2f} GB on {gpu_mem} GB" |
| 34 | ) |
| 35 | print( |
| 36 | f">>>> GPU usage: Load {pynvml.nvmlDeviceGetUtilizationRates(gpu_device).gpu} %, memory {pynvml.nvmlDeviceGetUtilizationRates(gpu_device).memory} %" |
| 37 | ) |
| 38 | |
| 39 | |
| 40 | if __name__ == "__main__": |
no outgoing calls
no test coverage detected
searching dependent graphs…