From e8c828089a28b5425eee1d7a93c54ce718cafb57 Mon Sep 17 00:00:00 2001 From: Jaret Burkett Date: Thu, 18 Jun 2026 09:37:59 -0600 Subject: [PATCH] Fix issue where gpu sometimes doesnt show on caption modal --- ui/src/hooks/useGPUInfo.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/src/hooks/useGPUInfo.tsx b/ui/src/hooks/useGPUInfo.tsx index b8f6040..1e43865 100644 --- a/ui/src/hooks/useGPUInfo.tsx +++ b/ui/src/hooks/useGPUInfo.tsx @@ -44,5 +44,15 @@ export default function useGPUInfo(gpuIds: null | number[] = null, reloadInterva } }, [gpuIds, reloadInterval]); // Added dependencies + // If the initial fetch failed (e.g. nvidia-smi was transiently busy on startup), + // retry automatically so users don't have to reload the page to see their GPUs. + useEffect(() => { + if (status !== 'error') return; + const retry = setTimeout(() => { + fetchGpuInfo(); + }, 3000); + return () => clearTimeout(retry); + }, [status]); + return { gpuList, setGpuList, isGPUInfoLoaded, status, refreshGpuInfo: fetchGpuInfo }; }