Skip to content

Unsloth Studio (AMD/Windows): show Live monitor VRAM usage when only an iGPU has no reading - #14040

Closed
LeoBorcherding wants to merge 13 commits into
unslothai:mainfrom
LeoBorcherding:fix/vram-monitor-igpu-unknown
Closed

LeoBorcherding wants to merge 13 commits into
unslothai:mainfrom
LeoBorcherding:fix/vram-monitor-igpu-unknown

Conversation

@LeoBorcherding

Copy link
Copy Markdown
Collaborator

On a Windows ROCm host with discrete cards plus an integrated GPU, Settings > System > Live monitor showed VRAM as Unknown / 65.7 GiB VRAM + 34.3 GiB shared with -- for the percent, even though both discrete cards had readings (0 GiB and 2.15 GiB used). The floating resource monitor had the same tile. That leaves no way to watch each card's memory during a dual-R9700 run.

Hardware: 2x Radeon AI PRO R9700 (31.9 GiB each) plus the Ryzen 9 9950X iGPU (gfx1036, 1.97 GiB VRAM + 34.3 GiB shared). The iGPU reports no usage.

Cause

resolveGpuVramUsedGb (studio/frontend/src/hooks/gpu-vram.ts) sums per-device usage only when every device has a number. The iGPU's missing reading fails that check, and the host aggregate is null here, so the whole tile went Unknown.

Fix

New resolveGpuVramUsage(gpu) returns the used figure and the devices it covers:

  • Every device reports, or there's a host aggregate: unchanged.
  • The only unreported devices share host memory (shared_memory, or unified_memory for a Linux ROCm APU): sums the reporting cards and returns just those.
  • An unreported discrete card: still unknown. No usage is made up for a card.

On the host above the tile reads 2.15 GiB / 63.8 GiB, 3%. The GPU list still shows the iGPU row with Unknown usage. The total covers only the reporting cards, matching how the Vulkan iGPU path already measures discrete usage (tests/gpu-memory-display.test.ts).

Testing (measured at 76fc87b, Windows 11, Node 24.15.0, frontend only)

  • New tests/vram-monitor-igpu-unknown.test.ts uses the real device data from this host. On main it returns null (Unknown); here it returns 2.15 against 63.8 GiB. Also covered: an unreported discrete card stays unknown, a Linux unified_memory APU, nothing reporting stays null, and a host aggregate still wins.
  • Touched and related suites: 31/31. tsc clean.

Not run in the app yet, so no screenshots. Not covered: Linux ROCm with an APU next to a discrete card.

Related

#13421 split the iGPU row into VRAM + shared. #14039 handles the iGPU in the Train page VRAM total and default GPU pick; both touch gpu-vram.ts but neither depends on the other.

…n only an iGPU reports none

On a Windows ROCm host with discrete cards plus an iGPU (2x R9700 + Ryzen 9950X
gfx1036), the iGPU reports no usage and there is no host aggregate, so
resolveGpuVramUsedGb gave up and the Live monitor VRAM tile read
"Unknown / 65.7 GiB VRAM + 34.3 GiB shared" while both cards had readings.

resolveGpuVramUsage returns the used figure plus the devices it covers. When the
only unreported devices share host memory, it sums the cards that report and the
Settings tile and floating monitor size themselves against those cards' VRAM. An
unreported discrete card still leaves the figure unknown.
@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Pushed 0a4318d: merged main (88afa84), no conflicts and no code changes. At that head (Windows 11, Node 24.15.0), the touched and related frontend suites pass 36/36 and tsc -b is clean.

This is the two-discrete-card case that #11871 and #13421 didn't reach (#8942 was the one-card version).

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-19T14:53:10.011054Z 8bed614 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Ran it on real hardware: 2x Radeon AI PRO R9700 + Ryzen 9 9950X iGPU (gfx1036), Windows 11, Adrenalin 26.9.2.

I took the live device rows from the backend's _get_cached_system_gpu_info while another job was using both cards (R9700s at 4.92 and 10.56 GiB used, iGPU vram_used_gb: null, no host aggregate), then fed them through main's frontend code (88afa84) and this PR's (0a4318d).

main 88afa84 this PR 0a4318d
Live monitor VRAM Unknown 15.48 / 63.72 GiB (2 devices)

I haven't taken a screenshot, because the UI on this build needs a login I didn't set up.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Pushed 8bed614: merged main (4ea4c75) and raised the bundle budget by this PR's growth. Frontend build + bundle sanity failed at the previous head (6682.4 KB raw > 6682.0 KB). The growth is 284 B raw / 72 B transfer, measured against 4ea4c75 on the same machine and build. Bundle check passes locally, the touched suites pass 36/36, and tsc -b is clean. The previous Codex run errored, so re-requesting.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 20, 2026
… About, not the system RAM it can borrow (unslothai#14317)

Settings > About listed a Windows ROCm iGPU as `AMD Radeon(TM) Graphics
· 36 GiB`. Only about 2 GiB of that is the iGPU's own memory. The rest
is system RAM it can borrow, and every GPU can borrow system RAM, so
listing it on that row makes the iGPU read like a 36 GiB card next to
the 32 GiB R9700s.

## Fix
- `/api/system/hardware` now passes `shared_memory`, `unified_memory`
and `shared_memory_host_backed_gb` on each `gpus` row.
- About shows the iGPU's own memory and marks it: `AMD Radeon(TM)
Graphics · 2 GiB (integrated)`. The split uses the same
`deviceSharedMemorySplitGb` as Settings > System.
- An integrated GPU with no separate VRAM (NVIDIA GB10 / Jetson, where
the whole total is host memory) keeps its total, e.g. `120 GiB
(integrated)`.
- Discrete cards and responses from older backends are unchanged.
- New `settings.about.gpuIntegrated` string, translated in all 14
locales.
- Bundle budget raised by this change: 474 B raw / 97 B transfer against
`e326020`.

## Tests (measured at `c36c64e`, Windows 11, Node 24.15.0)
- New `about-igpu-shared-memory.test.ts` uses the real rows from a 2x
R9700 + Ryzen 9 9950X iGPU host (iGPU: 36.23 GiB total, 34.26 GiB
host-backed). It checks the 2 GiB iGPU row, the discrete cards, the
no-carve-out total, the older-row fallback, and that the route forwards
the fields. It fails on main.
- Related suites pass 22/22, backend `test_export_capability` and
`test_system_vulkan_gpu_info` pass 32, and `tsc -b` is clean.

I haven't taken a screenshot of the tab, and I haven't seen an Intel
iGPU row. The backend has no shared-memory flag for XPU, so an Intel
iGPU still shows its plain total.

Related: unslothai#14039 (iGPU left out of the Train page total), unslothai#14040 (Live
monitor VRAM), unslothai#13421.


## Before / after

Settings > About on two isolated Studio installs (merge base `4b8447f`
vs head), both fed the same `/api/system/hardware` GPU rows from the 2x
R9700 + Ryzen 9 9950X iGPU host above. The iGPU row goes from `36 GiB`
to `2 GiB (integrated)`; the discrete R9700 rows are unchanged.

![Settings > About GPU rows, before vs
after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/14317/pr14317_pair_00-35b82b22eaf5.png)

On a real Strix Halo (Radeon 8060S, Windows 11, gfx1151) the backend
reports 76.79 GiB total with 76.46 GiB host-backed: About reads `77 GiB`
at the merge base and `0.3 GiB (integrated)` at the head.

---------

Co-authored-by: Daniel Han <[email protected]>
Conflict in check-bundle-budget.ts: kept main's budget history and re-measured
this PR's growth against 4ff4c66 (+316 B raw / +94 B transfer, 97 chunks).
@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Pushed fdb0537bf. Codex is clean at this head on the mirror (LeoBorcherding/unsloth#506). Mirror CI is green apart from Source lint, which flags formatter drift in files this PR doesn't touch (studio/backend/auth/*, colab.py, the Colab notebook). The Codex error above was from 10-19 on an older head.

# Conflicts:
#	studio/frontend/scripts/check-bundle-budget.ts
#	studio/frontend/src/components/floating-monitor.tsx
# Conflicts:
#	studio/frontend/scripts/check-bundle-budget.ts
#	studio/frontend/src/features/settings/tabs/resources-tab.tsx
@LeoBorcherding LeoBorcherding changed the title Unsloth Studio (AMD/Windows): show Live monitor VRAM usage when only an iGPU has no reading (blocks dual R9700 testing) Unsloth Studio (AMD/Windows): show Live monitor VRAM usage when only an iGPU has no reading Oct 27, 2026
# Conflicts:
#	studio/frontend/scripts/check-bundle-budget.ts
# Conflicts:
#	studio/frontend/scripts/check-bundle-budget.ts
@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Pushed eb938599b8, a merge of main at 06314b97dd. The only conflict was the bundle budget, re-measured on top of main's lower ceiling: +316 B raw / +94 B transfer for this PR. Typecheck clean, PR tests 7/7. resources-tab.tsx keeps resolveGpuVramUsage(display.usageGpu), so a shared-memory iGPU with no reading still drops out of the total. Codex is clean at this head on the mirror (LeoBorcherding/unsloth#506).

# Conflicts:
#	studio/frontend/scripts/check-bundle-budget.ts
@LeoBorcherding

LeoBorcherding commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Pushed f7887c4fcf: a merge of main at 77ecead09a, plus removing a duplicated two-line comment in the floating monitor (no behavior change). Typecheck clean, PR tests 7/7. Codex is clean at this head on the mirror (LeoBorcherding/unsloth#506).

@LeoBorcherding

LeoBorcherding commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

CI is clean at f7887c4fcf: 43 checks pass. The one red doesn't come from this PR, which only touches the live monitor's VRAM math (4 frontend files):

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants