[PR #4430] [GUI] Fix energy monitoring when a GPU lacks power readings #5044

Open
opened 2026-11-07 16:32:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4430
Author: @jun76
Created: 10/28/2026
Status: 🔄 Open

Base: main ← Head: gui-fix-energy-when-gpu-power-unavailable


📝 Commits (1)

  • 4cb31c1 [GUI] Fix energy monitoring when a GPU lacks power readings

📊 Changes

3 files changed (+28 additions, -2 deletions)

View changed files

📝 apps/host/server/energy-meter.mjs (+6 -0)
📝 apps/host/server/monitor.mjs (+2 -2)
➕ apps/host/tests/energy-meter.test.mjs (+20 -0)

📄 Description

Problem and result

On a Windows PC with an RTX 5090 and Intel UHD Graphics 770, the desktop Monitor stayed at 0.0 Wh: the RTX reported power, but the Intel GPU did not. The host discarded the total when any detected GPU lacked a power reading.

The host now sums valid power readings for its power display and energy meter. Other GPU metrics are unchanged.

image

Approach

Use reported GPU power and power-limit readings for those two totals. Add a regression test for a metered GPU beside an unmetered iGPU, multiple metered GPUs, and no available readings.

Validation

Tested on Strata 0.2.7 base plus 4cb31c1a, Windows, RTX 5090 and Intel UHD Graphics 770.

Passed: node --test tests/energy-meter.test.mjs tests/monitor-dashboard.test.mjs tests/monitor-host-sensors.test.mjs tests/sensor-pace.test.mjs in apps/host (22 tests); npm run typecheck; npm run build; desktop app built with npm run dev. In the desktop Monitor, energy rose from 0.5 to 0.9 to 1.2 Wh while the RTX reported power and the Intel GPU reported none.

Failed: Full npm test on Windows: 1,123 passed, 1 failed, 102 skipped. In powershell-utf8.test.mjs, Node crashes (0xC0000409) while removing a Cyrillic-named temporary folder. The same failure reproduces on unchanged upstream 5e8a4cca under the same conditions.

Not run: Other GPU combinations or model inference. No native engine code changed, so backend builds were not run.

Limits

Energy remains an estimate from sampled GPU power. It covers only GPUs with available readings and resets when the host restarts.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4430 **Author:** [@jun76](https://github.com/jun76) **Created:** 10/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `gui-fix-energy-when-gpu-power-unavailable` --- ### 📝 Commits (1) - [`4cb31c1`](https://github.com/Niko1221/Strata/commit/4cb31c1a2f9859e7e195f4ce478c6d1fdf4ae978) [GUI] Fix energy monitoring when a GPU lacks power readings ### 📊 Changes **3 files changed** (+28 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `apps/host/server/energy-meter.mjs` (+6 -0) 📝 `apps/host/server/monitor.mjs` (+2 -2) ➕ `apps/host/tests/energy-meter.test.mjs` (+20 -0) </details> ### 📄 Description ## Problem and result On a Windows PC with an RTX 5090 and Intel UHD Graphics 770, the desktop Monitor stayed at `0.0 Wh`: the RTX reported power, but the Intel GPU did not. The host discarded the total when any detected GPU lacked a power reading. The host now sums valid power readings for its power display and energy meter. Other GPU metrics are unchanged. <img width="335" height="105" alt="image" src="https://github.com/user-attachments/assets/ac21ab87-725e-4773-b0e7-95e34a5a215b" /> ## Approach Use reported GPU power and power-limit readings for those two totals. Add a regression test for a metered GPU beside an unmetered iGPU, multiple metered GPUs, and no available readings. ## Validation Tested on Strata 0.2.7 base plus `4cb31c1a`, Windows, RTX 5090 and Intel UHD Graphics 770. **Passed:** `node --test tests/energy-meter.test.mjs tests/monitor-dashboard.test.mjs tests/monitor-host-sensors.test.mjs tests/sensor-pace.test.mjs` in `apps/host` (22 tests); `npm run typecheck`; `npm run build`; desktop app built with `npm run dev`. In the desktop Monitor, energy rose from `0.5` to `0.9` to `1.2 Wh` while the RTX reported power and the Intel GPU reported none. **Failed:** Full `npm test` on Windows: 1,123 passed, 1 failed, 102 skipped. In `powershell-utf8.test.mjs`, Node crashes (`0xC0000409`) while removing a Cyrillic-named temporary folder. The same failure reproduces on unchanged upstream `5e8a4cca` under the same conditions. **Not run:** Other GPU combinations or model inference. No native engine code changed, so backend builds were not run. ## Limits Energy remains an estimate from sampled GPU power. It covers only GPUs with available readings and resets when the host restarts. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5044
No description provided.