mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
ExtendedTools: limit GPU usage to <=1
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@4759 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -409,6 +409,9 @@ static VOID NTAPI ProcessesUpdatedCallback(
|
||||
|
||||
EtGpuNodeUsage = (FLOAT)EtGpuTotalRunningTimeDelta.Delta / elapsedTime;
|
||||
|
||||
if (EtGpuNodeUsage > 1)
|
||||
EtGpuNodeUsage = 1; // VMs seem to have very unreliable clocks
|
||||
|
||||
// Update per-process statistics.
|
||||
// Note: no lock is needed because we only ever modify the list on this same thread.
|
||||
|
||||
@@ -424,8 +427,13 @@ static VOID NTAPI ProcessesUpdatedCallback(
|
||||
EtpUpdateNodeInformation(block);
|
||||
|
||||
if (elapsedTime != 0)
|
||||
{
|
||||
block->GpuNodeUsage = (FLOAT)block->GpuRunningTimeDelta.Delta / elapsedTime;
|
||||
|
||||
if (block->GpuNodeUsage > 1)
|
||||
block->GpuNodeUsage = 1;
|
||||
}
|
||||
|
||||
if (maxNodeValue < block->GpuNodeUsage)
|
||||
{
|
||||
maxNodeValue = block->GpuNodeUsage;
|
||||
|
||||
Reference in New Issue
Block a user