Repository navigation
Conversation
ae0023e to
79ca0d3
Compare
|
Suggest joining guest and host telemetry by the PCIe Device Serial Number (DSN) instead of deriving the guest↔host BDF pairing in the VMM. Why. DSN is a hardware identity readable on both sides, so the join is observed rather than inferred from a bus-numbering rule (which this PR notes is not yet verified for out-of-order slots and Verified on hardware (8× H200 + 4× NVSwitch host, kernel 6.14, QEMU 9.2.1, one GPU passed through via
Minimal shape:
No VMM, host-api or sys-config change is needed. |
Signed-off-by: Leechael Yim <yanleech@gmail.com>
Signed-off-by: Leechael Yim <yanleech@gmail.com>
79ca0d3 to
ce186b0
Compare
|
Reworked to the DSN approach as suggested: the VMM parser, |
Problem
Guest GPU telemetry and host GPU telemetry cannot be joined.
00000000:01:00.0).Fix
Report each GPU's PCIe Device Serial Number (DSN). It is burned into the card and passes through VFIO unchanged, so the host reads the same value from the same card. Both sides label with it and join on it.
dstack-util gpu-inforeads/sys/bus/pci/devices/<bdf>/configfor each NVML device and walks the extended capabilities from0x100to the DSN (ID0x0003). It formats the 8 bytes aslspcidoes (xx-xx-…-xx).pci=nommconf, as on older images), leaves the field empty. A failed read is added to the card'serrors.GpuDevice.pci_dsn(field 12) carries it throughGpuInfo, so in-guest callers and the VMM'sProxiedGuestApi.GpuInforelay both see it./metricsgets a newdstack_gpu_info{index, uuid, pci_bus_id, pci_dsn} 1series. Existingdstack_gpu_*series keep their label set, so upgrading does not split their history. Join with* on(index) group_left(pci_dsn) dstack_gpu_info.Host-side collectors add the same
pci_dsnlabel from host sysfs (root needed). That lives outside this repo.Compatibility
#[serde(default)], so JSON from an older agent still parses with an emptypci_dsn.pci=nommconfcannot reach extended config space. They report an emptypci_dsnand get it after an image upgrade.GpuDevice { .. }without..Default::default()need the new field. The 2 such literals in this repo are updated.Verification
readreturns the same valuelspci -vvvprints for a device's Device Serial Number. A non-root read returns empty.cargo fmt --check,cargo check --workspace --all-features --tests,cargo clippy -D warningsandcargo testondstack-util,dstack-guest-agent,guest-api.