mirror of
https://github.com/clearml/clearml-agent
synced 2025-02-12 07:38:04 +00:00
Fix GPU monitoring on Windows machines
This commit is contained in:
parent
e4111c830b
commit
ce6831368f
@ -200,6 +200,9 @@ class GPUStatCollection(object):
|
|||||||
GPUStatCollection.global_processes[nv_process.pid] = \
|
GPUStatCollection.global_processes[nv_process.pid] = \
|
||||||
psutil.Process(pid=nv_process.pid)
|
psutil.Process(pid=nv_process.pid)
|
||||||
ps_process = GPUStatCollection.global_processes[nv_process.pid]
|
ps_process = GPUStatCollection.global_processes[nv_process.pid]
|
||||||
|
process['pid'] = nv_process.pid
|
||||||
|
# noinspection PyBroadException
|
||||||
|
try:
|
||||||
process['username'] = ps_process.username()
|
process['username'] = ps_process.username()
|
||||||
# cmdline returns full path;
|
# cmdline returns full path;
|
||||||
# as in `ps -o comm`, get short cmdnames.
|
# as in `ps -o comm`, get short cmdnames.
|
||||||
@ -217,7 +220,9 @@ class GPUStatCollection(object):
|
|||||||
process['cpu_memory_usage'] = \
|
process['cpu_memory_usage'] = \
|
||||||
round((ps_process.memory_percent() / 100.0) *
|
round((ps_process.memory_percent() / 100.0) *
|
||||||
psutil.virtual_memory().total)
|
psutil.virtual_memory().total)
|
||||||
process['pid'] = nv_process.pid
|
except Exception:
|
||||||
|
# insufficient permissions
|
||||||
|
pass
|
||||||
return process
|
return process
|
||||||
|
|
||||||
if not GPUStatCollection._gpu_device_info.get(index):
|
if not GPUStatCollection._gpu_device_info.get(index):
|
||||||
|
Loading…
Reference in New Issue
Block a user