Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio (AMD iGPU): split an iGPU row's total into VRAM and shared memory (#13421)

Daniel Han8a0e453465d8
diff --git a/studio/frontend/src/features/settings/tabs/resources-tab.tsx b/studio/frontend/src/features/settings/tabs/resources-tab.tsx
index a5c9ce3bbbb..ddf7c313a4e 100644
--- a/studio/frontend/src/features/settings/tabs/resources-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/resources-tab.tsx
@@ -25,6 +25,7 @@ import {
sharedMemoryAvailableGb,
} from "@/hooks/gpu-memory-display";
import {
+ deviceSharedMemorySplitGb,
gpuMemoryTotalsGb,
gpuVramUsedIsPerDevice,
resolveGpuVramUsedGb,
@@ -909,6 +910,8 @@ export function ResourcesTab() {
const percentText = isFiniteNumber(percent)
? formatPercent(safePercent)
: unknownLabel;
+ // Its total is mostly system RAM, so "VRAM" beside it overstates the card (#8942).
+ const sharedSplit = deviceSharedMemorySplitGb(device);
return (
// Name over backend on the left, figures over the meter on the
// right. The meter tracks the figures' width rather than the
@@ -935,6 +938,10 @@ export function ResourcesTab() {
<span className="text-xs text-muted-foreground">
{t("settings.resources.gpu.sharedWithSystemRam")}
</span>
+ ) : sharedSplit ? (
+ <span className="shrink-0 rounded-full bg-control-accent/10 px-2 py-1 text-ui-10 leading-none font-semibold tabular-nums text-control-accent">
+ {percentText}
+ </span>
) : (
<span className="shrink-0 rounded-full bg-control-accent/10 px-2 py-1 text-ui-10 leading-none font-semibold tabular-nums text-control-accent">
{percentText}{" "}
@@ -942,6 +949,17 @@ export function ResourcesTab() {
</span>
)}
</div>
+ {/* Own line: beside the pill it truncates the backend label first. */}
+ {sharedSplit && !hasSharedMemoryHeadroom(device) ? (
+ <div className="mt-1 text-xs text-muted-foreground">
+ {sharedSplit.dedicated > 0
+ ? t("settings.resources.environment.vramWithShared", {
+ vram: formatGiB(sharedSplit.dedicated),
+ shared: formatGiB(sharedSplit.shared),
+ })
+ : t("settings.resources.gpu.sharedWithSystemRam")}
+ </div>
+ ) : null}
</div>
{/* Meter under the figures, so it spans their width instead of
being squeezed into the gap beside them. Same 392px as the
diff --git a/studio/frontend/src/hooks/gpu-vram.ts b/studio/frontend/src/hooks/gpu-vram.ts
index b8a377ff3f8..83b5c6bf34f 100644
--- a/studio/frontend/src/hooks/gpu-vram.ts
+++ b/studio/frontend/src/hooks/gpu-vram.ts
@@ -104,6 +104,15 @@ export function gpuMemoryTotalsGb(
};
}
+/** One device row's total split the way the VRAM tile splits it; null for dedicated-only VRAM. A Windows ROCm iGPU
+ * reports its BIOS carve-out plus the shared pool as one total (#8942). */
+export function deviceSharedMemorySplitGb(
+ device: MemoryTotalDevice,
+): GpuMemoryTotalsGb | null {
+ const totals = gpuMemoryTotalsGb([device]);
+ return totals.shared > 0 ? totals : null;
+}
+
export function gpuSharedHostMemoryGb(devices: MemoryTotalDevice[]): number {
return gpuMemoryTotalsGb(devices).shared;
}
diff --git a/studio/frontend/tests/resources-device-row-shared-split.test.ts b/studio/frontend/tests/resources-device-row-shared-split.test.ts
new file mode 100644
index 00000000000..e50df3b0501
--- /dev/null
+++ b/studio/frontend/tests/resources-device-row-shared-split.test.ts
@@ -0,0 +1,83 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import assert from "node:assert/strict";
+import test from "node:test";
+import {
+ deviceSharedMemorySplitGb,
+ gpuMemoryTotalsGb,
+} from "../src/hooks/gpu-vram.ts";
+import type { GpuDevice } from "../src/hooks/use-system.ts";
+import { readSrc } from "./helpers/kit.ts";
+
+// #8942: Windows ROCm, RX 9070 XT beside a Ryzen iGPU with a 2 GiB carve-out and a 34.2 GiB shared pool.
+const radeon: GpuDevice = {
+ index_kind: "physical",
+ memory_total_gb: 15.9,
+ shared_memory: false,
+ vram_used_gb: 3.28,
+};
+const igpu: GpuDevice = {
+ index_kind: "physical",
+ memory_total_gb: 36.2,
+ shared_memory: true,
+ shared_memory_host_backed_gb: 34.2,
+ vram_used_gb: 1.5,
+};
+
+test("an iGPU row splits its total into carve-out VRAM and shared memory", () => {
+ assert.deepEqual(deviceSharedMemorySplitGb(igpu), {
+ dedicated: 2,
+ shared: 34.2,
+ total: 36.2,
+ });
+});
+
+test("a discrete card's row keeps its plain VRAM total", () => {
+ assert.equal(deviceSharedMemorySplitGb(radeon), null);
+});
+
+test("the rows add up to the VRAM tile's split", () => {
+ const tile = gpuMemoryTotalsGb([radeon, igpu]);
+ const split = deviceSharedMemorySplitGb(igpu)!;
+ assert.equal(tile.dedicated, radeon.memory_total_gb! + split.dedicated);
+ assert.equal(tile.shared, split.shared);
+});
+
+test("a Linux ROCm APU (unified, not flagged shared) reads as shared, as the tile does", () => {
+ const apu: GpuDevice = {
+ index_kind: "physical",
+ memory_total_gb: 64,
+ shared_memory: false,
+ unified_memory: true,
+ };
+ assert.deepEqual(deviceSharedMemorySplitGb(apu), {
+ dedicated: 0,
+ shared: 64,
+ total: 64,
+ });
+});
+
+test("unknown or absent totals give no split", () => {
+ assert.equal(
+ deviceSharedMemorySplitGb({ shared_memory: true, memory_total_gb: 0 }),
+ null,
+ );
+ assert.equal(deviceSharedMemorySplitGb({ shared_memory: true }), null);
+});
+
+test("the System device row labels a shared total instead of calling it VRAM", () => {
+ const resourcesTab = readSrc("features/settings/tabs/resources-tab.tsx");
+ assert.match(
+ resourcesTab,
+ /const sharedSplit = deviceSharedMemorySplitGb\(device\)/,
+ );
+ assert.match(
+ resourcesTab,
+ /\) : sharedSplit \? \(\s*<span[^>]*>\s*\{percentText\}\s*<\/span>/,
+ );
+ assert.match(
+ resourcesTab,
+ /\{sharedSplit && !hasSharedMemoryHeadroom\(device\) \? \([\s\S]*?vram: formatGiB\(sharedSplit\.dedicated\)[\s\S]*?shared: formatGiB\(sharedSplit\.shared\)[\s\S]*?gpu\.sharedWithSystemRam/,
+ );
+});