Skip to content

Studio: show what a Vulkan iGPU's shared pool holds instead of an Unknown VRAM tile - #11306

Closed
LeoBorcherding wants to merge 1 commit into
unslothai:mainfrom
LeoBorcherding:fix/vulkan-igpu-vram-used
Closed

LeoBorcherding wants to merge 1 commit into
unslothai:mainfrom
LeoBorcherding:fix/vulkan-igpu-vram-used

Conversation

@LeoBorcherding

Copy link
Copy Markdown
Collaborator

On any machine where llama.cpp runs on Vulkan and the GPU is an integrated one (Strix Halo, Strix Point, Radeon 780M, Intel Iris Xe), the Live monitor's VRAM tile reads Unknown / 0 GiB VRAM + N GiB shared, the detail line reads Unknown, and the device row carries an "Unknown VRAM" badge. Nothing failed to probe. get_vulkan_inference_gpu_info zeroes an iGPU's total on purpose, because that total is shared RAM and not a VRAM ceiling, and the used figure was derived from that zeroed total, so it came out None and the frontend hides usage when it is None. This PR derives it from what ggml actually reports.

What changes: the iGPU row now carries vram_used_gb (ggml's pool total minus its free figure, which is what the driver says the rest of the machine holds in the pool) and vram_utilization_pct (that used figure against the pool, so it stays under 100%). The budget (memory_total_gb) and free figures are untouched, so the fit and the model picker do not move. Discrete Vulkan cards and the torch (CUDA / ROCm) path are not touched at all. No frontend change: the tile already renders a number whenever vram_used_gb is finite.

One caveat on what the number means. It is the driver's memory budget as ggml sees it, not a live meter. On the Windows AMD driver (32.0.31041.3013) the same 5.58 GiB came back on three Strix Halo boxes across two runs with different amounts of RAM in use, so there it reads as the driver's own reservation. RADV on Linux reported 1.79 GiB on the same hardware. It is the figure llama.cpp itself budgets against, and it beats "Unknown", but it is not system RAM usage.

Before and after

Radeon 8060S (Strix Halo), Windows 11 Pro 26200, AMD driver 32.0.31041.3013, Vulkan prebuilt b11030, install.ps1 --local --no-torch, real web Studio, Settings, System tab.

tile detail device row
before, at 14b40739a0 Unknown / 0 GiB VRAM + 105.1 GiB shared Unknown Unknown used, badge "Unknown VRAM"
after, at 84037d7 5.58 GiB / 0 GiB VRAM + 105.1 GiB shared 105.1 GiB free 5.58 GiB used, badge "5% VRAM"

Before: VRAM tile reads Unknown
After: VRAM tile reads 5.58 GiB

/api/system, the inference row the tile renders. Before: memory_total_gb 105.06, vram_used_gb null, vram_free_gb 105.06, vram_utilization_pct null, shared_memory true. After: vram_used_gb 5.58, vram_utilization_pct 5.0, the rest identical. The raw probe on both runs: pool 114326 MiB, free 108610 MiB.

Tests

studio/backend/tests/test_gpu_selection.py: test_vulkan_igpu_info_uses_capped_free_budget now expects the used figure (20.0 GiB from a 32768 / 12288 MiB row) instead of None, and test_vulkan_igpu_info_reports_what_the_pool_holds is new, with the Strix Halo numbers above plus a row from an older probe that carries no total, which still reports None. Both pass at 84037d7. The refactor guard passes.

Test matrix

The org's hosted runners have no AMD GPU. The AMD runner we do have is the Strix Halo DevLab pool, and this time it is the hardware the change is about: its boxes run the Vulkan path on both Windows and Linux, so the runner rows below are measurements, not claims. Every row is a fresh --local install, a real web Studio, a login, and a Playwright screenshot of the System tab. The Windows boxes are identical EVO-X2 units from the pool; before and after did not necessarily land on the same unit.

hardware changed by this PR what ran still needed
Strix Halo 8060S, Windows 11 Pro 26200, driver 32.0.31041.3013, Vulkan prebuilt b11030, --no-torch yes before at 14b40739a0: tile Unknown. After at 84037d7: 5.58 GiB / 0 GiB VRAM + 105.1 GiB shared, 105.1 GiB free (screenshots above) nothing
Same box, default install (torch 2.11.0+rocm7.13.0, tile fed by torch) no before at 14b40739a0: 7.70 GiB / 63.8 GiB VRAM + 35.9 GiB shared. After at 84037d7: 0.23 GiB / 63.8 GiB VRAM + 35.9 GiB shared, same torch path, only the load differs. Its Vulkan inventory row went from used null to 5.58 nothing
Strix Halo 8060S, Ubuntu 24.04.4, kernel 6.17.0-1032-oem, RADV, Vulkan prebuilt b11030, --no-torch yes after at 84037d7: 1.79 GiB / 0 GiB VRAM + 92.4 GiB shared, 92.4 GiB free, device row 2% VRAM. Raw probe: pool 97504 MiB, free 95671 MiB the before on Linux was not run. The same used_mib = None branch fed it, but nobody watched the Unknown tile there
Other iGPUs on Vulkan (Strix Point 890M, 780M, Intel Iris Xe / Arc integrated), Windows or Linux yes nothing, no box here should be run, one screenshot of the tile is enough. The machine this was first seen on (a 12-thread laptop CPU at 1.70 GHz) was not one of these boxes and was probably an Intel iGPU
Discrete card on the Vulkan prebuilt no, branch untouched test_discrete_vulkan_inference_gpu_info at 84037d7 nothing
Any card on the CUDA / ROCm torch path no the default-install row above nothing

Solid: before and after on Windows Strix Halo, after on Linux Strix Halo, and the unit tests. Biggest gap: no non-AMD iGPU has been seen, and that is the shape the report came from.

… used unknown

get_vulkan_inference_gpu_info zeroed an integrated GPU's total so the fit budget
stays the capped free figure, and that also dropped the used figure, so the Live
monitor's VRAM tile read Unknown on every APU. ggml's budget already reports what
the rest of the machine holds as total minus free; publish that, with the
utilization taken against the pool. The budget and free figures are unchanged.

Measured on a Windows 11 Strix Halo (Radeon 8060S) via the AMD DevLab runner:
the tile went from Unknown to a figure with this change.
@danielhanchen

Copy link
Copy Markdown
Member

Confirmed this hits hardware.py where the shared-memory branch zeroes the total, so vram_used_gb and vram_utilization_pct come back None on every Vulkan iGPU, and the budget and free figures stay untouched here. Will get this reviewed.

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