fix(core): emit every Linux DRM card regardless of vendor (#1997)
* fix(core): emit every Linux DRM card regardless of vendor
sample_gpus ended its vendor match with a wildcard `continue` and
get_gpu_info with a wildcard `None`, so a DRM card whose vendor is not
AMD or Intel — NVIDIA (0x10de, which detect_gpu_vendor already
recognizes) or an unrecognized vendor — never produced a GpuSample and
never appeared in the inventory. An adapter absent from the sample
stream has no name, no readings, and no entry in the GPU switcher, and
a row missing from the System Specifications sheet contradicts ADR
0016's "inventory of every detected adapter": the card reads as
nonexistent rather than unavailable.
Follow the Windows fix pattern (#1988, delivered in #1992): decouple
detection and emission from a provider's ability to read values. Every
detected card now resolves through resolve_card_identity, an
exhaustive vendor match, so a new GpuVendor variant is a compile error
instead of a silently dropped card. NVIDIA and unknown-vendor cards
are named from lspci by PCI BDF like the AMD path, with
"NVIDIA GPU (card{n})" / "GPU (card{n})" fallbacks, sampled with
source "DRM" and no values — the UI already renders the "no live
readings" state — and listed in the inventory with clock 0 and "N/A"
memory like the Intel entry. Live ids stay pci:<bdf> with drm:card<n>
fallback. No speculative NVIDIA reading providers are added; presence
is the claim.
Unit tests sit next to the helper; the Linux-only glue is
compile-verified by the ubuntu CI job.
Fixes #1989
* perf(core): cache the lspci listing for the process lifetime
Broadening the name prefetch to non-Intel vendors made sample_gpus fork
lspci at the 1 Hz monitor cadence on machines with an NVIDIA or
unknown-vendor card (and it already did on AMD machines) to re-read a
static adapter name. The monitor must not become the workload: fetch
once, cache success for the process lifetime, and let a failed run
retry on the next tick at no more than the uncached cost.
* fix(core): drop a needless as_deref on the cached lspci output
The cache changed lspci_output from Option<String> to
Option<&'static str>, making the as_deref in the sampling loop a
same-type deref that only the Linux build's clippy could see. S
shm committed
65c9d7b09bf72dbd4a5418f20e7618b96516e44a
Parent: 1bf6302
Committed by GitHub <noreply@github.com>
on 8/23/2026, 6:58:28 AM