Skip to content

govc: add GPU commands#3690

Merged
dougm merged 1 commit intovmware:mainfrom
benash:issue-3689
Feb 27, 2025
Merged

govc: add GPU commands#3690
dougm merged 1 commit intovmware:mainfrom
benash:issue-3689

Conversation

@benash
Copy link
Copy Markdown

@benash benash commented Feb 7, 2025

Description

This PR adds GPU management commands to the govc CLI tool, including:

  • govc gpu.host.info: Display GPU information for a host, including physical NVIDIA GPUs
  • govc gpu.host.profile.ls: List available vGPU profiles on a host
  • govc gpu.vm.add: Add vGPU to VM with specified profile
  • govc gpu.vm.info: Display GPU information for a VM
  • govc gpu.vm.remove: Remove all vGPUs from VM

Commands support standard and JSON formatting.

Closes: #3689

How Has This Been Tested?

  • We've done ad-hoc testing with NVIDIA A40 and L40 GPUs.
  • We've asked for guidance about modifying vcsim, so that it can be properly unit tested.

Guidelines

Please read and follow the CONTRIBUTION guidelines of this project.

@dougm
Copy link
Copy Markdown
Member

dougm commented Feb 11, 2025

Awesome, thanks @benash ! Will review this soon.
Regarding testing, with vcsim we have a Record + Playback feature. But, we have yet to make use of that within the govmomi repo.
The default vcsim templates are captured using govc collect, see the HostHardwareInfo for example. We could probably add something so the host has a GPU by default in vcsim, I'll try to take a look at that.

@benash benash force-pushed the issue-3689 branch 2 times, most recently from a7d137e to 631b62a Compare February 11, 2025 22:42
Signed-off-by: Benjamin Nash <bnash@nvidia.com>
@dougm dougm changed the title vcgo: add GPU commands govc: add GPU commands Feb 27, 2025
Copy link
Copy Markdown
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

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

Thanks again @benash , I pushed a small change to your branch:

  • fixed up commit message (s/vcgo/govc/)
  • small fix to gpu.vm.info (if vm == nil)
  • add gpu.bats (we can add more at some point with vcsim support)

@dougm dougm merged commit ce4961e into vmware:main Feb 27, 2025
12 checks passed
@benash benash deleted the issue-3689 branch March 12, 2025 13:41
@vmware vmware locked as resolved and limited conversation to collaborators Mar 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GPU Support to govc

2 participants