Skip to content

fix(device): fall back to DMI board name for chip model on ARM64 Linux - #14

Merged
ykhrustalev merged 6 commits into
Liquid4All:mainfrom
ankitanand3:fix/arm64-linux-chip-model
Sep 25, 2026
Merged

ykhrustalev merged 6 commits into
Liquid4All:mainfrom
ankitanand3:fix/arm64-linux-chip-model

Conversation

@ankitanand3

Copy link
Copy Markdown
Contributor

Problem

PlatformDetector::detect() cannot resolve device_chip_model on ARM64 Linux hosts, and because
probe() treats it as required, no benchmark result can be recorded at all on those machines.
The measurement itself completes; the run then dies at the recording step with:

Error: device detection failed for: device_chip_model;
use --device-name / --device-form-factor or check platform support

The two sources tried on Linux both come back None:

  • cpuinfo_chip_model() reads Hardware and model name from /proc/cpuinfo. Neither field is
    emitted on this host; /proc/cpuinfo carries only CPU implementer: 0x41 and
    CPU part: 0xd85 / 0xd87.
  • device_tree_model() reads /proc/device-tree/model, which is empty here.

The error message also suggests --device-name / --device-form-factor, but those live on
auth set-device, not benchmarks run, and neither overrides the chip model. There is no
override for device_chip_model anywhere in the CLI, so the failure is unrecoverable without a
code change.

Reproduced on an MSI EdgeXpert (NVIDIA GB10, 128GB unified, Ubuntu 24.04.4 aarch64,
kernel 6.17.0-1026-nvidia). It is not GB10-specific: any ARM64 Linux host whose kernel omits
model name and exposes no device-tree model node hits the same wall.

Solution

Add /sys/devices/virtual/dmi/id/board_name as a third fallback in the chip-model chain. That is
the sibling of the file detect_device_name() already reads, so it needs no new dependency and no
new probing strategy.

On the machine above it resolves to EdgeXpert (MS-C931).

board_name rather than product_name because it is the more specific of the two here, and
because detect_device_name() already takes product_name, so the two fields stay distinct
instead of collapsing to the same string.

Testing

The repository's own probe::tests::detect_returns_all_required_fields is the regression test:
it asserts device_chip_model.is_some() and fails on this hardware without the change.

# without the patch
test probe::tests::detect_returns_all_required_fields ... FAILED
panicked at crates/pipette-device/src/probe.rs:1272

# with the patch
test probe::tests::detect_returns_all_required_fields ... ok

Full local gate, all green on aarch64 Linux:

./ci/lint.sh                           # all convention checks passed
cargo fmt --all --check                # clean
cargo clippy --workspace --all-targets # exit 0, no new warnings
cargo test --workspace                 # 535 + 136 + 126 + 24 + 17 + 9 + ... passed, 0 failed
cargo test --doc --workspace           # 0 failed

End to end, a real benchmark now records where it previously aborted:

pipette benchmarks run --benchmark local/decode_throughput_100_100 \
  --model  '{"type":"gguf_text","source":"absolute_file","path":".../Qwen3.8-27B-UD-Q4_K_XL.gguf"}' \
  --runtime 'llamacpp-cli-stock-tools://url=<archive>&flavor=linux-arm64-cuda-13-gb10' \
  --runtime-flags '{"mmap":true}'

recorded c6514d0f-235e-453a-9f4b-6bbb3dd3bc7c (local)

Resulting payload:

device_name       = MSI EdgeXpert (NVIDIA GB10)
device_chip_model = EdgeXpert (MS-C931)
device_gpu_model  = NVIDIA GB10
device_ram_bytes  = 130663149568
device_os_name    = Ubuntu 24.04, 6.17.0-1026-nvidia

Measured 12.24 tok/s decode, which matches 12.33 tok/s from an independent llama-bench harness on
the same machine and model.

Notes

Two adjacent things I hit while getting here, both out of scope for this PR, happy to file
separately if useful:

  1. There is no Linux CUDA runtime flavor, for any architecture. LlamaCppFlavor has
    windows-x64-cuda-12-4 and windows-x64-cuda-13-1 and nothing else CUDA. Linux arm64 offers
    linux-arm64-cpu and linux-arm64-vulkan. Upstream llama.cpp does not publish a linux-arm64
    CUDA asset either, so this needs the url= form with a locally built archive. That part works
    well, the Custom flavor path is a good escape hatch.
  2. max_memory_usage is gated to linux-arm64-cpu / linux-x64-cpu / linux-s390x-cpu on
    Linux, so it bails on any GPU flavor. Expected given (1), noting it in case it is not.

cpuinfo_chip_model() and device_tree_model() both return None on ARM64 hosts whose kernel emits no Hardware or model name field in /proc/cpuinfo and expose no /proc/device-tree/model. probe() then fails the device_chip_model requirement and no result can be recorded at all.

Fall back to /sys/devices/virtual/dmi/id/board_name, the sibling of the file detect_device_name() already reads.
@iamstuffed

Copy link
Copy Markdown
Collaborator

This is an AI code review. Generated by Claude (Opus 5) via Claude Code. I've read it and agree with the findings, but treat the reasoning as something to verify rather than accept. Anything wrong here is worth pushing back on.

Reviewed at 4466a63 against origin/main.

Verdict

Good, tightly scoped fix. Nothing below blocks merging.

Verified locally: cargo clippy -p pipette-device --all-targets against both x86_64-unknown-linux-gnu and aarch64-unknown-linux-gnu (the Linux cfg block does not compile on my macOS host, so I cross-checked it), cargo fmt --all --check clean, ci/lint.sh 8/8, cargo test -p pipette-device 37 passed. CI on the PR is 13 pass / 6 skipping.

The blast radius is zero, and that is the strongest argument for this change. dmi_board_name is last in an or_else chain, so it is only evaluated when both prior sources return None, which is exactly the state that currently hard-fails probe(). No host that records a result today changes what it reports. Worth stating in the PR description, because it reduces the risk conversation to nothing.

The diagnosis is unusually thorough: both existing sources traced to the specific missing /proc/cpuinfo fields, board_name versus product_name justified rather than assumed, and end to end validation against an independent llama-bench figure (12.24 against 12.33 tok/s).

Substantive comments

1. It records a board name in a field that means chip

board_name resolves to EdgeXpert (MS-C931), a motherboard SKU, while the actual chip is the GB10. The field's neighbours are Apple M3, AMD Ryzen AI Max+ 395, machdep.cpu.brand_string, and on Android ro.soc.model, all of which are genuine silicon identifiers.

In fairness, the chain already degrades this way. device_tree_model's own doc comment calls it "the board name on hosts with no DMI", so main already puts board names into device_chip_model on SBCs. This PR is consistent with existing behaviour rather than a new departure.

But it is worth saying so in the doc comment, so that the next person reading device_chip_model = EdgeXpert (MS-C931) in a payload knows it is the documented degradation and not a detection bug.

2. Worth checking what else that machine exposes before settling on board_name

Three candidates, all cheap to check on the EdgeXpert:

  • /proc/device-tree/compatible. The PR establishes that model is empty, but compatible is a separate node, and on Tegra class hardware it usually carries something like nvidia,gb10. If it is populated, that is the actually correct answer, and it slots in right next to the existing device_tree_model reader.
  • lscpu. It decodes CPU implementer: 0x41 and CPU part: 0xd85 via MIDR into Cortex-X925. It works on ARM64 hosts with no DMI at all, which board_name does not cover, and it fits the existing cmd_output(...) idiom already used for uname, nvidia-smi, hostname, and lspci. It gives a core name rather than an SoC marketing name, but it is chip shaped and it generalises.
  • /sys/devices/soc0/soc_id and /sys/devices/soc0/machine.

This is not a request to change the PR. But if compatible turns out to be populated, putting it ahead of board_name is a two line delta that gets the semantics right for free.

3. DMI placeholder strings will land silently

board_name is frequently junk on whitebox and OEM boards: Default string, To Be Filled By O.E.M., System Product Name, None, Unknown, Not Applicable. The .filter(|s| !s.is_empty()) guard catches empty but not any of those.

Because this is now the terminal link in the chain, a junk value gets recorded as that fleet's chip model permanently with no signal at all, whereas today those hosts fail loudly. That is the one place this change trades a loud failure for a quiet wrong answer.

A small denylist would close it. At minimum, a log::debug! when the chip model resolves from DMI would tell an operator why their payload says something odd. log is already a dependency and is used elsewhere in the crate.

4. dmi_board_name duplicates the first step of detect_device_name()

The two bodies are identical apart from the filename:

std::fs::read_to_string("/sys/devices/virtual/dmi/id/<field>")
    .ok().map(|s| s.trim().to_string()).filter(|s| !s.is_empty())

A fn dmi_field(name: &str) -> Option<String> serves both, and makes the next DMI field anyone wants (sys_vendor, product_family, board_vendor) a one liner. Small, but this is the second copy, which is usually the right moment to pull it out.

5. The stated regression test does not cover the new code on CI

detect_returns_all_required_fields asserts device_chip_model.is_some() against whatever the host exposes, so it passes on every CI runner regardless of this change, and it can only fail on the specific ARM64 hardware. Describing it as "the repository's own regression test" slightly oversells it. It is a useful local proof on that box, not standing coverage.

dmi_board_name has no direct test and cannot get one without an injection seam for the path, which would be disproportionate for five lines. Fine as it is. Just worth being precise about in the description.

6. The misleading error message is diagnosed but not fixed

The PR correctly notes that use --device-name / --device-form-factor points at auth set-device flags that do not exist on benchmarks run and would not override the chip model anyway. Since you already found it, either tailor the hint to the fields that actually have overrides, or file it. A known wrong error message left in place after being diagnosed tends to stay wrong.

Nits

  • The doc comment's "Observed on NVIDIA GB10 / DGX Spark class boards" is exactly the right kind of specificity. Keep it.
  • Placement between detect_form_factor and device_tree_model reads fine. The two DMI readers ending up at opposite ends of the impl is the only reason I would nudge toward the shared helper in point 4.

On the two out of scope notes

Both are real and both are worth filing. The max_memory_usage gating to the linux-*-cpu flavors is the more interesting one, since it means any Linux GPU host silently cannot run that benchmark. That is a coverage hole rather than a config quirk.

Review follow-ups on the ARM64 chip-model fallback.

- Extract dmi_field(), replacing the duplicated read in detect_device_name().
- Reject DMI placeholder strings (Default string, To Be Filled By O.E.M. and
  friends) in the chip-model fallback. As the terminal link in the chain an
  unfiltered placeholder would become a fleet permanent chip model with no
  signal, which is the one case where this change traded a loud failure for a
  quiet wrong answer.
- Log at debug when the chip model resolves from DMI, so an operator can see
  why a payload reads the way it does.
- Document that this records a board identifier in a field that elsewhere
  holds silicon names, and that the degradation already exists one link up in
  device_tree_model.

detect_device_name keeps its previous behaviour: dmi_field() applies only the
empty check it already did, and the placeholder filter is confined to the
chip-model path.
@ankitanand3

Copy link
Copy Markdown
Contributor Author

Thanks, this is a genuinely useful review. Pushed cdc3d55 with 1, 3 and 4. Notes on the rest below, including what the box actually exposes for 2, which turned out to be the interesting part.

Checked on the hardware (your point 2)

All three candidates, on the EdgeXpert. None of them work here:

Source Result
/proc/device-tree/compatible absent. There is no /proc/device-tree at all on this box, so device_tree_model above was never going to fire either
lscpu Model name: Cortex-X925 and Model name: Cortex-A725
/sys/devices/soc0/soc_id jep106:0426:8901 (family = jep106:0426, machine absent)

So compatible is not the free win, unfortunately. Worth knowing that this class of box has no device tree whatsoever rather than an empty model node.

lscpu is the one I would want to discuss. It does decode the MIDR, but on a heterogeneous ARM64 core layout it returns one row per core type, so there is no single answer to take. Picking the first, the largest, or joining them are all defensible and all a bit arbitrary. It also shadows DMI on every Linux host, which is a much larger blast radius than what is in this PR. I did not want to make that call unilaterally.

soc0/soc_id is a JEP106 vendor code, not a name.

One thing I did not expect: product_family reads DGX Spark, and sys_vendor reads MSI. If you would rather the field carried a platform class than a board SKU, product_family is arguably the better string, and with the shared dmi_field() in place it is now a one-word change. Happy to switch it, or to add lscpu ahead of DMI, if you have a preference. I would rather you pick the semantics than guess.

What changed in cdc3d55

  • dmi_field(field: &str) extracted, detect_device_name() now uses it. Its behaviour is unchanged: dmi_field applies only the empty check that was already there.
  • The placeholder denylist is confined to the chip-model path, deliberately. Applying it to detect_device_name() too would change what existing hosts report, and I did not want to spend the zero blast radius you called out.
  • log::debug! on both outcomes, so an operator can see why a payload reads the way it does, and can also see when a placeholder was rejected.
  • Doc comment now says outright that this puts a board identifier in a field that elsewhere holds silicon names, that the degradation already exists one link up in device_tree_model, and that device_chip_model = EdgeXpert (MS-C931) is the fallback firing rather than a bug.

Your point 5, agreed

You are right and I overstated it. detect_returns_all_required_fields passes on every CI runner regardless of this change, so it is not standing coverage. It is a local proof on one machine that the failure was real and that the patch clears it, nothing more. I should have said that.

dmi_chip_model_fallback still has no direct test. Adding an injection seam for the sysfs path to cover five lines seemed disproportionate, but say the word if you would rather have it.

Point 6 and the two out-of-scope notes

Will file all three as issues rather than widening this PR:

  1. The device detection failed for: device_chip_model hint pointing at --device-name / --device-form-factor, which live on auth set-device and do not override the chip model. Agreed that a diagnosed-but-unfixed error message stays wrong.
  2. No Linux CUDA runtime flavor for any architecture.
  3. max_memory_usage gated to the linux-*-cpu flavors, so any Linux GPU host silently cannot run that benchmark.

Will link them here once opened.

@ankitanand3

Copy link
Copy Markdown
Contributor Author

Filed the three as promised:

Comment thread crates/pipette-device/src/probe.rs Outdated
Comment on lines +241 to +242
/// DGX Spark class boards, where `/proc/cpuinfo` exposes only raw MIDR
/// fields and no device tree exists at all.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment says /proc/cpuinfo exposes the raw MIDR fields, and your PR summary lists CPU implementer: 0x41 and CPU part: 0xd85. Those fields identify the silicon, which is what device_chip_model holds on the other platforms. Did you consider a decode of the MIDR fields before the board name, and if so, what ruled it out?

Comment thread crates/pipette-device/src/probe.rs Outdated
Comment on lines +257 to +260
if DMI_PLACEHOLDERS.contains(&board.to_ascii_lowercase().as_str()) {
log::debug!("device_chip_model: ignoring DMI placeholder board_name {board:?}");
return None;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is a pure string comparison behind a sysfs read, so no test reaches it and a wrong entry in DMI_PLACEHOLDERS ships unnoticed. Extract fn is_dmi_placeholder(value: &str) -> bool behind #[cfg(any(target_os = "linux", test))], similar to the pattern parse_apple_thermal_state uses for testing. Then cover it with an rstest table that rejects Default string, To Be Filled By O.E.M., and Base Board Product Name and accepts EdgeXpert (MS-C931).

Comment thread crates/pipette-device/src/probe.rs Outdated
Comment on lines +638 to +647
const DMI_PLACEHOLDERS: [&str; 8] = [
"default string",
"to be filled by o.e.m.",
"to be filled by oem",
"system product name",
"system manufacturer",
"none",
"unknown",
"not applicable",
];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system product name and system manufacturer appear in product_name and sys_vendor, not in board_name, so those two entries never match here. The placeholders that firmware does write to board_name are absent, so a host that ships one records it as its permanent device_chip_model with no failure signal. Drop the two dead entries and add these board_name placeholders:

  • base board product name
  • type2 - board product name
  • not specified
  • n/a
  • undefined
  • not available

ykhrustalev and others added 4 commits September 24, 2026 15:10
`system product name` and `system manufacturer` are product_name and
sys_vendor placeholders, so they never matched board_name. The board_name
placeholders were missing, so a host shipping one would have recorded it as
its permanent device_chip_model.

- Drop the two dead entries; add `base board product name`,
  `type2 - board product name`, `not specified`, `n/a`, `undefined` and
  `not available`.
- Extract is_dmi_placeholder() behind cfg(any(linux, test)) and cover it with
  an rstest table, so a wrong entry in the list fails a test instead of
  shipping.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
/proc/cpuinfo on GB10-class hosts carries CPU implementer / CPU part even
when it has no model name, and those fields identify the silicon, which is
what device_chip_model holds on every other platform. Decode them before
falling back to the board name.

- parse_cpuinfo_arm_cores() maps ARM Ltd (0x41) part numbers to core names
  using the util-linux lscpu table, so the names match lscpu. Heterogeneous
  layouts join distinct cores in order of first appearance
  (GB10: "Cortex-X925 + Cortex-A725").
- Any core that does not decode (another implementer, or a part newer than
  the table) yields None rather than a partial list, and detection moves on
  to the DMI board name.
- Placed after device_tree_model, so hosts that resolve today report the same
  value; it also covers ARM hosts with no DMI, which the board-name fallback
  cannot.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ykhrustalev
ykhrustalev merged commit d93700a into Liquid4All:main Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants