Repository navigation
Unsloth Studio (AMD/Windows): show Live monitor VRAM usage when only an iGPU has no reading - #14040
LeoBorcherding wants to merge 13 commits into
Conversation
…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.
|
Pushed This is the two-discrete-card case that #11871 and #13421 didn't reach (#8942 was the one-card version). @codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
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
I haven't taken a screenshot, because the UI on this build needs a login I didn't set up. |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Pushed @codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
… 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.  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).
|
Pushed |
# 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
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
|
Pushed |
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
|
Pushed |
|
CI is clean at
|
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 sharedwith--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:shared_memory, orunified_memoryfor a Linux ROCm APU): sums the reporting cards and returns just those.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)tests/vram-monitor-igpu-unknown.test.tsuses 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 Linuxunified_memoryAPU, nothing reporting stays null, and a host aggregate still wins.tscclean.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.tsbut neither depends on the other.