-
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
19 commits
Select commit
Hold shift + click to select a range
dff3ab0
Generalize vGPU device lifecycle
yummybomb fa63399
Harden vGPU lifecycle compatibility
yummybomb 44fce57
Validate unsupported vGPU frameworks on Darwin
yummybomb a378a7b
Reduce vGPU refactor diff noise
yummybomb 9fd861f
Leave vGPU hypervisor selection to callers
yummybomb 50495ee
Require qemu for vGPU instances
yummybomb 709e270
Preserve vGPU hypervisor support
yummybomb f33f0bc
Track VF allocation with a single field
yummybomb 66b64cf
Update vGPU lifecycle comments
yummybomb 271cec8
Drop the dead mdev branch from QEMU PCI passthrough args
yummybomb e7c5adc
Fix Darwin vGPU build
yummybomb b32872f
Preserve QEMU vGPU device ordering
yummybomb 5251369
Preserve mdev-era lifecycle semantics in the refactor
yummybomb a5349a9
Keep the mdev create error text in the refactor
yummybomb d461260
Restore mdev start error text
yummybomb 1aa9d91
Restrict vGPU instances to QEMU
yummybomb bc6d415
Preserve mdev hypervisor behavior
yummybomb f9060a3
Restore vGPU lifecycle log statements and spacing from the pre-refact…
yummybomb 40e61b2
Reject vGPU device path in microvm config validation
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,37 @@ | ||
| //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, framework VGPUFramework, devicePath, mdevUUID string) error { | ||
| if framework != VGPUFrameworkNone && framework != VGPUFrameworkMdev { | ||
| return fmt.Errorf("unknown vGPU framework %q", framework) | ||
| } | ||
| if mdevUUID == "" { | ||
| if devicePath == "" { | ||
| return nil | ||
| } | ||
| mdevUUID = filepath.Base(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.