From 84e1e1954fab6ff22865a9426a0440fffeb4f986 Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 12 Aug 2024 18:49:21 +0700 Subject: [PATCH] fix: add used vram into system event body (#1012) --- cortex-js/src/domain/models/resource.interface.ts | 2 +- .../services/resources-manager/resources-manager.service.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cortex-js/src/domain/models/resource.interface.ts b/cortex-js/src/domain/models/resource.interface.ts index 16dafb9dc..a048c38fd 100644 --- a/cortex-js/src/domain/models/resource.interface.ts +++ b/cortex-js/src/domain/models/resource.interface.ts @@ -17,5 +17,5 @@ export interface UsedMemInfo { export interface GpuInfo { name: string | undefined; - vram: number | null; + vram: UsedMemInfo; } diff --git a/cortex-js/src/infrastructure/services/resources-manager/resources-manager.service.ts b/cortex-js/src/infrastructure/services/resources-manager/resources-manager.service.ts index 565c788dc..190d79779 100644 --- a/cortex-js/src/infrastructure/services/resources-manager/resources-manager.service.ts +++ b/cortex-js/src/infrastructure/services/resources-manager/resources-manager.service.ts @@ -25,7 +25,10 @@ export class ResourcesManagerService { }, gpus: (await si.graphics()).controllers.map((gpu) => ({ name: gpu.name, - vram: gpu.vram, + vram: { + total: gpu.vram ?? 0, + used: gpu.memoryUsed ?? 0, + } })), }; }