{"record":{"id":"a7eaafb2ecb211e3","repo":"can1357/oh-my-pi","slug":"failed-to-install-onnx-runtime-cuda-provider-binar","errorCode":null,"errorMessage":"Failed to install ONNX Runtime CUDA provider binaries into ${binDir} with ${process.execPath} ${script} (exit ${exitCode}). Remove the tiny-model side runtime cache at ${runtimeDir} and retry with network access. ${output}","messagePattern":"Failed to install ONNX Runtime CUDA provider binaries into (.+?) with (.+?) (.+?) \\(exit (.+?)\\)\\. Remove the tiny-model side runtime cache at (.+?) and retry with network access\\. (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/subprocess/worker-runtime.ts","lineNumber":224,"sourceCode":"\t\tthrow new Error(\n\t\t\t`ONNX Runtime CUDA provider binaries are missing from ${binDir}, and ${script} is unavailable. Remove the tiny-model side runtime cache at ${runtimeDir} and retry.`,\n\t\t);\n\t}\n\n\tconst proc = Bun.spawn([process.execPath, script], {\n\t\tcwd: runtimeDir,\n\t\tenv: { ...Bun.env, BUN_BE_BUN: \"1\", ONNXRUNTIME_NODE_INSTALL: ONNX_RUNTIME_CUDA_INSTALL },\n\t\tstdout: \"pipe\",\n\t\tstderr: \"pipe\",\n\t});\n\tconst [stdout, stderr, exitCode] = await Promise.all([\n\t\treadPipe(proc.stdout as ReadableStream<Uint8Array> | null),\n\t\treadPipe(proc.stderr as ReadableStream<Uint8Array> | null),\n\t\tproc.exited,\n\t]);\n\tif (exitCode !== 0) {\n\t\tconst output = `${stdout}\\n${stderr}`.trim();\n\t\tthrow new Error(\n\t\t\t`Failed to install ONNX Runtime CUDA provider binaries into ${binDir} with ${process.execPath} ${script} (exit ${exitCode}). Remove the tiny-model side runtime cache at ${runtimeDir} and retry with network access. ${output}`,\n\t\t);\n\t}\n}\n\n/**\n * Repairs the compiled Transformers side runtime when CUDA was requested and\n * Bun skipped `onnxruntime-node`'s NuGet sidecar install.\n */\nexport async function ensureOnnxRuntimeCudaProviders(\n\truntimeDir: string,\n\tdevice = process.env.PI_TINY_DEVICE,\n): Promise<void> {\n\tif (!shouldInstallOnnxRuntimeCudaProviders(device)) return;\n\tconst nodeModules = path.join(runtimeDir, \"node_modules\");\n\tconst manifest = resolveRuntimeModule(nodeModules, `${ONNX_RUNTIME_NODE_PACKAGE}/package.json`);\n\tif (!manifest)\n\t\tthrow new Error(`Unable to resolve ${ONNX_RUNTIME_NODE_PACKAGE} in compiled runtime at ${nodeModules}`);","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/subprocess/worker-runtime.ts#L206-L242","documentation":"The ONNX Runtime CUDA provider install script (onnxruntime-node's script/install.js) was found and spawned with process.execPath, but exited non-zero. The error includes the script's captured stdout/stderr so the underlying download/extraction failure is visible, and advises clearing the side-runtime cache and retrying with network access.","triggerScenarios":"ensureOnnxRuntimeCudaProviders detects missing CUDA binaries in binDir and calls installOnnxRuntimeCudaProviders; the spawned install script (ONNXRUNTIME_NODE_INSTALL=cuda) exits with code != 0 — typically a failed NuGet/package download.","commonSituations":"Offline or firewalled machines that cannot reach onnxruntime's CDN/NuGet feed, proxy/TLS interception breaking the download, disk-full during extraction, or an unsupported linux x64 CUDA configuration rejected by the script.","solutions":["Read the ${output} tail of the message to find the root cause (DNS, 403, disk space, etc.) and fix that.","Restore network access / configure proxy env vars (HTTPS_PROXY) so the script can download the CUDA provider packages.","Remove the tiny-model side runtime cache at runtimeDir and retry.","Free disk space if extraction failed; verify CUDA-compatible linux x64 platform.","Set PI_TINY_DEVICE=cpu to skip CUDA provider installation if GPU acceleration is not required."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight connectivity to the package host before attempting install\nconst res = await fetch(\"https://www.nuget.org/api/v2/\", { method: \"HEAD\" }).catch(() => null);\nif (!res?.ok) console.warn(\"no network; CUDA provider install will likely fail\");","typeGuard":null,"tryCatchPattern":"try {\n  await ensureOnnxRuntimeCudaProviders(runtimeDir, \"cuda\");\n} catch (err) {\n  if (String(err.message).includes(\"(exit\")) {\n    logger.warn(\"CUDA provider install failed\", { output: err.message });\n    // fall back to CPU device instead of failing the worker\n  } else throw err;\n}","preventionTips":["Ensure network access and proxy env vars (HTTPS_PROXY) are configured on install machines.","Provision disk headroom before runtime installs.","Pre-warm the side runtime cache during setup while network is known-good.","Use PI_TINY_DEVICE=cpu on machines without GPU access."],"tags":["onnx","cuda","network","install-script","exit-code"],"backgroundTag":"onnx-cuda-provider-install-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}