{"record":{"id":"5f2bf07467e5b1e6","repo":"can1357/oh-my-pi","slug":"onnx-runtime-cuda-provider-install-completed-but","errorCode":null,"errorMessage":"ONNX Runtime CUDA provider install completed but ${stillMissing.join(\", \")} are still missing from ${binDir}. Remove the tiny-model side runtime cache at ${runtimeDir} and retry.","messagePattern":"ONNX Runtime CUDA provider install completed but (.+?) are still missing from (.+?)\\. 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":251,"sourceCode":" */\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}`);\n\tconst packageDir = path.dirname(manifest);\n\tconst binDir = path.join(packageDir, LINUX_X64_ONNX_RUNTIME_CUDA_PROVIDER_DIR);\n\tconst missing = await missingOnnxRuntimeCudaProviderFiles(binDir);\n\tif (missing.length === 0) return;\n\n\tawait installOnnxRuntimeCudaProviders(packageDir, runtimeDir, binDir);\n\tconst stillMissing = await missingOnnxRuntimeCudaProviderFiles(binDir);\n\tif (stillMissing.length === 0) return;\n\tthrow new Error(\n\t\t`ONNX Runtime CUDA provider install completed but ${stillMissing.join(\", \")} are still missing from ${binDir}. Remove the tiny-model side runtime cache at ${runtimeDir} and retry.`,\n\t);\n}\n\n/**\n * Prepare a freshly-installed compiled runtime for loading and return the\n * absolute entrypoint of `packageName` to `require`.\n */\nasync function prepareCompiledRuntime(runtimeDir: string, packageName: string): Promise<string> {\n\tconst nodeModules = await installSharpStubResolver(runtimeDir);\n\tconst entry = resolveRuntimeModule(nodeModules, packageName);\n\tif (!entry) throw new Error(`Unable to resolve ${packageName} in compiled runtime at ${nodeModules}`);\n\treturn entry;\n}\n\n// ── Transformers version resolution ─────────────────────────────────\n\nfunction resolveTransformersVersionSpec(): string {","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/subprocess/worker-runtime.ts#L233-L269","documentation":"After running onnxruntime-node's install script for the CUDA providers, ensureOnnxRuntimeCudaProviders re-checks the expected .so files in binDir. If some are still missing even though the script exited 0, the install silently failed to place binaries, and this error lists exactly which files remain absent.","triggerScenarios":"installOnnxRuntimeCudaProviders succeeds (exit 0) but a follow-up missingOnnxRuntimeCudaProviderFiles(binDir) still returns entries — e.g. the script downloaded a CPU-only layout, wrote to a different linux/x64 dir, or skipped files for an incompatible CUDA/glibc version.","commonSituations":"Mismatched CUDA toolkit expectations (script decides the platform is unsupported and no-ops), odd glibc/musl (Alpine) environments where the script skips installation, or a read-only/full disk that silently dropped files.","solutions":["Note the listed still-missing files; check install script stdout/stderr from the previous attempt for a skip reason (unsupported CUDA version, musl, etc.).","Remove the tiny-model side runtime cache at runtimeDir and retry on a supported glibc-based linux x64 with compatible NVIDIA drivers.","Upgrade onnxruntime-node in the side runtime to a version whose install script supports your platform.","Fall back to PI_TINY_DEVICE=cpu if the GPU path cannot be satisfied."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// after install, verify expected files yourself before relying on the runtime\nconst expected = [\"libonnxruntime_providers_cuda.so\", \"libonnxruntime_providers_shared.so\"];\nconst missing = [];\nfor (const f of expected) {\n  try { await access(path.join(binDir, f)); } catch { missing.push(f); }\n}\nif (missing.length) console.warn(\"CUDA provider incomplete:\", missing);","typeGuard":null,"tryCatchPattern":"try {\n  await ensureOnnxRuntimeCudaProviders(runtimeDir, \"cuda\");\n} catch (err) {\n  if (String(err.message).includes(\"still missing\")) {\n    logger.warn(\"CUDA providers incomplete; falling back to CPU\", { detail: err.message });\n    process.env.PI_TINY_DEVICE = \"cpu\";\n  } else throw err;\n}","preventionTips":["Use supported platforms: glibc-based linux x64 with compatible NVIDIA drivers/CUDA.","Avoid musl/Alpine for the CUDA provider path unless onnxruntime-node officially supports it.","Check install script output for silent skips; upgrade onnxruntime-node if your CUDA version is unsupported.","Default to cpu device when GPU prerequisites cannot be guaranteed."],"tags":["onnx","cuda","verification","missing-binary"],"backgroundTag":"onnx-cuda-provider-install-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}