mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-05-21 06:45:24 -06:00
feat(api/process): update GPU status for gone processes
This commit is contained in:
parent
e41e0ea701
commit
b99d90544d
1 changed files with 13 additions and 1 deletions
|
|
@ -694,7 +694,19 @@ class GpuProcess: # pylint: disable=too-many-instance-attributes,too-many-publi
|
|||
self.set_gpu_memory(NA)
|
||||
self.set_gpu_cc_protected_memory(NA)
|
||||
self.set_gpu_utilization(NA, NA, NA, NA)
|
||||
self.device.processes()
|
||||
processes = self.device.processes()
|
||||
process = processes.get(self.pid, self)
|
||||
if process is not self:
|
||||
# The current process is gone and the instance has been removed from the cache.
|
||||
# Update GPU status from the new instance.
|
||||
self.set_gpu_memory(process.gpu_memory())
|
||||
self.set_gpu_cc_protected_memory(process.gpu_cc_protected_memory())
|
||||
self.set_gpu_utilization(
|
||||
process.gpu_sm_utilization(),
|
||||
process.gpu_memory_utilization(),
|
||||
process.gpu_encoder_utilization(),
|
||||
process.gpu_decoder_utilization(),
|
||||
)
|
||||
return self.gpu_memory()
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue