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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: name a closed AMD device node in the System tab GPU notice (#14126)
Daniel Hanca3d1d0cef1c
diff --git a/studio/backend/main.py b/studio/backend/main.pyindex 6a3dcdded24..9acf9b7452b 100644--- a/studio/backend/main.py+++ b/studio/backend/main.py@@ -2232,6 +2232,15 @@ async def health_check(request: Request):# because it is all-or-nothing: without it the greyed-out Train row can only say "run `unsloth studio# update`". From the snapshot, so it cannot come from a different detection pass than the reason beside it.authed["chat_only_detail"] = snapshot[2]+ # A closed AMD device node (#14067): Repair installation cannot fix group membership.+ try:+ authed["chat_only_hint"] = (+ _hw_module.chat_only_permission_hint(snapshot[1], snapshot[2])+ if snapshot[0]+ else None+ )+ except Exception:+ authed["chat_only_hint"] = Noneauthed["device_type"] = device_typeauthed["apple_silicon"] = is_apple_silicon()from utils.paths.file_manager import file_manager_kinddiff --git a/studio/backend/tests/test_amd_device_node_permissions.py b/studio/backend/tests/test_amd_device_node_permissions.pyindex 5d2f65e9156..c6507103309 100644--- a/studio/backend/tests/test_amd_device_node_permissions.py+++ b/studio/backend/tests/test_amd_device_node_permissions.py@@ -662,6 +662,80 @@ def test_the_capability_message_for_a_host(monkeypatch, linux, case):_asserts(message, says, does_not_say)+_AMD_CARD = {"vendor": "amd", "index": 0, "name": "Radeon RX 7900 XTX", "memory_total_gb": 24.0}++[email protected]("case", [+ # #14067: render-group fix, not "repair the installation".+ pytest.param((_KFD_SHUT, "torch_cuda_unavailable", "2.11.0+rocm7.0", True, True),+ id = "a_rocm_wheel_behind_a_closed_node_gets_only_the_hint"),+ pytest.param((_KFD_SHUT, "torch_cpu_build", "2.11.0+cpu", True, False),+ id = "a_cpu_wheel_behind_a_closed_node_keeps_the_repair_line"),+ pytest.param((_BOTH_OPEN, "torch_cuda_unavailable", "2.11.0+rocm7.0", False, False),+ id = "nodes_that_open_add_no_hint"),+])+def test_the_system_tab_mismatch_names_a_closed_node(monkeypatch, linux, case):+ """/api/system's ``gpu.mismatch`` carries the same hint the capability messages give."""+ layout, verdict, label, has_hint, hint_only = case+ _nodes(monkeypatch, **layout)+ _mismatch_vendors(monkeypatch, {"amd"})+ for _probe, _answer in _pins(rocm_intent = False, hip_runtime = False).items():+ monkeypatch.setattr(hardware, _probe, lambda _a = _answer: _a)+ monkeypatch.setattr(hardware, "torch_build_snapshot", lambda **_k: {"reason": verdict})+ monkeypatch.setattr(+ hardware, "get_physical_gpu_inventory", lambda **_k: {"devices": [_AMD_CARD], "sources": ["sysfs"]}+ )+ monkeypatch.setattr(hardware, "_devices_that_can_establish_a_mismatch", lambda devices: devices)+ monkeypatch.setattr(hardware, "_reported_torch_label", lambda *_a: label)+ mismatch = hardware._torch_gpu_mismatch_report()["mismatch"]+ assert mismatch["reason"] == verdict+ if has_hint:+ assert _USERMOD in mismatch["permission_hint"]+ else:+ assert mismatch["permission_hint"] is None+ assert mismatch["permission_hint_only"] is hint_only++[email protected]("case", [+ pytest.param((_KFD_SHUT, "torch_cuda_unavailable", "2.11.0+rocm7.0", True), id = "rocm_wheel_gets_the_hint"),+ pytest.param((_KFD_SHUT, "torch_cpu_build", "2.11.0+cpu", False), id = "cpu_wheel_keeps_the_repair"),+ pytest.param((_BOTH_OPEN, "torch_cuda_unavailable", "2.11.0+rocm7.0", False), id = "open_nodes_add_nothing"),+])+def test_the_health_hint_for_the_train_tooltip(monkeypatch, linux, case):+ """/api/health's ``chat_only_hint`` replaces the sidebar's reinstall advice only for a ROCm wheel."""+ layout, verdict, label, has_hint = case+ _nodes(monkeypatch, **layout)+ _mismatch_vendors(monkeypatch, {"amd"})+ for _probe, _answer in _pins(rocm_intent = False, hip_runtime = False).items():+ monkeypatch.setattr(hardware, _probe, lambda _a = _answer: _a)+ monkeypatch.setattr(hardware, "_CHAT_ONLY_HINT", None)+ # Computed by detection (off the async health path), then only looked up.+ hardware._record_chat_only_hint(verdict, label)+ hint = hardware.chat_only_permission_hint(verdict, label)+ if has_hint:+ assert _USERMOD in hint+ else:+ assert hint is None+ # A verdict detection did not record gets nothing.+ assert hardware.chat_only_permission_hint("no_gpu", None) is None+++def test_the_system_tab_reads_vendors_from_the_cards_it_reports(monkeypatch, linux):+ """An AMD card the inventory found after detection still gets the hint (stale global vendors)."""+ _nodes(monkeypatch, **_KFD_SHUT)+ _mismatch_vendors(monkeypatch, set())+ for _probe, _answer in _pins(rocm_intent = False, hip_runtime = False).items():+ monkeypatch.setattr(hardware, _probe, lambda _a = _answer: _a)+ monkeypatch.setattr(hardware, "torch_build_snapshot", lambda **_k: {"reason": "torch_cuda_unavailable"})+ monkeypatch.setattr(+ hardware, "get_physical_gpu_inventory", lambda **_k: {"devices": [_AMD_CARD], "sources": ["sysfs"]}+ )+ monkeypatch.setattr(hardware, "_devices_that_can_establish_a_mismatch", lambda devices: devices)+ monkeypatch.setattr(hardware, "_reported_torch_label", lambda *_a: "2.11.0+rocm7.0")+ mismatch = hardware._torch_gpu_mismatch_report()["mismatch"]+ assert _USERMOD in mismatch["permission_hint"]++@pytest.mark.parametrize("case", [# The load-time line. It runs ahead of the Vulkan branch on purpose: a closed render# node is the reason UNDERNEATH "the Vulkan probe reported no device", and thatdiff --git a/studio/backend/utils/hardware/hardware.py b/studio/backend/utils/hardware/hardware.pyindex e1d4ac592ca..1602478c11c 100644--- a/studio/backend/utils/hardware/hardware.py+++ b/studio/backend/utils/hardware/hardware.py@@ -52,6 +52,8 @@ CHAT_ONLY: bool = True # No CUDA GPU -> GGUF chat only (Mac, CPU-only, etc.)CHAT_ONLY_REASON: Optional[str] = None# What blocked the reason above, when there is something specific to say. Only "mlx_unavailable" sets it: the gate is all-or-nothing across mlx, mlx-lm and mlx-vlm, so naming the offending package is the difference between a dead end and a fix. Never shown on its own.CHAT_ONLY_DETAIL: Optional[str] = None+# (reason, hint) from the last detection pass that found a torch mismatch.+_CHAT_ONLY_HINT: Optional[tuple[Optional[str], Optional[str]]] = None# The vendors whose cards established the two mismatch reasons, empty otherwise: current_chat_only_verdict() freezes a mismatch while the inventory cannot answer, and without this a detached AMD eGPU stays "unusable" for as long as nvidia-smi is broken on a host that never had an NVIDIA card.CHAT_ONLY_MISMATCH_VENDORS: frozenset = frozenset()IS_ROCM: bool = False # True when running on AMD ROCm (HIP) -- routes GPU monitoring to amd.py@@ -1254,6 +1256,7 @@ def _mismatch_verdict_for_this_host(# Which vendors said so, for the frozen verdict's own uncertainty test._remember_the_vendors_behind_the_mismatch(establishing)detail = _reported_torch_label()+ _record_chat_only_hint(reason, detail)logger.warning("GPUs are present on this host but PyTorch cannot use them (%s%s); ""Train/Export disabled (chat-only). Repair the installation to restore GPU "@@ -1275,13 +1278,27 @@ def _torch_gpu_mismatch_report() -> Dict[str, Any]:physical = _devices_that_can_establish_a_mismatch(inventory.get("devices") or [])if not physical:return {}+ torch_version = _reported_torch_label(CHAT_ONLY_DETAIL)+ # Repair installation cannot add an account to the render group (#14067).+ try:+ node_hint, wheel_targets_amd = _amd_permission_hint_for_mismatch(+ torch_version, {str(d.get("vendor", "")).lower() for d in physical}+ )+ except Exception as exc:+ logger.debug("AMD device node hint failed: %s", exc)+ node_hint, wheel_targets_amd = None, Falsereturn {"physical_devices": physical,"mismatch": {"reason": reason,- "torch_version": _reported_torch_label(CHAT_ONLY_DETAIL),+ "torch_version": torch_version,"physical_count": len(physical),"sources": inventory.get("sources") or [],+ "permission_hint": node_hint,+ # Only a ROCm wheel is fully explained by the closed node.+ "permission_hint_only": bool(+ node_hint and reason == "torch_cuda_unavailable" and wheel_targets_amd+ ),},}@@ -1762,19 +1779,15 @@ def _intel_xpu_pin_hint(vendors: "set[str]") -> str:)-def _gpu_present_but_unusable_message(- feature: str, verdict: Optional[tuple[Optional[str], Optional[str]]] = None-) -> Optional[str]:- """The capability message for a host whose GPUs are real but unreachable by torch, or ``None`` when this host is not in that state. detect_hardware() records ``torch_cpu_build`` / ``torch_cuda_unavailable`` only after the OS inventory has actually found a card, so reaching this point means the "no supported accelerator was found" wording below would contradict the System tab and send the user after hardware they already own. Both reasons are surfaced verbatim by the Export and Video pages and by rejected export API calls."""- # ``verdict`` lets one response read it ONCE: two reads across a TTL boundary can describe different hosts.- reason, detail = verdict if verdict is not None else current_chat_only_verdict()- if reason not in ("torch_cpu_build", "torch_cuda_unavailable"):- return None- installed = f" (installed {detail})" if detail else ""+def _amd_permission_hint_for_mismatch(+ detail: Optional[str], vendors: "Optional[set[str]]" = None+) -> tuple[Optional[str], bool]:+ """``(node_hint, wheel_targets_amd)`` for a torch mismatch: the closed AMD device node sentence when it applies, and whether the wheel is a ROCm one it fully explains."""# No reinstall changes group membership (#10466), so a closed node is not a mismatch.# Recording AMD is necessary but not sufficient: a hybrid host on CUDA torch records# both vendors, and there the verdict is about the NVIDIA card.- vendors = {str(vendor).lower() for vendor in CHAT_ONLY_MISMATCH_VENDORS}+ if vendors is None:+ vendors = {str(vendor).lower() for vendor in CHAT_ONLY_MISMATCH_VENDORS}# Worth MENTIONING is about the hardware; REPLACES the reinstall advice is about the# wheel, and only a ROCm one is repaired by opening a node. Conflating them was the bug._label = (detail or "").lower()@@ -1808,12 +1821,46 @@ def _gpu_present_but_unusable_message(node_hint = amd_node_permission_hint()except Exception:node_hint = None+ return node_hint, wheel_targets_amd+++def chat_only_permission_hint(reason: Optional[str], detail: Optional[str]) -> Optional[str]:+ """The closed-node sentence for /api/health, read from the last detection pass that recorded this verdict."""+ # Keyed on the reason only: the refreshed verdict can relabel the same wheel.+ stored = _CHAT_ONLY_HINT+ return stored[1] if stored is not None and stored[0] == reason else None+++def _record_chat_only_hint(reason: Optional[str], detail: Optional[str]) -> None:+ """Detection-time only: the probe stats nodes and resolves group names, which /api/health (async) must not."""+ global _CHAT_ONLY_HINT+ hint = None+ if reason == "torch_cuda_unavailable":+ try:+ node_hint, wheel_targets_amd = _amd_permission_hint_for_mismatch(detail)+ hint = node_hint if wheel_targets_amd else None+ except Exception as exc:+ logger.debug("AMD device node hint failed: %s", exc)+ _CHAT_ONLY_HINT = (reason, hint)+++def _gpu_present_but_unusable_message(+ feature: str, verdict: Optional[tuple[Optional[str], Optional[str]]] = None+) -> Optional[str]:+ """The capability message for a host whose GPUs are real but unreachable by torch, or ``None`` when this host is not in that state. detect_hardware() records ``torch_cpu_build`` / ``torch_cuda_unavailable`` only after the OS inventory has actually found a card, so reaching this point means the "no supported accelerator was found" wording below would contradict the System tab and send the user after hardware they already own. Both reasons are surfaced verbatim by the Export and Video pages and by rejected export API calls."""+ # ``verdict`` lets one response read it ONCE: two reads across a TTL boundary can describe different hosts.+ reason, detail = verdict if verdict is not None else current_chat_only_verdict()+ if reason not in ("torch_cpu_build", "torch_cuda_unavailable"):+ return None+ installed = f" (installed {detail})" if detail else ""+ node_hint, wheel_targets_amd = _amd_permission_hint_for_mismatch(detail)# Replaces the reinstall advice only for a ROCm wheel, which the closed node fully# explains. A CPU-only or other-vendor wheel needs BOTH repairs and is given both.if node_hint and reason == "torch_cuda_unavailable" and wheel_targets_amd:return f"This host has a GPU, but {feature} cannot use it. {node_hint}"# Both routes, always. The repair row exists only in the desktop app and only for a backend it manages, so a browser-hosted Studio, or a desktop attached to a server someone started from a terminal, was being sent to a control that is not on the page.if reason == "torch_cpu_build":+ vendors = {str(vendor).lower() for vendor in CHAT_ONLY_MISMATCH_VENDORS}repair = _intel_xpu_pin_hint(vendors) or ("Reinstall the GPU build: use Repair installation in Settings in the desktop app, ""or re-run the Unsloth installer."diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsxindex 7fbfedfa7ce..cf891900960 100644--- a/studio/frontend/src/components/app-sidebar.tsx+++ b/studio/frontend/src/components/app-sidebar.tsx@@ -1308,6 +1308,7 @@ export function AppSidebar() {const chatOnly = usePlatformStore((s) => s.isChatOnly());const chatOnlyReason = usePlatformStore((s) => s.chatOnlyReason);const chatOnlyDetail = usePlatformStore((s) => s.chatOnlyDetail);+ const chatOnlyHint = usePlatformStore((s) => s.chatOnlyHint);const detectionDeferred = usePlatformStore((s) => s.detectionDeferred);// Until /api/health answers, `chatOnly` is the browser-platform guess, so every Mac painted// Train and Video blacked out on load and only recovered once the backend reported. Gate the@@ -1335,9 +1336,12 @@ export function AppSidebar() {chatOnlyReason === "torch_cuda_unavailable"? // The host HAS GPUs; this PyTorch cannot open them. "Get a GPU" is both wrong// and unactionable here, so name the installed build and point at the repair.- chatOnlyDetail- ? `Training needs a working PyTorch GPU build. This machine's GPUs were detected but PyTorch ${chatOnlyDetail} cannot use them; repair the installation.`- : "Training needs a working PyTorch GPU build. This machine's GPUs were detected but PyTorch cannot use them; repair the installation."+ // A closed AMD device node is not fixed by a reinstall (#14067).+ chatOnlyHint+ ? `Training cannot use this machine's GPU. ${chatOnlyHint}`+ : chatOnlyDetail+ ? `Training needs a working PyTorch GPU build. This machine's GPUs were detected but PyTorch ${chatOnlyDetail} cannot use them; repair the installation.`+ : "Training needs a working PyTorch GPU build. This machine's GPUs were detected but PyTorch cannot use them; repair the installation.": chatOnlyReason === "no_gpu"? "Training needs an NVIDIA or AMD GPU.": undefined;diff --git a/studio/frontend/src/config/env.ts b/studio/frontend/src/config/env.tsindex ef4510bd493..e34191acfab 100644--- a/studio/frontend/src/config/env.ts+++ b/studio/frontend/src/config/env.ts@@ -43,6 +43,7 @@ interface PlatformState {chatOnlyReason: string | null;// MLX gate covers mlx, mlx-lm, and mlx-vlm together; record the blocker when known.chatOnlyDetail: string | null;+ chatOnlyHint: string | null;// authenticated /api/health values for cloudflareUrl, serverUrl, and secure.cloudflareUrl: string | null;serverUrl: string | null;@@ -75,6 +76,7 @@ export const usePlatformStore = create<PlatformState>()((_, get) => ({chatOnly: localDeviceType === "mac",chatOnlyReason: null,chatOnlyDetail: null,+ chatOnlyHint: null,cloudflareUrl: null,serverUrl: null,secure: false,@@ -215,10 +217,8 @@ export async function fetchDeviceType(options?: {? previous.fileManager: undefined;// A still-provisional reply keeps the stored verdict: see resolveVerdict.- const { chatOnly, chatOnlyReason, chatOnlyDetail } = resolveVerdict(- data,- previous,- );+ const { chatOnly, chatOnlyReason, chatOnlyDetail, chatOnlyHint } =+ resolveVerdict(data, previous);// Cache only a server-reported platform. Unauthenticated responses fall// back to the browser platform, which can differ from the host (WSL,// SSH); keeping fetched=false retries once a token exists.@@ -229,6 +229,7 @@ export async function fetchDeviceType(options?: {chatOnly,chatOnlyReason,chatOnlyDetail,+ chatOnlyHint,cloudflareUrl: data.cloudflare_url ?? null,serverUrl: data.server_url ?? null,secure: data.secure ?? false,diff --git a/studio/frontend/src/config/hardware-verdict.ts b/studio/frontend/src/config/hardware-verdict.tsindex 57638dc6465..fd6e8d66d07 100644--- a/studio/frontend/src/config/hardware-verdict.ts+++ b/studio/frontend/src/config/hardware-verdict.ts@@ -11,6 +11,8 @@ export type HealthVerdict = {chat_only_reason?: string | null;/** What blocked that reason, when the backend knows something specific. */chat_only_detail?: string | null;+ /** The repair a closed AMD device node needs, when it fully explains the verdict. */+ chat_only_hint?: string | null;hardware_detecting?: boolean;hardware_detection_deferred?: boolean;};@@ -19,6 +21,7 @@ export type ResolvedVerdict = {chatOnly: boolean;chatOnlyReason: string | null;chatOnlyDetail: string | null;+ chatOnlyHint: string | null;};/** True while the backend is still measuring the host, so chat_only is its@@ -80,6 +83,10 @@ export function resolveVerdict(data.chat_only_reason === undefined? previous.chatOnlyDetail: (data.chat_only_detail ?? null),+ chatOnlyHint:+ data.chat_only_reason === undefined+ ? previous.chatOnlyHint+ : (data.chat_only_hint ?? null),};}if (isProvisionalVerdict(data)) return previous;@@ -87,5 +94,6 @@ export function resolveVerdict(chatOnly: data.chat_only ?? false,chatOnlyReason: data.chat_only_reason ?? null,chatOnlyDetail: data.chat_only_detail ?? null,+ chatOnlyHint: data.chat_only_hint ?? null,};}diff --git a/studio/frontend/src/features/settings/tabs/resources-tab.tsx b/studio/frontend/src/features/settings/tabs/resources-tab.tsxindex ddf7c313a4e..ef80adefb07 100644--- a/studio/frontend/src/features/settings/tabs/resources-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/resources-tab.tsx@@ -245,6 +245,10 @@ interface GpuTorchMismatch {reason?: string;torch_version?: string | null;physical_count?: number;+ /** An AMD device node this account cannot open, and the command that opens it. */+ permission_hint?: string | null;+ /** The closed node fully explains a ROCm wheel, so the reinstall advice is wrong. */+ permission_hint_only?: boolean;}/** /api/system's `gpu.driver_warning`: a Windows AMD driver with the idle-eviction bug@@ -538,14 +542,16 @@ export function ResourcesTab() {? rawDriverWarning: null;// A CPU-only wheel is fixed by reinstalling torch, a dead runtime by the driver.- const gpuMismatchMessage = gpuMismatch- ? t(- gpuMismatch.reason === "torch_cpu_build"- ? "settings.resources.gpu.mismatchCpuBuild"- : "settings.resources.gpu.mismatchUnavailable",- { version: gpuMismatch.torch_version ?? unknownLabel },- )- : null;+ const gpuPermissionHint = gpuMismatch?.permission_hint ?? null;+ const gpuMismatchMessage =+ gpuMismatch && !(gpuPermissionHint && gpuMismatch.permission_hint_only)+ ? t(+ gpuMismatch.reason === "torch_cpu_build"+ ? "settings.resources.gpu.mismatchCpuBuild"+ : "settings.resources.gpu.mismatchUnavailable",+ { version: gpuMismatch.torch_version ?? unknownLabel },+ )+ : null;return (<div className="settings-page">@@ -807,9 +813,16 @@ export function ResourcesTab() {selectable: the rows below are what a model can be loaded onto. */}{gpuMismatch ? (<div className="flex flex-col gap-2 border-b border-border/60 py-3">- <p className="text-sm text-amber-600 dark:text-amber-400">- {gpuMismatchMessage}- </p>+ {gpuMismatchMessage && (+ <p className="text-sm text-amber-600 dark:text-amber-400">+ {gpuMismatchMessage}+ </p>+ )}+ {gpuPermissionHint && (+ <p className="select-text text-sm text-amber-600 dark:text-amber-400">+ {gpuPermissionHint}+ </p>+ )}{physicalDevices.map((device, index) => (<divkey={`${device.vendor ?? "gpu"}-${device.index ?? index}-${device.name ?? ""}`}diff --git a/studio/frontend/tests/gpu-torch-mismatch.test.ts b/studio/frontend/tests/gpu-torch-mismatch.test.tsindex 34c748a1f96..e7e035c05af 100644--- a/studio/frontend/tests/gpu-torch-mismatch.test.ts+++ b/studio/frontend/tests/gpu-torch-mismatch.test.ts@@ -60,14 +60,25 @@ const derivation = [),lift(tabSrc,- /const gpuMismatchMessage = [\s\S]*?;/,+ /const gpuPermissionHint = [\s\S]*?;/,+ "gpuPermissionHint",+ "resources-tab.tsx",+ ),+ lift(+ tabSrc,+ /const gpuMismatchMessage =\s*[\s\S]*?;/,"gpuMismatchMessage","resources-tab.tsx",),].join("\n");interface Inventory {- mismatch?: { reason?: string; torch_version?: string | null } | null;+ mismatch?: {+ reason?: string;+ torch_version?: string | null;+ permission_hint?: string | null;+ permission_hint_only?: boolean;+ } | null;physical_devices?: { name?: string }[];}@@ -77,15 +88,60 @@ function mismatchFor(gpuInventory: Inventory | null) {"t","unknownLabel",`${derivation}- return { gpuMismatch, physicalDevices, gpuMismatchMessage };`,+ return { gpuMismatch, physicalDevices, gpuMismatchMessage, gpuPermissionHint };`,);return run(gpuInventory, t, UNKNOWN) as {gpuMismatch: { reason?: string } | null;physicalDevices: { name?: string }[];gpuMismatchMessage: string | null;+ gpuPermissionHint: string | null;};}+// #14067: an account outside the render group. Repair installation cannot add it to one.+const HINT =+ "This account cannot open /dev/kfd, so ROCm cannot use the AMD card even though the driver is loaded. Add the account to the render and video groups and then log out and back in: sudo usermod -a -G render,video ada";++test("a closed AMD device node is named instead of the repair advice", () => {+ const rocm = mismatchFor({+ mismatch: {+ reason: "torch_cuda_unavailable",+ torch_version: "2.11.0+rocm7.0",+ permission_hint: HINT,+ permission_hint_only: true,+ },+ physical_devices: [{ name: "Radeon RX 7900 XTX" }],+ });+ assert.equal(rocm.gpuPermissionHint, HINT);+ assert.equal(rocm.gpuMismatchMessage, null);++ // A CPU wheel still needs the reinstall, so both lines show.+ const cpu = mismatchFor({+ mismatch: {+ reason: "torch_cpu_build",+ torch_version: "2.11.0+cpu",+ permission_hint: HINT,+ permission_hint_only: false,+ },+ physical_devices: [{ name: "Radeon RX 7900 XTX" }],+ });+ assert.equal(cpu.gpuPermissionHint, HINT);+ assert.equal(cpu.gpuMismatchMessage, CPU_BUILD);++ // permission_hint_only without a hint never blanks the banner.+ const noHint = mismatchFor({+ mismatch: {+ reason: "torch_cuda_unavailable",+ torch_version: "2.11.0+rocm7.0",+ permission_hint: null,+ permission_hint_only: true,+ },+ physical_devices: [{ name: "Radeon RX 7900 XTX" }],+ });+ assert.equal(noHint.gpuPermissionHint, null);+ assert.equal(noHint.gpuMismatchMessage, UNAVAILABLE);+});+test("a CPU-only wheel and a dead accelerator wheel get different sentences", () => {const cpuBuild = mismatchFor({mismatch: { reason: "torch_cpu_build", torch_version: "2.11.0+cpu" },@@ -211,13 +267,23 @@ test("the sidebar's Train hint stops doing the same", () => {"trainDisabledHint","app-sidebar.tsx",);- const forReason = (chatOnlyReason: string, chatOnlyDetail: string | null) =>+ const forReason = (+ chatOnlyReason: string,+ chatOnlyDetail: string | null,+ chatOnlyHint: string | null = null,+ ) =>new Function("chatOnlyMeasured","chatOnlyReason","chatOnlyDetail",+ "chatOnlyHint",`${hint.replace(": string | undefined", "")}\nreturn trainDisabledHint;`,- )(true, chatOnlyReason, chatOnlyDetail) as string | undefined;+ )(true, chatOnlyReason, chatOnlyDetail, chatOnlyHint) as string | undefined;++ // #14067: a closed AMD node replaces the reinstall advice.+ const closed = forReason("torch_cuda_unavailable", "2.11.0+rocm7.0", HINT);+ assert.ok(closed?.includes("sudo usermod -a -G render,video ada"));+ assert.doesNotMatch(closed ?? "", /repair the installation/);for (const reason of ["torch_cpu_build", "torch_cuda_unavailable"]) {const withDetail = forReason(reason, "2.11.0+cpu");diff --git a/studio/frontend/tests/provisional-hardware-verdict.test.ts b/studio/frontend/tests/provisional-hardware-verdict.test.tsindex 0fb0477ebfb..25ea78c12cd 100644--- a/studio/frontend/tests/provisional-hardware-verdict.test.ts+++ b/studio/frontend/tests/provisional-hardware-verdict.test.ts@@ -25,8 +25,8 @@ const APP_SIDEBAR = readSrc("components/app-sidebar.tsx");const ENV = readSrc("config/env.ts");const USE_HARDWARE_INFO = readSrc("hooks/use-hardware-info.ts");-const GPU_HOST = { chatOnly: false, chatOnlyReason: null, chatOnlyDetail: null };-const MAC_DEFAULT = { chatOnly: true, chatOnlyReason: null, chatOnlyDetail: null };+const GPU_HOST = { chatOnly: false, chatOnlyReason: null, chatOnlyDetail: null, chatOnlyHint: null };+const MAC_DEFAULT = { chatOnly: true, chatOnlyReason: null, chatOnlyDetail: null, chatOnlyHint: null };test("a detecting reply is provisional, a settled one is not", () => {assert.equal(isProvisionalVerdict({ hardware_detecting: true }), true);@@ -53,7 +53,7 @@ test("a provisional reply does not send a GPU host to chat-only", () => {test("a provisional reply does not clear a reason the UI is explaining", () => {const resolved = resolveVerdict({ chat_only: true, hardware_detecting: true },- { chatOnly: true, chatOnlyReason: "mlx_unavailable", chatOnlyDetail: null },+ { chatOnly: true, chatOnlyReason: "mlx_unavailable", chatOnlyDetail: null, chatOnlyHint: null },);assert.equal(resolved.chatOnlyReason,@@ -110,7 +110,7 @@ test("a deferred verdict falls back to the backend's conservative default", () =hardware_detection_deferred: true,};assert.equal(- resolveVerdict(deferred, { chatOnly: false, chatOnlyReason: null, chatOnlyDetail: null }).chatOnly,+ resolveVerdict(deferred, { chatOnly: false, chatOnlyReason: null, chatOnlyDetail: null, chatOnlyHint: null }).chatOnly,true,"a never-settling reply left the optimistic platform default in place",);@@ -123,7 +123,7 @@ test("a deferred verdict does not clear a reason the UI is explaining", () => {hardware_detection_deferred: true,};assert.equal(- resolveVerdict(deferred, { chatOnly: true, chatOnlyReason: "mlx_unavailable", chatOnlyDetail: null })+ resolveVerdict(deferred, { chatOnly: true, chatOnlyReason: "mlx_unavailable", chatOnlyDetail: null, chatOnlyHint: null }).chatOnlyReason,"mlx_unavailable","the sidebar recovery poll only runs while it reads mlx_unavailable",