add HardwareMonitor (Windows Only)
This commit is contained in:
@@ -245,5 +245,8 @@
|
||||
"Please convert model to safe tensors format first": "モデルを安全なテンソル形式に変換してください",
|
||||
"Convert To Safe Tensors Format": "安全なテンソル形式に変換",
|
||||
"Please change Strategy to WebGPU to use safetensors format": "StrategyをWebGPUに変更して、安全なテンソル形式を使用してください",
|
||||
"Preview Only": "プレビューのみ"
|
||||
"Preview Only": "プレビューのみ",
|
||||
"RAM": "RAM",
|
||||
"VRAM": "VRAM",
|
||||
"GPU Usage": "GPU使用率"
|
||||
}
|
||||
@@ -245,5 +245,8 @@
|
||||
"Please convert model to safe tensors format first": "请先将模型转换为Safetensors格式",
|
||||
"Convert To Safe Tensors Format": "转换为Safetensors格式",
|
||||
"Please change Strategy to WebGPU to use safetensors format": "请将Strategy改为WebGPU以使用safetensors格式",
|
||||
"Preview Only": "仅预览"
|
||||
"Preview Only": "仅预览",
|
||||
"RAM": "内存",
|
||||
"VRAM": "显存",
|
||||
"GPU Usage": "GPU占用"
|
||||
}
|
||||
@@ -2,11 +2,12 @@ import commonStore, { Platform } from './stores/commonStore';
|
||||
import { GetPlatform, ListDirFiles, ReadJson } from '../wailsjs/go/backend_golang/App';
|
||||
import { Cache, checkUpdate, downloadProgramFiles, LocalConfig, refreshLocalModels, refreshModels } from './utils';
|
||||
import { getStatus } from './apis';
|
||||
import { EventsOn } from '../wailsjs/runtime';
|
||||
import { EventsOn, WindowSetTitle } from '../wailsjs/runtime';
|
||||
import manifest from '../../manifest.json';
|
||||
import { defaultModelConfigs, defaultModelConfigsMac } from './pages/defaultConfigs';
|
||||
import { Preset } from './pages/PresetsManager/PresetsButton';
|
||||
import { wslHandler } from './pages/Train';
|
||||
import { t } from 'i18next';
|
||||
|
||||
export async function startup() {
|
||||
downloadProgramFiles();
|
||||
@@ -23,6 +24,8 @@ export async function startup() {
|
||||
|
||||
initPresets();
|
||||
|
||||
initHardwareMonitor();
|
||||
|
||||
await GetPlatform().then(p => commonStore.setPlatform(p as Platform));
|
||||
await initConfig();
|
||||
|
||||
@@ -117,3 +120,20 @@ async function initLocalModelsNotify() {
|
||||
refreshLocalModels({ models: commonStore.modelSourceList }, false); //TODO fix bug that only add models
|
||||
});
|
||||
}
|
||||
|
||||
type monitorData = {
|
||||
usedMemory: number;
|
||||
totalMemory: number;
|
||||
gpuUsage: number;
|
||||
gpuPower: number;
|
||||
usedVram: number;
|
||||
totalVram: number;
|
||||
}
|
||||
|
||||
async function initHardwareMonitor() {
|
||||
EventsOn('monitor', (data: string) => {
|
||||
const results: monitorData = JSON.parse(data);
|
||||
if (results)
|
||||
WindowSetTitle(`RWKV-Runner (${t('RAM')}: ${results.usedMemory.toFixed(1)}/${results.totalMemory.toFixed(1)} GB, ${t('VRAM')}: ${(results.usedVram / 1024).toFixed(1)}/${(results.totalVram / 1024).toFixed(1)} GB, ${t('GPU Usage')}: ${results.gpuUsage}%)`);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user