Skip to content

Monitor: per-GPU view, more cards, and a layout you can rearrange - #1114

Closed
Efs-O wants to merge 1 commit into
Niko1221:mainfrom
Efs-O:monitor/cards-gpu-selector
Closed

Efs-O wants to merge 1 commit into
Niko1221:mainfrom
Efs-O:monitor/cards-gpu-selector

Conversation

@Efs-O

@Efs-O Efs-O commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Multi-GPU

  • A GPU selector in the Model state card: All / GPU 0 / GPU 1 … (a dropdown above 6 cards). It switches the GPU load, VRAM, temperature, power and PCIe cards to one card's values and history.
  • NVIDIA cards the engine does not use (a vision-encoder card, for example) are listed and marked "not in use". All keeps the engine-only totals.
  • PCIe shows in/out rates and link gen/width per card.
  • A single-card machine looks as before: no selector.

New cards and table columns

  • Speculation (draft acceptance), Prompt reuse, Prefill time, VRAM free (the tightest card; warns under 1 GiB, danger under 0.5 GiB), all-GPU power, session time.
  • Recent requests gains Prefill and Drafts columns, plus a Clear button that empties the table on this page only (nothing is sent to the server; a refresh brings the rows back).
  • Temperature graphs scale to their own range, so a 25-30 °C swing is visible instead of a flat line.
  • Missing values say "No requests yet" or "Not reported by this engine" instead of a bare dash.

Optional sensors

  • CPU temperature and power from LibreHardwareMonitor's local web server (127.0.0.1:8085 by default, STRATA_LHM_URL to change it, empty to disable). This adds a CPU temp card, the package power under the CPU load (the CPU card, renamed to match "GPU load") and a measured "GPUs + CPU" power card. It reads the first CPU's package sensors by name ("CPU Package" on Intel; "Core (Tctl/Tdie)" and "Package" on AMD), because LHM's sensor numbers differ between CPU models. On Windows without LHM running, the CPU temp card says "Needs LibreHardwareMonitor" and its tooltip explains how to turn on LHM's web server. On Linux the CPU temperature is read from the kernel's hwmon files instead (k10temp / zenpower on AMD, coretemp on Intel; no root, no lm-sensors); a system with neither hides the card.
  • Forge card, off by default. With STRATA_FORGE_URL=http://127.0.0.1:8799 set, it shows the active chat of Forge (a VS Code coding assistant for local models): turns, tool calls and tokens, read from Forge's local, read-only /stats. Disclosure: Forge is my own project and I run it on top of Strata. If you'd rather not have it in Strata, say so and I'll drop it from the PR.

Both are localhost-only. LHM is polled every 2 s and backs off for 30 s after a failure. Forge is never contacted unless STRATA_FORGE_URL is set.

Layout

  • The cards sit in one 4-column grid (2 columns on narrow screens).
  • Drag a card to reorder it: with the mouse, with press-and-hold on touch, or with Alt+←/→ from the keyboard (the new position is announced to screen readers). Dropping outside the cards puts it back.
  • The × on a card hides it.
  • Order and hidden cards are saved in the browser (localStorage). A "Reset layout · 2 icons hidden" link above the cards brings everything back. It only appears when something has changed.

/metrics

Every new field is optional, and single-card and AMD output is unchanged:

  • hardware.gpus[*]: power_limit, pcie_rx_mb, pcie_tx_mb, pcie_gen, pcie_gen_max, pcie_width
  • history.gpus: per-card history
  • hardware.other_gpus and hardware.all_gpu_power
  • hardware.cpu_temp and hardware.cpu_power (LHM)
  • hardware_static.os
  • forge at the top level (null when the card is off)

They are documented in docs/DETAILS.md.

Testing

  • python -m unittest serve.test_monitor serve.test_server serve.test_forge_stats serve.test_lhm on current main: 238 pass (the full serve suite, 623 tests, passes after the latest rebase). The AMD sensor names are covered by a test fixture; I have no AMD machine to try it on.
  • Checked in Edge at 1600 and 390 px wide, in light and dark: drag with the mouse, emulated touch and the keyboard; hide, reload, reset.
  • Larger machines simulated by rewriting /metrics in the browser: 6 cards (buttons, wrapping to two rows at 390 px), 5 + 1 not in use, and 7 + 1 (dropdown). The per-card lines switch to summaries above 3 cards, with every card in the tooltip.
  • Run on Windows with an i9-9900KF, two RTX 5060 Ti running the model and an RTX 3060 for the vision encoder, with LHM running.
  • Rebased onto current main as one commit.

🤖 Generated with Claude Code

@edt-xx

edt-xx commented Oct 6, 2026

Copy link
Copy Markdown

Tested here on 1.4.1. Works as advertised - nice.

@ed-hch

ed-hch commented Oct 7, 2026

Copy link
Copy Markdown

Tested here on 1.4.0. With LibreHardwareMonitor on Intel+Nvidia system. Working perfectly.

@Efs-O
Efs-O force-pushed the monitor/cards-gpu-selector branch from 77a36b6 to 843bacd Compare October 7, 2026 21:09
@Efs-O

Efs-O commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and resolved the conflict with #1380 (kept the gpu_note fallbacks for Windows AMD).

@edt-xx

edt-xx commented Oct 7, 2026

Copy link
Copy Markdown

Rebased - Thank you. Much prefer the updated stats.

@edt-xx

edt-xx commented Oct 7, 2026

Copy link
Copy Markdown

I am on AMD linux if you need/want anything tried

@edt-xx

edt-xx commented Oct 8, 2026

Copy link
Copy Markdown

Noticed one thing. The box for MTP hit rate does not display until there are hits. It should act like all the others and be present without stats.

@Efs-O

Efs-O commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@edt-xx Good catch, fixed: the Speculation card now shows whenever MTP is on ("No requests yet" → "No drafts yet" → the rate), instead of appearing only after the first draft. Also rebased again onto main; resolved the conflict with bad9a8f (the Forge poller now stops with the server too).

And yes please on AMD Linux: a quick look that the Monitor page looks the same as before for you would help, since I couldn't test that path.

@Efs-O
Efs-O force-pushed the monitor/cards-gpu-selector branch from 843bacd to 1154721 Compare October 8, 2026 15:59
@edt-xx

edt-xx commented Oct 8, 2026 •

Copy link
Copy Markdown

the mcp card is now fixed. The only thing not updating is CPU temp (and pcie bandwidth which is not captured for AMD on Linux). LibreHardwareMonitor is windows only. on linux running the sensors (no need for root)
command and grep TSI0_TEMP will work on amd (full output attached)

[ed@grover sen]$ sensors | grep TSI0_TEMP
TSI0_TEMP: +45.4°C

sensors.txt

- A GPU selector in the Model state card: All / GPU 0 / GPU 1 … (a dropdown above 6 cards). It switches the GPU load, VRAM, temperature, power and PCIe cards to one card's values and history.
- NVIDIA cards the engine does not use (a vision-encoder card, for example) are listed and marked "not in use". All keeps the engine-only totals.
- PCIe shows in/out rates and link gen/width per card.
- A single-card machine looks as before: no selector.

- Speculation (draft acceptance), Prompt reuse, Prefill time, VRAM free (the tightest card; warns under 1 GiB, danger under 0.5 GiB), all-GPU power, session time.
- Recent requests gains Prefill and Drafts columns, plus a Clear button that empties the table on this page only (nothing is sent to the server; a refresh brings the rows back).
- Temperature graphs scale to their own range, so a 25-30 °C swing is visible instead of a flat line.
- Missing values say "No requests yet" or "Not reported by this engine" instead of a bare dash.

- **CPU temperature and power** from LibreHardwareMonitor's local web server (`127.0.0.1:8085` by default, `STRATA_LHM_URL` to change it, empty to disable). This adds a CPU temp card, the package power under the CPU load (the CPU card, renamed to match "GPU load") and a measured "GPUs + CPU" power card. It reads the first CPU's package sensors by name ("CPU Package" on Intel; "Core (Tctl/Tdie)" and "Package" on AMD), because LHM's sensor numbers differ between CPU models. On Windows without LHM running, the CPU temp card says "Needs LibreHardwareMonitor" and its tooltip explains how to turn on LHM's web server. On other systems the card is hidden.
- **Forge card, off by default.** With `STRATA_FORGE_URL=http://127.0.0.1:8799` set, it shows the active chat of Forge (a VS Code coding assistant for local models): turns, tool calls and tokens, read from Forge's local, read-only `/stats`. Disclosure: Forge is my own project and I run it on top of Strata. If you'd rather not have it in Strata, say so and I'll drop it from the PR.

Both are localhost-only. LHM is polled every 2 s and backs off for 30 s after a failure. Forge is never contacted unless `STRATA_FORGE_URL` is set.

- The cards sit in one 4-column grid (2 columns on narrow screens).
- Drag a card to reorder it: with the mouse, with press-and-hold on touch, or with Alt+←/→ from the keyboard (the new position is announced to screen readers). Dropping outside the cards puts it back.
- The × on a card hides it.
- Order and hidden cards are saved in the browser (`localStorage`). A "Reset layout · 2 icons hidden" link above the cards brings everything back. It only appears when something has changed.

Every new field is optional, and single-card and AMD output is unchanged:
- `hardware.gpus[*]`: `power_limit`, `pcie_rx_mb`, `pcie_tx_mb`, `pcie_gen`, `pcie_gen_max`, `pcie_width`
- `history.gpus`: per-card history
- `hardware.other_gpus` and `hardware.all_gpu_power`
- `hardware.cpu_temp` and `hardware.cpu_power` (LHM)
- `hardware_static.os`
- `forge` at the top level (`null` when the card is off)

They are documented in `docs/DETAILS.md`.

- `python -m unittest serve.test_monitor serve.test_server serve.test_forge_stats serve.test_lhm` on current `main`: 238 pass. The AMD sensor names are covered by a test fixture; I have no AMD machine to try it on.
- Checked in Edge at 1600 and 390 px wide, in light and dark: drag with the mouse, emulated touch and the keyboard; hide, reload, reset.
- Larger machines simulated by rewriting `/metrics` in the browser: 6 cards (buttons, wrapping to two rows at 390 px), 5 + 1 not in use, and 7 + 1 (dropdown). The per-card lines switch to summaries above 3 cards, with every card in the tooltip.
- Run on Windows with an i9-9900KF, two RTX 5060 Ti running the model and an RTX 3060 for the vision encoder, with LHM running.
- Rebased onto current `main` as one commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Efs-O

Efs-O commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@edt-xx Thanks for the sensors output. CPU temperature now works on Linux without LibreHardwareMonitor. Rather than parse sensors, it reads the kernel's hwmon files directly (what sensors reads underneath; no root, no lm-sensors): k10temp Tctl on AMD (your 45.4 °C, the same value as TSI0_TEMP), zenpower if you use that driver, coretemp "Package id 0" on Intel. TSI0_TEMP comes from your board's nct6799 chip, so it isn't there on other boards; k10temp is on every Ryzen.

Could you pull and check the CPU temp card shows up for you? PCIe traffic on AMD is a separate thing: the amdgpu files Strata reads have no PCIe byte counters, so that stays as before.

@edt-xx

edt-xx commented Oct 10, 2026 •

Copy link
Copy Markdown

The cpu temp is now working on my b650mb with ryzen 7 7700. Thank you. I do not think the pcie data is tracked for AMD cards on Linux (Intel may be another story).

@Niko1221

Copy link
Copy Markdown
Owner

Thanks for the pull request.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to review properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Rebase on main if it no longer applies, and re-run your checks on 0.2.0-beta.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the pull request template: the problem and result, and the validation (what you ran, on which revision, what you saw).
  4. Comment /reopen. A check runs and either reopens the pull request or lists what is still missing.

The rules are in CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants