{"record":{"id":"cc240a1fedcab4f3","repo":"can1357/oh-my-pi","slug":"onnx-runtime-cuda-provider-binaries-are-missing-fr","errorCode":null,"errorMessage":"ONNX Runtime CUDA provider binaries are missing from ${binDir}, and ${script} is unavailable. Remove the tiny-model side runtime cache at ${runtimeDir} and retry.","messagePattern":"ONNX Runtime CUDA provider binaries are missing from (.+?), and (.+?) is unavailable\\. Remove the tiny-model side runtime cache at (.+?) and retry\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/subprocess/worker-runtime.ts","lineNumber":206,"sourceCode":"\t\t\tawait fsp.access(path.join(binDir, file));\n\t\t} catch {\n\t\t\tmissing.push(file);\n\t\t}\n\t}\n\treturn missing;\n}\n\nasync function readPipe(stream: ReadableStream<Uint8Array> | null): Promise<string> {\n\tif (!stream) return \"\";\n\treturn new Response(stream).text();\n}\n\nasync function installOnnxRuntimeCudaProviders(packageDir: string, runtimeDir: string, binDir: string): Promise<void> {\n\tconst script = path.join(packageDir, \"script\", \"install.js\");\n\ttry {\n\t\tawait fsp.access(script);\n\t} catch {\n\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(","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/subprocess/worker-runtime.ts#L188-L224","documentation":"When the compiled tiny-model side runtime needs ONNX Runtime CUDA provider binaries (linux x64 with device=cuda/gpu/auto), the installer looks for onnxruntime-node's `script/install.js` inside the side runtime cache. If the CUDA .so files are missing AND the official install script is also absent, there is no way to repair the runtime, so this error is thrown instead of spawning a doomed install.","triggerScenarios":"Calls to ensureOnnxRuntimeCudaProviders (via loadTransformersRuntime) where missingOnnxRuntimeCudaProviderFiles(binDir) returns files and fsp.access(packageDir/script/install.js) fails — i.e. a partially-pruned or corrupted onnxruntime-node package in runtimeDir/node_modules.","commonSituations":"The side-runtime cache was copied incompletely (rsync/copy that skipped script/), a post-install cleanup stripped the install.js, or a package manager prune removed postinstall scripts from onnxruntime-node in the extracted compiled runtime.","solutions":["Delete the tiny-model side runtime cache directory (the runtimeDir path in the message) so the next run reinstalls it fresh.","Reinstall or repair onnxruntime-node inside the side runtime (npm/bun install onnxruntime-node with postinstall scripts enabled).","Verify the onnxruntime-node package version includes script/install.js; upgrade if the package layout changed.","If CUDA is not actually needed, unset PI_TINY_DEVICE or set it to 'cpu' to skip the CUDA provider path entirely."],"exampleFix":"// before: corrupted side-runtime cache with missing binaries and no installer\n// ~/.omp/tiny-runtime/node_modules/onnxruntime-node/  (bin/ and script/ missing)\n// after\nrm -rf ~/.omp/tiny-runtime   # paths per the error message; next launch reinstalls cleanly","handlingStrategy":"fallback","validationCode":"import { access } from \"node:fs/promises\";\nconst script = path.join(runtimeDir, \"node_modules/onnxruntime-node/script/install.js\");\nconst binDir = path.join(runtimeDir, \"node_modules/onnxruntime-node/bin/napi-v6/linux/x64\");\nlet repairable = false;\ntry { await access(script); repairable = true; } catch {}\nif (!repairable) console.warn(\"side runtime unrepairable; wipe cache before proceeding\");","typeGuard":null,"tryCatchPattern":"try {\n  await ensureOnnxRuntimeCudaProviders(runtimeDir, device);\n} catch (err) {\n  if (String(err.message).includes(\"is unavailable\")) {\n    await fs.rm(runtimeDir, { recursive: true, force: true });\n    await ensureOnnxRuntimeCudaProviders(runtimeDir, device);\n  } else throw err;\n}","preventionTips":["Copy/prune the side-runtime cache atomically and completely; never delete files inside onnxruntime-node selectively.","Keep postinstall scripts enabled so script/install.js ships with the package.","Set PI_TINY_DEVICE=cpu when CUDA is not required."],"tags":["onnx","cuda","install","missing-binary","side-runtime"],"backgroundTag":"onnx-cuda-provider-install-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}