Skip to content

vmm: return GPU reset errors from VM APIs - #1055

Closed
kvinwang wants to merge 1 commit into
nextfrom
fix/vmm-reset-api-error
Closed

vmm: return GPU reset errors from VM APIs#1055
kvinwang wants to merge 1 commit into
nextfrom
fix/vmm-reset-api-error

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Summary

  • flatten the full VM start error chain before crossing the pRPC boundary
  • apply the same behavior to both CreateVm and StartVm
  • add a regression test covering nested GPU reset errors

Motivation

GPU sanitization added in #1048 can fail before QEMU starts. Some pRPC transports preserve only the outer error's Display value, causing the actionable PCIe reset failure to be hidden behind a generic VM start error. Flattening the chain at the VMM API boundary ensures clients receive the complete diagnostic.

Tests

  • cargo fmt --all -- --check
  • cargo test -p dstack-vmm (117 passed)

Copilot AI lite review requested due to automatic review settings August 14, 2026 04:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves error diagnostics returned from the VMM’s pRPC VM lifecycle APIs by ensuring the full underlying error chain (not just the outer context) is preserved in the error string that crosses the RPC boundary, with a regression test focused on nested GPU reset/sanitization failures.

Changes:

  • Added an rpc_error helper to flatten an anyhow::Error chain into a single error message before returning it via RPC.
  • Applied the flattened error behavior to both CreateVm and StartVm API paths.
  • Added a unit test to validate that nested GPU sanitization errors remain visible in the returned error string.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +49 to +51
fn rpc_error(context: &str, error: anyhow::Error) -> anyhow::Error {
anyhow!("{context}: {error:#}")
}
@kvinwang

Copy link
Copy Markdown
Collaborator Author

Closing after verification: the existing pRPC error encoder already serializes the full anyhow error chain, including low-level GPU reset I/O errors such as Permission denied. The proposed flattening was therefore redundant.

@kvinwang kvinwang closed this Aug 14, 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.

2 participants