From 45df32229dd69c8a9747c80a493cf06ebf65ac8e Mon Sep 17 00:00:00 2001 From: Crystian Date: Mon, 15 Jan 2024 13:50:00 +0100 Subject: [PATCH] ready for test --- general/gpu.py | 8 ++++---- web/monitor.js | 4 ---- web/monitor.ts | 19 ++++--------------- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/general/gpu.py b/general/gpu.py index 8f0aa20..23ef515 100644 --- a/general/gpu.py +++ b/general/gpu.py @@ -80,10 +80,10 @@ class CGPUInfo: if self.cudaDevice == 'cpu': gpuType = 'cpu' gpus.append({ - 'gpu_utilization': -1, - 'vram_total': -1, - 'vram_used': -1, - 'vram_used_percent': -1, + 'gpu_utilization': 0, + 'vram_total': 0, + 'vram_used': 0, + 'vram_used_percent': 0, }) else: gpuType = self.cudaDevice diff --git a/web/monitor.js b/web/monitor.js index 12db684..3bb5561 100644 --- a/web/monitor.js +++ b/web/monitor.js @@ -381,26 +381,22 @@ class CrystoolsMonitor { if (data.gpus[index]) { const gpu = data.gpus[index]; if (gpu === undefined) { - console.error('UpdateAllMonitors: no GPU data for index', index); return; } this.updateMonitor(monitorSettings, gpu.gpu_utilization); } else { - console.error('UpdateAllMonitors: no GPU data for index', index); } }); this.monitorVRAMSettings.forEach((monitorSettings, index) => { if (data.gpus[index]) { const gpu = data.gpus[index]; if (gpu === undefined) { - console.error('UpdateAllMonitors: no GPU VRAM data for index', index); return; } this.updateMonitor(monitorSettings, gpu.vram_used_percent); } else { - console.error('UpdateAllMonitors: no GPU VRAM data for index', index); } }); } diff --git a/web/monitor.ts b/web/monitor.ts index 23f45a9..f77cb7c 100644 --- a/web/monitor.ts +++ b/web/monitor.ts @@ -315,13 +315,13 @@ class CrystoolsMonitor { if (data.gpus[index]) { const gpu = data.gpus[index]; if (gpu === undefined) { - console.error('UpdateAllMonitors: no GPU data for index', index); + // console.error('UpdateAllMonitors: no GPU data for index', index); return; } this.updateMonitor(monitorSettings, gpu.gpu_utilization); } else { - console.error('UpdateAllMonitors: no GPU data for index', index); + // console.error('UpdateAllMonitors: no GPU data for index', index); } }); @@ -329,26 +329,15 @@ class CrystoolsMonitor { if (data.gpus[index]) { const gpu = data.gpus[index]; if (gpu === undefined) { - console.error('UpdateAllMonitors: no GPU VRAM data for index', index); + // console.error('UpdateAllMonitors: no GPU VRAM data for index', index); return; } this.updateMonitor(monitorSettings, gpu.vram_used_percent); } else { - console.error('UpdateAllMonitors: no GPU VRAM data for index', index); + // console.error('UpdateAllMonitors: no GPU VRAM data for index', index); } }); - - - // const gpu2 = data.gpus[0] ? data.gpus[0] : { - // gpu_utilization: 0, vram_used_percent: 0, - // }; - - // const gpu_utilization = gpu.gpu_utilization; - // const vram_used_percent = gpu2.vram_used_percent; - - // this.updateMonitor(this.monitorGPUElement, gpu_utilization); - // this.updateMonitor(this.monitorVRAMElement, vram_used_percent); }; updateMonitor = (monitorSettings: TMonitorSettings, percent: number): void => {