Skip to content

Commit

Permalink
improve stats about GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
marxin committed Feb 26, 2024
1 parent c7a2601 commit a5e2872
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions usage-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,13 @@ def get_footnote():
total_mem = to_gigabyte(psutil.virtual_memory().total)
gpu_line = ''
if gpu_stats:
total_gpu_mem = GPUtil.getGPUs()[0].memoryTotal / 1024
gpu_line = f' GPU avg/max: {gpu_stats.average():.1f}/{gpu_stats.maximum():.1f};'
gpu_line += f' GPU RAM: peak/total: {gpu_mem_stats.maximum():.1f}/{total_gpu_mem:.1f} GiB;'
return (f'host: {hostname}; CPUs: {args.used_cpus}/{cpu_count};'
f' CPU avg/max: {cpu_average:.1f}/{cpu_max:.1f}%;'
f'{gpu_line}'
f' RAM peak/total: {peak_memory:.1f}/{total_mem:.1f} GiB;')
f' RAM peak/total: {peak_memory:.1f}/{total_mem:.1f} GiB;'
f'{gpu_line}')


def get_footnote2():
Expand Down

0 comments on commit a5e2872

Please sign in to comment.