-
Notifications
You must be signed in to change notification settings - Fork 23
Abstract vGPU devices behind a framework dispatch #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ea411e1
Generalize vGPU device lifecycle
yummybomb 2dff253
Harden vGPU lifecycle compatibility
yummybomb 4baedcd
Validate unsupported vGPU frameworks on Darwin
yummybomb 9275f4e
Reduce vGPU refactor diff noise
yummybomb 186777b
Leave vGPU hypervisor selection to callers
yummybomb e5c825e
Require qemu for vGPU instances
yummybomb 04b7c41
Preserve vGPU hypervisor support
yummybomb ed53b5d
Track VF allocation with a single field
yummybomb ddd183a
Update vGPU lifecycle comments
yummybomb 8c804fb
Drop the dead mdev branch from QEMU PCI passthrough args
yummybomb 304eafd
Fix Darwin vGPU build
yummybomb 2598498
Preserve QEMU vGPU device ordering
yummybomb b7c3dc3
Preserve mdev-era lifecycle semantics in the refactor
yummybomb fe18ac4
Keep the mdev create error text in the refactor
yummybomb 1193d72
Restore mdev start error text
yummybomb c7ecbea
Restrict vGPU instances to QEMU
yummybomb 62caaf9
Preserve mdev hypervisor behavior
yummybomb 2cd2e2f
Restore vGPU lifecycle log statements and spacing from the pre-refact…
yummybomb f303670
Reject vGPU device path in microvm config validation
yummybomb 83ecf1a
Pass DestroyVGPU parameters as a VGPUAssignment struct
yummybomb 23d1722
Log vGPU device path instead of mdev UUID on stop and delete
yummybomb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| //go:build linux | ||
|
|
||
| package devices | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "path/filepath" | ||
| ) | ||
|
|
||
| func CreateVGPU(ctx context.Context, profileName, instanceID string) (*VGPUDevice, error) { | ||
| mdev, err := CreateMdev(ctx, profileName, instanceID) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return &VGPUDevice{ | ||
| Framework: VGPUFrameworkMdev, | ||
| VFAddress: mdev.VFAddress, | ||
| ProfileType: mdev.ProfileType, | ||
| ProfileName: mdev.ProfileName, | ||
| SysfsPath: mdev.SysfsPath, | ||
| MdevUUID: mdev.UUID, | ||
| }, nil | ||
| } | ||
|
|
||
| func DestroyVGPU(ctx context.Context, assignment VGPUAssignment) error { | ||
| if assignment.Framework != VGPUFrameworkNone && assignment.Framework != VGPUFrameworkMdev { | ||
| return fmt.Errorf("unknown vGPU framework %q", assignment.Framework) | ||
| } | ||
| mdevUUID := assignment.MdevUUID | ||
| if mdevUUID == "" { | ||
| if assignment.DevicePath == "" { | ||
| return nil | ||
| } | ||
| mdevUUID = filepath.Base(assignment.DevicePath) | ||
| } | ||
| return DestroyMdev(ctx, mdevUUID) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.