fix(tiny): repaired cuda side-runtime install

Downloaded missing ONNX Runtime CUDA provider sidecars when the compiled tiny-model side runtime is used with PI_TINY_DEVICE=cuda.

Preserved actionable CUDA worker diagnostics in tiny-models text output and added focused regression coverage.

Fixes #4475
This commit is contained in:
roboomp
2026-07-03 18:21:19 +00:00
parent d0c1890a6c
commit f257fd533f
6 changed files with 325 additions and 11 deletions
@@ -35,12 +35,19 @@ function writeLine(text = ""): void {
process.stdout.write(`${text}\n`);
}
const ACTIONABLE_DOWNLOAD_ERROR_LINE = /PI_TINY_|CUDA|cuDNN|cudnn|libcudnn|tiny-title-runtime|onnxruntime-node/i;
function downloadErrorSummary(error: string | undefined): string | undefined {
return error
?.split(/\r?\n/)
.map(line => line.trim())
.find(line => line.length > 0)
?.replace(/^Error:\s*/, "");
const lines =
error
?.split(/\r?\n/)
.map(line => line.trim().replace(/^Error:\s*/, ""))
.filter(line => line.length > 0) ?? [];
const first = lines[0];
if (!first) return undefined;
const details = lines.slice(1).filter(line => ACTIONABLE_DOWNLOAD_ERROR_LINE.test(line));
if (details.length === 0) return first;
return [first, ...details].join("\n");
}
export function resolveModels(model: string | undefined): TinyLocalModelKey[] {