mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1876] [CLOSED] Add opt-in cumulative GPU energy monitoring to the Power card #3729
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3729
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1876
Author: @hash13
Created: 10/10/2026
Status: ❌ Closed
Base:
main← Head:feature/monitor-gpu-energy-optin📝 Commits (1)
4b8ba58feat(monitor): add opt-in cumulative GPU energy tracking📊 Changes
3 files changed (+52 additions, -3 deletions)
View changed files
📝
serve/server.py(+3 -1)📝
serve/telemetry.py(+44 -1)📝
serve/web/app.js(+5 -1)📄 Description
Extended version with electricity pricing: https://github.com/Niko1221/Strata/pull/1925
Summary
This PR adds opt-in cumulative GPU energy monitoring to the existing Power card, based on Strata v0.1.42.
The implementation reuses Strata's existing GPU telemetry, multi-GPU support, and Monitor refresh infrastructure. No additional services, dependencies, or persistent storage are required.
This is intentionally a small first step, without request-level energy attribution or token cost calculations.
Screenshot
Configuration
Enable energy monitoring by adding an
electricityblock at the top level of the existing Strata JSON configuration:An empty object is sufficient to enable the feature.
Without this block, the existing Power card remains unchanged.
Electricity prices and currency settings are not used in this initial version.
Power Card
The existing Power card continues to display:
When enabled, it additionally displays cumulative GPU energy consumption since telemetry started.
Example:
Energy values are formatted using the browser's locale:
The accumulated value updates automatically through the existing Monitor refresh cycle.
Energy Measurement
The implementation prefers NVIDIA's cumulative NVML hardware energy counter (
nvmlDeviceGetTotalEnergyConsumption).Unlike integrating periodically sampled power readings, the hardware counter directly reports accumulated energy. This provides more reliable measurements, particularly when GPU power changes between samples.
If the hardware counter is unavailable, energy consumption is estimated by integrating the existing GPU power readings over time.
For multi-GPU configurations, the energy consumption of monitored GPUs is aggregated.
The accumulated energy is kept in memory and resets when Strata restarts.
Scope
The cumulative energy value is exposed through the existing
/metricshardware data.Measurement covers GPU energy only. CPU, RAM, motherboard, storage, fans, and PSU losses are not included.
Request-level energy attribution is deferred to a later PR, initially limited to serial requests to avoid double counting energy during overlapping requests.
Changed Files
serve/telemetry.pyserve/server.pyelectricityconfiguration passed to telemetryserve/web/app.js🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.