First-run card stays until Continue; a processor's own graphics is not counted as a card
This commit is contained in:
1 parent
ec03ae0106
commit
db42e59930
2 files changed
+7
-5
No files matched your search
@@ -41,7 +41,8 @@ export function useEngineNeeded(): boolean | null {
|
||||
}
|
||||
|
||||
function gpuLine(info: FirstRunInfo) {
|
||||
const first = info.gpus[0];
|
||||
// a processor's own tiny graphics (no memory of its own) is not "a card"
|
||||
const first = info.gpus.find(g => (g.vramGb ?? 0) >= 1) ?? info.gpus[0];
|
||||
if (!first) return '';
|
||||
const vram = first.vramGb ? `, ${Math.round(first.vramGb)} GB` : '';
|
||||
const driver = info.driver ? `, driver ${info.driver}` : '';
|
||||
@@ -122,7 +123,7 @@ export function EngineFirstRun({ onDone }: { onDone: () => void }) {
|
||||
const bytes = info?.offer?.bytes ?? 0;
|
||||
const doneMb = Math.round(mb(bytes) * percent / 100);
|
||||
const eta = useDownloadEta(running && bytes ? { done_gb: bytes * percent / 100 / 1e9, remaining_gb: bytes * (100 - percent) / 100 / 1e9 } : undefined, job?.id);
|
||||
const cards = info?.gpus.length ?? 0;
|
||||
const cards = (info?.gpus ?? []).filter(g => (g.vramGb ?? 0) >= 1).length;
|
||||
const hidden = <input ref={file} type="file" accept=".gz,.tgz,.xz,.zip" hidden onChange={e => void chosen(e.target.files)}/>;
|
||||
const pick = (label: string) => <button type="button" className="onboard-continue-anyway" disabled={busy || running} onClick={() => file.current?.click()}>{tr(label)}</button>;
|
||||
|
||||
|
||||
@@ -4,14 +4,15 @@ import { useNative } from '../lib/native';
|
||||
import { useStore } from '../lib/store';
|
||||
import { useEngineUnpacking } from '../lib/engine-setup';
|
||||
import { EngineFirstRun, useEngineNeeded } from '../components/EngineFirstRun';
|
||||
import { useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
/** Every setup entry uses the same guided onboarding. */
|
||||
export function SetupScreen() {
|
||||
const native = useNative(), setup = useStore(s => s.setup);
|
||||
const needsEngine = useEngineNeeded(), [engineStepDone, setEngineStepDone] = useState(false);
|
||||
const needsEngine = useEngineNeeded(), [engineStepDone, setEngineStepDone] = useState(false), [cardShown, setCardShown] = useState(false);
|
||||
useEffect(() => { if (needsEngine) setCardShown(true); }, [needsEngine]);
|
||||
const unpacking = useEngineUnpacking(!native || !setup);
|
||||
// No engine on this PC yet: the first-run card comes before the model steps (it works before the native snapshot has connected).
|
||||
if (!engineStepDone && !setup?.complete && needsEngine)
|
||||
if (!engineStepDone && !setup?.complete && (needsEngine || cardShown))
|
||||
return <EngineFirstRun onDone={() => setEngineStepDone(true)}/>;
|
||||
if (!native || !setup)
|
||||
return <div className="setup guided-onboarding"><p className="onboard-loading" role="status">{tr("Getting your setup ready\u2026")}</p>{unpacking ? <p className="onboard-loading small" role="status">{tr("Unpacking the engine that came with the app. This takes about a minute the first time.")}</p> : null}</div>;
|
||||
|
||||
Reference in new issue
Block a user