From 691af96e3e744a141a3f5aabf7f8328b48a997d7 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sat, 19 Sep 2026 16:07:19 +0200 Subject: [PATCH] Keep the readable half of a provider's error for the settings row ONNX Runtime's errors open with a source path and a template signature; the first 160 characters of a CUDA failure were all signature. The reason now starts at the first word a person can act on. --- core/dr-inference-engine/src/probe.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/dr-inference-engine/src/probe.rs b/core/dr-inference-engine/src/probe.rs index 9108df9..22cd714 100644 --- a/core/dr-inference-engine/src/probe.rs +++ b/core/dr-inference-engine/src/probe.rs @@ -192,8 +192,18 @@ fn time_rung( Ok((times[1], key)) } +/// The part of a provider's error a person can act on. ONNX Runtime's +/// begin with a source path and a C++ template signature; the words — +/// "CUDA failure 999: unknown error", "FAIL : Failed to load library" — +/// come after, and the settings row has room for one line of them. fn first_line(s: &str) -> String { - s.lines().next().unwrap_or("").chars().take(160).collect() + let line = s.lines().next().unwrap_or(""); + let start = ["failure", "FAIL :", "Error:", "error:"] + .iter() + .filter_map(|m| line.find(m)) + .min() + .unwrap_or(0); + line[start..].chars().take(200).collect() } /// Everything a change of which should re-probe: the runtime and where it