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++
Monitor: All GPUs leaves out a small integrated Radeon/Intel chip beside a real card (totals and count); the hardware report gives each card a stable id since each make numbers from 0; tests with the RTX 5070 + Radeon iGPU pair
Niko122159599f69f824
diff --git a/apps/host/src/lib/monitor-hardware.ts b/apps/host/src/lib/monitor-hardware.tsindex 96419127e..18fa04500 100644--- a/apps/host/src/lib/monitor-hardware.ts+++ b/apps/host/src/lib/monitor-hardware.ts@@ -29,3 +29,16 @@ export function gpuCapacity(devices:GpuInfo[]) {const shared=devices.filter(g=>g.unified).map(g=>g.vramGb);return devices.filter(g=>!g.unified).reduce((n,g)=>n+g.vramGb,0)+(shared.length?Math.max(...shared):0);}++/**+ * The cards "All GPUs" covers by default. A small integrated chip (an AMD or Intel adapter on the Windows/Vulkan list with a carve-out under+ * 2 GB) beside a real card is left out: Strata cannot run a model on it (the native engine report marks it unusable), and counting it adds a+ * second "GPU" and half a gigabyte to every total. It stays in the picker. Alone (a Strix Halo, an iGPU-only PC) it stays the default.+ */+export function defaultGpuSet(devices:GpuInfo[]):GpuInfo[] {+ const real=(g:GpuInfo)=>g.vramGb>=4||g.vendor==='nvidia'||g.backend==='cuda';+ const small=(g:GpuInfo)=>g.backend==='vulkan'&&(g.vendor==='amd'||g.vendor==='intel')&&g.vramGb<2&&!g.unified;+ if(!devices.some(real))return devices;+ const kept=devices.filter(g=>!small(g));+ return kept.length?kept:devices;+}diff --git a/apps/host/src/screens/Monitor.tsx b/apps/host/src/screens/Monitor.tsxindex 7430203c4..87cd4f58c 100644--- a/apps/host/src/screens/Monitor.tsx+++ b/apps/host/src/screens/Monitor.tsx@@ -12,7 +12,7 @@ import { Brand } from '../components/Brand';import { Bar, Btn, Icon, IconBtn, Select, type IconName } from '../components/ui';import { Screen } from '../components/layout';import { contextLabel, duration, tokens, tps } from '../lib/format';-import { gpuCapacity, gpuId, gpuMetric, gpuReported, hasReading, shortGpuName } from '../lib/monitor-hardware';+import { defaultGpuSet, gpuCapacity, gpuId, gpuMetric, gpuReported, hasReading, shortGpuName } from '../lib/monitor-hardware';import { useStore } from '../lib/store';import { useKept } from '../lib/kept-state';import type { Hardware, MonitorState, ServeRequest } from '../lib/types';@@ -107,11 +107,11 @@ function LegacyMonitorScreen({ native }: {if (!data)return <Screen title={tr("Monitor")}><p className="muted">{tr("Waiting for engine telemetry\u2026")}</p></Screen>;// A display adapter that has no sensors and no memory of its own (an integrated one) cannot be measured; counting it would blank every total.- const devices = (hardware?.gpus ?? []).filter(g => g.backend !== 'vulkan' || g.vramGb > 0), processors = hardware?.processors?.length ? hardware.processors : hardware ? [{ ...hardware.cpu, id: 'cpu', socket: '' }] : [];+ const devices = (hardware?.gpus ?? []).filter(g => g.backend !== 'vulkan' || g.vramGb > 0), defaultDevices = defaultGpuSet(devices), processors = hardware?.processors?.length ? hardware.processors : hardware ? [{ ...hardware.cpu, id: 'cpu', socket: '' }] : [];const assignedDevices = selectedInstance ? devices.filter(g => selectedInstance.gpuIds.includes(gpuId(g))) : [];const gpuChoice = gpuSelection === 'assigned' && selectedInstance ? 'assigned' : devices.some(g => gpuId(g) === gpuSelection) ? gpuSelection! : gpuSelection === 'all' || !assignedDevices.length ? 'all' : 'assigned';const cpuChoice = processors.some(p => p.id === cpuSelection) ? cpuSelection : 'all';- const selectedGpus = gpuChoice === 'assigned' ? devices.filter(g => selectedInstance?.gpuIds.includes(gpuId(g))) : gpuChoice === 'all' ? devices : devices.filter(g => gpuId(g) === gpuChoice);+ const selectedGpus = gpuChoice === 'assigned' ? devices.filter(g => selectedInstance?.gpuIds.includes(gpuId(g))) : gpuChoice === 'all' ? defaultDevices : devices.filter(g => gpuId(g) === gpuChoice);const selectedCpus = cpuChoice === 'all' ? processors : processors.filter(p => p.id === cpuChoice);const multipleGpus = selectedGpus.length > 1, shared = selectedGpus.length > 0 && selectedGpus.every(g => g.unified);const readings = data.hardware.gpus;@@ -135,7 +135,7 @@ function LegacyMonitorScreen({ native }: {const contextPct = contextKnown ? percent(contextUsed, data.context.maxTokens) : null;const cacheKnown = ['engine', 'demo'].includes(data.expertCache.source ?? '');const cacheMemory = cacheKnown ? data.expertCache.memoryGb : null;- const cachePercent = hasReading(cacheMemory) ? percent(cacheMemory, gpuCapacity(devices)) : cacheKnown ? percent(data.expertCache.used, data.expertCache.total) : null;+ const cachePercent = hasReading(cacheMemory) ? percent(cacheMemory, gpuCapacity(defaultDevices)) : cacheKnown ? percent(data.expertCache.used, data.expertCache.total) : null;const ramPct = percent(data.hardware.ramUsedGb, data.hardware.ramTotalGb);const history = data.history, timestamps = history.map(s => s.t);const historyGpu = (key: Parameters<typeof gpuMetric>[2], fallback: 'gpuLoad' | 'vramUsedGb' | 'gpuTempC' | 'powerW' | 'pcieRxMbs', mode: Parameters<typeof gpuMetric>[3] = 'sum') => history.map(sample => sample.gpus ? gpuMetric(selectedGpus, sample.gpus, key, mode) : (sample.gpuIds ? selectedGpus.length === sample.gpuIds.length && selectedGpus.every(gpu => sample.gpuIds!.includes(gpuId(gpu))) : gpuChoice === 'all') ? sample[fallback] : null);@@ -161,7 +161,7 @@ function LegacyMonitorScreen({ native }: {{tr(multipleModels ? <section className="st-card"><h2 className="h4">{tr("Model performance")}</h2><div className="st-tablewrap"><table className="st-table native-performance-table"><thead><tr><th>{tr("Model / device")}</th><th>{tr("Generating tok/s")}</th><th>{tr("Reading tok/s")}</th><th>{tr("State")}</th><th>{tr("Active / queued")}</th></tr></thead><tbody>{tr(runtime?.instances.map(i => { const recent = (data.requests ?? []).find(r => r.instanceId === i.id); const writing = i.phase === 'generating' || i.phase === 'thinking', reading = i.phase === 'reading'; return <tr key={i.id}><td><button className="text-btn strong" onClick={() => chooseInstance(i.id)}>{tr(instanceLabel(i))}</button><small>{tr(deviceLabel(i.gpuIds, inventory))}</small></td><td>{tr(number(writing ? i.outputTps : recent?.tps, 1))}<small>{tr(writing ? 'Now' : recent ? 'Last request' : 'No request yet')}</small></td><td>{tr(number(reading ? i.promptTps : recent?.promptTps, 0))}<small>{tr(reading ? 'Now' : recent ? 'Last request' : 'No request yet')}</small></td><td>{tr(i.phase)}{tr(runtime.mode === 'simulated' ? <small>{tr("Illustrative")}</small> : null)}</td><td>{tr(number(i.active))} / {tr(number(i.queued))}</td></tr>; }))}</tbody></table></div></section> : null)}{tr(multipleModels ? <p className="xs muted monitor-scope-note">{tr(selectedInstance ? selectedInstance.gpuIds.length ? 'Requests, context and speed are scoped to this model. GPU readings include all work on the selected devices.' : 'CPU-only model. Requests and context are scoped to this model; system metrics are shared host measurements.' : 'Select a model for its context and speed. GPU readings and system RAM are shared host measurements.')}</p> : null)}<section className="st-card monitor-state" aria-label={tr("Model state")} data-snapshot-skip>- <div className="monitor-state__head"><h2 className="h4">{tr(multipleScope ? 'Model activity' : 'Model state')}</h2><div className="monitor-state__badges">{tr([{ id: 'idle', label: 'Idle' }, { id: 'reading', label: 'Reading' }, { id: 'generating', label: 'Generating' }, { id: 'queued', label: 'Queued' }, { id: 'error', label: 'Error' }].map(s => <span key={s.id} className="st-badge" data-phase={s.id} data-active={phase === s.id || s.id === 'queued' && data.queue.waiting > 0}>{tr(s.label)}{tr(s.id === 'queued' && data.queue.waiting > 0 ? ` (${data.queue.waiting})` : '')}</span>))}</div><div className="monitor-device-selectors">{tr(devices.length > 1 ? <Select ariaLabel={tr("Monitor GPU")} value={gpuChoice} options={[...(selectedInstance ? [{ value: 'assigned', label: 'Assigned GPUs' }] : []), { value: 'all', label: `All GPUs (${devices.length})` }, ...devices.map((gpu, i) => ({ value: gpuId(gpu), label: `GPU ${i + 1} · ${gpu.name}` }))]} menuMinWidth={340} onChange={setGpuSelection}/> : null)}{tr(processors.length > 1 ? <Select ariaLabel={tr("Monitor processor")} value={cpuChoice} options={[{ value: 'all', label: `All processors (${processors.length})` }, ...processors.map((p, i) => ({ value: p.id, label: `CPU ${i + 1} · ${p.model}` }))]} onChange={setCpuSelection}/> : null)}</div></div>+ <div className="monitor-state__head"><h2 className="h4">{tr(multipleScope ? 'Model activity' : 'Model state')}</h2><div className="monitor-state__badges">{tr([{ id: 'idle', label: 'Idle' }, { id: 'reading', label: 'Reading' }, { id: 'generating', label: 'Generating' }, { id: 'queued', label: 'Queued' }, { id: 'error', label: 'Error' }].map(s => <span key={s.id} className="st-badge" data-phase={s.id} data-active={phase === s.id || s.id === 'queued' && data.queue.waiting > 0}>{tr(s.label)}{tr(s.id === 'queued' && data.queue.waiting > 0 ? ` (${data.queue.waiting})` : '')}</span>))}</div><div className="monitor-device-selectors">{tr(devices.length > 1 ? <Select ariaLabel={tr("Monitor GPU")} value={gpuChoice} options={[...(selectedInstance ? [{ value: 'assigned', label: 'Assigned GPUs' }] : []), { value: 'all', label: `All GPUs (${defaultDevices.length})` }, ...devices.map((gpu, i) => ({ value: gpuId(gpu), label: `GPU ${i + 1} · ${gpu.name}` }))]} menuMinWidth={340} onChange={setGpuSelection}/> : null)}{tr(processors.length > 1 ? <Select ariaLabel={tr("Monitor processor")} value={cpuChoice} options={[{ value: 'all', label: `All processors (${processors.length})` }, ...processors.map((p, i) => ({ value: p.id, label: `CPU ${i + 1} · ${p.model}` }))]} onChange={setCpuSelection}/> : null)}</div></div><div className="monitor-state__reading small"><span>{tr(multipleScope ? `${number(data.queue.running)} active · ${number(data.queue.waiting)} queued` : data.phase === 'idle' ? 'Waiting for a request' : data.phaseLabel)}</span><span className="muted num">{tr(statusDetail)}</span></div>{tr(!multipleScope ? <Bar label={tr("Model progress")} value={progress ?? 0} indeterminate={writing && !hasReading(progress)} tone={data.phase === 'reading' ? 'info' : 'accent'}/> : null)}</section>diff --git a/apps/host/tests/monitor-dashboard.test.mjs b/apps/host/tests/monitor-dashboard.test.mjsindex 99e349131..47bdf5f03 100644--- a/apps/host/tests/monitor-dashboard.test.mjs+++ b/apps/host/tests/monitor-dashboard.test.mjs@@ -4,7 +4,7 @@ import { parseCpuTopology, parseNvidiaReadings, parsePcieThroughput, gpuMemoryToimport { cpuUtilization, diskRate, parseLinuxDiskCounters, parseMacDiskCounters } from '../server/system-telemetry.mjs';import { parseEngineMetrics } from '../server/supervisor.mjs';import { originalDashboard } from '../server/monitor-dashboard.mjs';-import { gpuMetric, gpuCapacity, gpuReported, shortGpuName } from '../src/lib/monitor-hardware.ts';+import { gpuMetric, gpuCapacity, gpuReported, shortGpuName, defaultGpuSet, gpuId } from '../src/lib/monitor-hardware.ts';import { referencePaths } from '../src/lib/monitor-chart.ts';const gpu=(id,index=0,unified=false)=>({id,index,unified,vramGb:24,name:id,vendor:'nvidia',backend:'cuda'});@@ -104,3 +104,16 @@ test('All GPUs: a card with no temperature sensor is left out and the card thatassert.equal(shortGpuName('AMD Radeon RX 9070 XT'),'RX 9070 XT');assert.equal(shortGpuName('Intel(R) Arc(TM) A750 Graphics'),'A750 Graphics');});++test('an RTX 5070 beside the unsupported Radeon iGPU: All GPUs is the RTX alone, the iGPU stays pickable',()=>{+ const rtx={id:'GPU-5070',index:0,vendor:'nvidia',name:'NVIDIA GeForce RTX 5070',vramGb:11.9,unified:false,backend:'cuda'};+ const igpu={id:'PCI\VEN_1002&DEV_164E',index:1,vendor:'amd',name:'AMD Radeon(TM) Graphics',vramGb:0.5,unified:false,backend:'vulkan'};+ const set=defaultGpuSet([rtx,igpu]);+ assert.deepEqual(set.map(g=>g.id),['GPU-5070']);+ assert.equal(gpuCapacity(set),11.9);+ // the native engine report numbers each make from 0, so both cards say index 0: the ids stay different+ assert.notEqual(gpuId({...rtx,id:undefined}),gpuId({...igpu,id:undefined,index:0}));+ // alone, or a real AMD card beside it, nothing is dropped+ assert.deepEqual(defaultGpuSet([igpu]).map(g=>g.id),[igpu.id]);+ assert.equal(defaultGpuSet([{...igpu,vramGb:96,unified:true},rtx]).length,2);+});diff --git a/tools/strata_mcp.py b/tools/strata_mcp.pyindex 98c36519c..b84d835bd 100644--- a/tools/strata_mcp.py+++ b/tools/strata_mcp.py@@ -975,6 +975,8 @@ class Strata:except Exception: # noqa: BLE001 - unknown stays unknown: the app then keeps its safety defaultpasshw["gpus"] = nv + amd+ for g in hw["gpus"]: # each make numbers its cards from 0 (the engine drives one make): a stable id tells two cards apart+ g.setdefault("id", f"{g.get('vendor') or 'gpu'}:{g.get('index')}")try: # how fast each card is (SMs x clock): the app and the Terminal pick the Main card by itfrom strata_control import gpu_rolesgpu_roles.add_speeds(hw["gpus"])diff --git a/tools/test_strata_mcp.py b/tools/test_strata_mcp.pyindex 7b2292a7c..0fdb78bc8 100644--- a/tools/test_strata_mcp.py+++ b/tools/test_strata_mcp.py@@ -811,6 +811,9 @@ class MixedGraphics(unittest.TestCase):self.assertTrue(by["nvidia"]["usable"])self.assertFalse(by["amd"]["usable"])self.assertIn("NVIDIA card", by["amd"]["problem"])+ # the RTX and the Ryzen iGPU both say index 0 (each make counts from 0), so the report gives each a stable id of its own+ self.assertEqual((by["nvidia"]["index"], by["amd"]["index"]), (0, 0))+ self.assertEqual(sorted(g["id"] for g in hw["gpus"]), ["amd:0", "nvidia:0"])rec = s.recommend({**hw, "ram_gb": 92.0})self.assertEqual((rec["backend"], rec["gpu"]["name"]), ("cuda", "NVIDIA GeForce RTX 5090"))# with no NVIDIA card the integrated GPU stays what it was