Skip to content

feat(vm): configure gpu settings through gateway vm config#1581

Draft
cheese-head wants to merge 3 commits into
NVIDIA:mainfrom
cheese-head:feat/vm-driver-gateway-config
Draft

feat(vm): configure gpu settings through gateway vm config#1581
cheese-head wants to merge 3 commits into
NVIDIA:mainfrom
cheese-head:feat/vm-driver-gateway-config

Conversation

@cheese-head
Copy link
Copy Markdown

Summary

Extends the gateway VM driver config so [openshell.drivers.vm] can express the existing GPU enablement and GPU sizing knobs. The gateway now resolves those VM settings and passes explicit arguments to the openshell-driver-vm subprocess, keeping VM configuration in the gateway TOML flow.

Related Issue

N/A

Changes

  • Added gpu_enabled, gpu_mem_mib, and gpu_vcpus to VmComputeConfig.
  • Passed resolved GPU VM settings from the gateway to the VM driver subprocess.
  • Preserved legacy OPENSHELL_VM_* environment overrides when spawning the VM driver, while preventing the child process from re-reading stale config env values.
  • Added VM config and subprocess argv tests.
  • Updated the gateway config reference MicroVM example.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Manual verification run:

cargo fmt -p openshell-server
cargo test -p openshell-server vm_
cargo clippy -p openshell-server --all-targets -- -D warnings
cargo test -p openshell-server
git diff --check

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Signed-off-by: Patrick Riel <priel@nvidia.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 26, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Patrick Riel <priel@nvidia.com>
Comment on lines +238 to +240
vcpus = 2
mem_mib = 2048
overlay_disk_mib = 4096
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do these need their own section?

Comment thread crates/openshell-server/src/compute/vm.rs
Comment on lines 227 to 229
guest_tls_ca = "/var/lib/openshell/guest-tls/ca.pem"
guest_tls_cert = "/var/lib/openshell/guest-tls/client.pem"
guest_tls_key = "/var/lib/openshell/guest-tls/client-key.pem"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these setting VM-specific given the guest_ prefix?

Comment thread docs/reference/gateway-config.mdx Outdated
vcpus = 2
mem_mib = 2048
krun_log_level = 1
bootstrap_image = ""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does an empty image imply? Should we add a comment?

Comment thread docs/reference/gateway-config.mdx Outdated
mem_mib = 2048
krun_log_level = 1
bootstrap_image = ""
krun_log_level = 1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Out of scope for this change, but why is this not just log_level?

Signed-off-by: Patrick Riel <priel@nvidia.com>
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