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