{"record":{"id":"32a88aee266eb475","repo":"janhq/jan","slug":"extension-does-not-support-cuda-runtime-installati","errorCode":null,"errorMessage":"Extension does not support CUDA runtime installation","messagePattern":"Extension does not support CUDA runtime installation","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web-app/src/hooks/useBackendUpdater.ts","lineNumber":455,"sourceCode":"      // refreshBackendOptions (just rewrites the dropdown options); fall\n      // back to the heavy configureBackends path for older extensions.\n      if (extension.refreshBackendOptions) {\n        await extension.refreshBackendOptions()\n      } else {\n        await extension.configureBackends?.()\n      }\n    } catch (error) {\n      console.error('Error installing backend:', error)\n      throw error\n    }\n  }, [])\n\n  const installCudaRuntime = useCallback(async (filePath: string) => {\n    const extension = ExtensionManager.getInstance().getByName(\n      'llamacpp-extension'\n    ) as LlamacppExtension | undefined\n    if (!extension || !('installCudaRuntime' in extension)) {\n      throw new Error('Extension does not support CUDA runtime installation')\n    }\n    await extension.installCudaRuntime?.(filePath)\n  }, [])\n\n  return {\n    updateState,\n    checkForUpdate,\n    updateBackend,\n    setRemindMeLater,\n    installBackend,\n    installCudaRuntime,\n  }\n}\n","sourceCodeStart":437,"sourceCodeEnd":469,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/web-app/src/hooks/useBackendUpdater.ts#L437-L469","documentation":"Thrown in `installCudaRuntime` when `getByName('llamacpp-extension')` returns null OR the returned extension lacks `installCudaRuntime`. Unlike install/update, there is no fuzzy fallback here — only the exact name lookup. CUDA runtime install is a Windows/NVIDIA-only capability.","triggerScenarios":"Calling `installCudaRuntime(filePath)` when the llamacpp extension is missing, or when the installed version does not implement CUDA runtime installation (non-Windows build, older version, or CPU-only build).","commonSituations":"Invoked on macOS/Linux where the extension never ships `installCudaRuntime`; llamacpp extension disabled; NVIDIA toolkit integration added in a newer extension version than installed.","solutions":["Confirm you are on Windows with an NVIDIA GPU (CUDA runtime install is platform-gated).","Update the llamacpp extension to a version that ships `installCudaRuntime`.","Hide the CUDA runtime install UI when the capability is absent."],"exampleFix":"// before\nif (!extension || !('installCudaRuntime' in extension)) {\n  throw new Error('Extension does not support CUDA runtime installation')\n}\n\n// after\nif (!extension || typeof extension.installCudaRuntime !== 'function') {\n  throw new Error(\n    'CUDA runtime installation is not supported by the installed llamacpp extension (requires Windows + NVIDIA).'\n  )\n}","handlingStrategy":"type-guard","validationCode":"const ext = ExtensionManager.getInstance().getByName('llamacpp-extension')\nif (!ext || typeof ext.installCudaRuntime !== 'function') {\n  toast.error('CUDA runtime install unsupported', { description: 'Requires Windows + NVIDIA and a current llamacpp extension.' })\n  return\n}","typeGuard":"function supportsCudaRuntimeInstall(ext: unknown): ext is { installCudaRuntime(filePath: string): Promise<void> } {\n  return !!ext && typeof (ext as any).installCudaRuntime === 'function'\n}","tryCatchPattern":"try {\n  const ext = ExtensionManager.getInstance().getByName('llamacpp-extension')\n  if (!supportsCudaRuntimeInstall(ext)) {\n    toast.error('CUDA runtime install unsupported', { description: 'Windows + NVIDIA + current llamacpp extension required.' })\n    return\n  }\n  await ext.installCudaRuntime(filePath)\n} catch (error) {\n  console.error('installCudaRuntime:', error)\n  throw error\n}","preventionTips":["Gate the CUDA install UI to Windows + NVIDIA.","Hide the action entirely when the capability is absent.","Keep the extension updated."],"tags":["llamacpp","cuda","extension","capability-check","platform"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}