can1357/oh-my-pi · error · Error

ONNX Runtime CUDA provider install completed but ${stillMiss

Error message

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.

What it means

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.

Source

Thrown at packages/coding-agent/src/subprocess/worker-runtime.ts:251

 */
export async function ensureOnnxRuntimeCudaProviders(
	runtimeDir: string,
	device = process.env.PI_TINY_DEVICE,
): Promise<void> {
	if (!shouldInstallOnnxRuntimeCudaProviders(device)) return;
	const nodeModules = path.join(runtimeDir, "node_modules");
	const manifest = resolveRuntimeModule(nodeModules, `${ONNX_RUNTIME_NODE_PACKAGE}/package.json`);
	if (!manifest)
		throw new Error(`Unable to resolve ${ONNX_RUNTIME_NODE_PACKAGE} in compiled runtime at ${nodeModules}`);
	const packageDir = path.dirname(manifest);
	const binDir = path.join(packageDir, LINUX_X64_ONNX_RUNTIME_CUDA_PROVIDER_DIR);
	const missing = await missingOnnxRuntimeCudaProviderFiles(binDir);
	if (missing.length === 0) return;

	await installOnnxRuntimeCudaProviders(packageDir, runtimeDir, binDir);
	const stillMissing = await missingOnnxRuntimeCudaProviderFiles(binDir);
	if (stillMissing.length === 0) return;
	throw new Error(
		`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.`,
	);
}

/**
 * Prepare a freshly-installed compiled runtime for loading and return the
 * absolute entrypoint of `packageName` to `require`.
 */
async function prepareCompiledRuntime(runtimeDir: string, packageName: string): Promise<string> {
	const nodeModules = await installSharpStubResolver(runtimeDir);
	const entry = resolveRuntimeModule(nodeModules, packageName);
	if (!entry) throw new Error(`Unable to resolve ${packageName} in compiled runtime at ${nodeModules}`);
	return entry;
}

// ── Transformers version resolution ─────────────────────────────────

function resolveTransformersVersionSpec(): string {

View on GitHub (pinned to 9690622007)

Solutions

  1. Note the listed still-missing files; check install script stdout/stderr from the previous attempt for a skip reason (unsupported CUDA version, musl, etc.).
  2. Remove the tiny-model side runtime cache at runtimeDir and retry on a supported glibc-based linux x64 with compatible NVIDIA drivers.
  3. Upgrade onnxruntime-node in the side runtime to a version whose install script supports your platform.
  4. Fall back to PI_TINY_DEVICE=cpu if the GPU path cannot be satisfied.
Defensive patterns

Strategy: fallback

Validate before calling

// after install, verify expected files yourself before relying on the runtime
const expected = ["libonnxruntime_providers_cuda.so", "libonnxruntime_providers_shared.so"];
const missing = [];
for (const f of expected) {
  try { await access(path.join(binDir, f)); } catch { missing.push(f); }
}
if (missing.length) console.warn("CUDA provider incomplete:", missing);

Try / catch

try {
  await ensureOnnxRuntimeCudaProviders(runtimeDir, "cuda");
} catch (err) {
  if (String(err.message).includes("still missing")) {
    logger.warn("CUDA providers incomplete; falling back to CPU", { detail: err.message });
    process.env.PI_TINY_DEVICE = "cpu";
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/5f2bf07467e5b1e6. Report an issue: GitHub.