Skip to content
Snippets Groups Projects
Commit 1d3b2f51 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Merge branch 'issue-7' into 'master'

Fixes reporting of % of GPU memory

Closes #7

See merge request bob/bob.ip.binseg!37
parents ba2fad94 83da949e
No related branches found
No related tags found
1 merge request!37Fixes reporting of % of GPU memory
Pipeline #54177 passed
......@@ -115,23 +115,36 @@ def gpu_log():
:py:class:`float`)
* ``memory.free``, as ``gpu_memory_free`` (transformed to gigabytes,
:py:class:`float`)
* ``utilization.memory``, as ``gpu_memory_percent``,
* ``100*memory.used/memory.total``, as ``gpu_memory_percent``,
(:py:class:`float`, in percent)
* ``utilization.gpu``, as ``gpu_utilization``,
* ``utilization.gpu``, as ``gpu_percent``,
(:py:class:`float`, in percent)
"""
return run_nvidia_smi(
("memory.used", "memory.free", "utilization.memory", "utilization.gpu"),
retval = run_nvidia_smi(
(
"memory.total",
"memory.used",
"memory.free",
"utilization.gpu",
),
(
"gpu_memory_total",
"gpu_memory_used",
"gpu_memory_free",
"gpu_memory_percent",
"gpu_percent",
),
)
# re-compose the output to generate expected values
return (
retval[1], # gpu_memory_used
retval[2], # gpu_memory_free
("gpu_memory_percent", 100 * (retval[1][1] / retval[0][1])),
retval[3], # gpu_percent
)
_CLUSTER = []
"""List of processes currently being monitored"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment