Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

Setup wizard: show the VRAM of AMD cards on Windows from the engine's list when the host probe reports 0 (#3727, PR #3798 by chicco83)

chicco8390a7aeea51ee
diff --git a/apps/host/src/components/OnboardingMemory.tsx b/apps/host/src/components/OnboardingMemory.tsx
index 92c059097..fe4665707 100644
--- a/apps/host/src/components/OnboardingMemory.tsx
+++ b/apps/host/src/components/OnboardingMemory.tsx
@@ -8,9 +8,20 @@ export function OnboardingMemory({ hardware, native }: {
hardware: Hardware | null;
native: NativeState['hardware'] | undefined;
}) {
- const gpus = hardware ? hardware.gpus.filter(gpu => gpu.backend !== 'cpu').map(gpu => ({ id: gpu.id ?? String(gpu.index), name: gpu.name, memory: gpu.vramGb, shared: gpu.unified })) : native?.gpus.map(gpu => ({ id: String(gpu.index), name: gpu.name, memory: gpu.vram_gb, shared: false })) ?? [];
+ // The Windows host probe (Win32_VideoController) cannot read the VRAM of AMD cards and reports 0 for them; the engine's own list has
+ // the real size. For a dedicated card the host reports as 0, take the engine's figure for the card of the same name, or for the
+ // card in the same position when both lists have the same length. A card the engine does not list stays at 0.
+ const nativeGpus = native?.gpus ?? [];
+ const hostGpus = hardware ? hardware.gpus.filter(gpu => gpu.backend !== 'cpu') : [];
+ const engineVram = (name: string, position: number) => {
+ const norm = (value: string) => value.toLowerCase().replace(/[^a-z0-9]/g, '');
+ const byName = nativeGpus.find(g => norm(g.name).includes(norm(name)) || norm(name).includes(norm(g.name)));
+ return (byName ?? (nativeGpus.length === hostGpus.length ? nativeGpus[position] : undefined))?.vram_gb || 0;
+ };
+ const gpus = hardware ? hostGpus.map((gpu, position) => ({ id: gpu.id ?? String(gpu.index), name: gpu.name, memory: gpu.unified || gpu.vramGb > 0 ? gpu.vramGb : engineVram(gpu.name, position), shared: gpu.unified })) : nativeGpus.map(gpu => ({ id: String(gpu.index), name: gpu.name, memory: gpu.vram_gb, shared: false }));
const dedicatedCount = gpus.filter(gpu => !gpu.shared).length;
- const memory = hardware ? memoryInventory(hardware) : native ? { ram: native.ram_gb, vram: native.gpus.reduce((sum, gpu) => sum + Math.max(0, gpu.vram_gb || 0), 0), total: 0, shared: false } : null;
+ const base = hardware ? memoryInventory(hardware) : null;
+ const memory = base ? (base.shared ? base : { ...base, vram: gpus.reduce((sum, gpu) => sum + (gpu.shared ? 0 : Math.max(0, gpu.memory || 0)), 0) }) : native ? { ram: native.ram_gb, vram: native.gpus.reduce((sum, gpu) => sum + Math.max(0, gpu.vram_gb || 0), 0), total: 0, shared: false } : null;
if (!memory)
return <div className="onboard-hardware" role="group" aria-label={tr("Computer memory")}><div className="onboard-memory-intro"><Icon name="memory" size={18}/><span>{tr("Reading memory\u2026")}</span></div></div>;
const total = memory.ram + memory.vram;