Skip to content

fix(vmm): restrict listed GPUs to the node's offered devices - #1346

Merged
kvinwang merged 1 commit into
nextfrom
fix/vmm-listed-gpu-policy
Sep 24, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/vmm-listed-gpu-policy

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Problem

With attach_mode = "listed", resolve_gpus copies each requested slot straight into -device vfio-pci,host={slot} without checking cvm.gpu.listing / include / exclude. Any host PCI device is attachable, including one the operator excluded or a non-GPU, and the slot string is never validated (QEMU treats , and = as option separators).

Fix

resolve_gpus_with_config rejects a listed slot that is not in GpuConfig::list_devices() — the same set ListGpus returns to the web UI picker. Applies to both CreateVm and UpdateVm.

Compat: the web UI can only pick offered slots, so it is unaffected; vmm-cli --gpu requests naming an unoffered slot are now rejected. Costs one lspci per listed-GPU request.

Split out of #1286.

Verification

cargo test -p dstack-vmm (210 passed), cargo clippy -p dstack-vmm --bins -- -D warnings, cargo fmt --check.

@kvinwang
kvinwang merged commit 219a203 into next Sep 24, 2026
11 checks passed
@kvinwang
kvinwang deleted the fix/vmm-listed-gpu-policy branch September 24, 2026 05:36
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.

1 participant