From 3adf2cf48e5b0e264072bdc690d3a217a005e1e2 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 28 Sep 2026 09:04:04 -0500 Subject: [PATCH] allow models to share shareable detection hardware The hardware picker treated every device another model listed as taken, so a second model couldn't pick an Intel GPU or the CPU that the first one already used. The backend only rejects reuse of devices that can't be shared (Coral, MemryX), so the picker now matches that and only marks exclusive units as claimed. --- .../config-form/theme/fields/HardwarePicker.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/web/src/components/config-form/theme/fields/HardwarePicker.tsx b/web/src/components/config-form/theme/fields/HardwarePicker.tsx index 98382a8bf7..fb2bcb72ef 100644 --- a/web/src/components/config-form/theme/fields/HardwarePicker.tsx +++ b/web/src/components/config-form/theme/fields/HardwarePicker.tsx @@ -21,7 +21,8 @@ type HardwarePickerProps = { // scopes the unit checkbox ids, since several models can list the same unit idPrefix: string; devices: string[]; - // device strings already taken by another model, mapped to that model's scene + // device strings already taken by another model, mapped to that model's + // scene. Only binding for hardware that can't be shared. claimedElsewhere: Record; cameraCount: number; disabled?: boolean; @@ -84,8 +85,11 @@ export function HardwarePicker({ return; } - // start with the first unit no other model has taken - const free = entry.units.find((unit) => !claimedElsewhere[unit.device]); + // start with the first unit no other model has taken, falling back to + // a taken one when the hardware can be shared + const free = + entry.units.find((unit) => !claimedElsewhere[unit.device]) ?? + (entry.unlimited ? entry.units[0] : undefined); if (!free) { onChange([]); @@ -184,7 +188,9 @@ export function HardwarePicker({ {t("detectionModels.hardware.unitsDescription")}

{selected.units.map((unit) => { - const claimedBy = claimedElsewhere[unit.device]; + const claimedBy = selected.unlimited + ? undefined + : claimedElsewhere[unit.device]; return (