Report real vGPU capacity and preserve create failure causes - #383
Closed
yummybomb wants to merge 2 commits into
Closed
Report real vGPU capacity and preserve create failure causes#383yummybomb wants to merge 2 commits into
yummybomb wants to merge 2 commits into
Conversation
Counting every free VF advertising a type overreports concurrent capacity: sibling VFs share their parent GPU's framebuffer, so one 48Q assignment revokes the type from every other VF on that GPU. Bound each GPU's contribution by both its free VFs and how many times the profile framebuffer fits into the GPU's remaining framebuffer, using the largest still-creatable profile as a lower bound on what remains.
The vgpu_cleanup_pending response replaced the original create error with cleanup guidance, leaving the cause only in server logs. Prefix the message with the wrapped error so callers see why creation failed as well as how to recover.
-->
✱ stlc build✅ go code · compare
✅ typescript code · compare
Diagnostics: 💡 0 new / 5 total note
Build metadata
This comment is auto-generated by stlc and is kept up to date as you push. |
Contributor
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the two remaining findings from the vGPU stack review (#366 → #322 → #363 → #364 → #321). Based on the stack top so it can be folded into #364/#321 or merged after, same shape as #377.
1.
availablecounted candidate VFs, not concurrent capacity (#364)listProfilescounted every free VF advertising a type as one creatable instance. Sibling VFs share their parent GPU's framebuffer, so a single 48Q assignment revokes the type from every other VF on that GPU —/resourcesandgpuProfileSlotscould advertise dozens of slots where one per parent GPU exists, inviting placement bursts that mostly fail.listProfilesnow reports a conservative per-parent-GPU estimate: each GPU contributesmin(free VFs advertising the type, remaining framebuffer / profile framebuffer), using the largest profile still creatable on the GPU as a lower bound on its remaining framebuffer (the driver only advertises a type that fits). Unlike the earlier per-parent-GPU variant this doesn't collapse small profiles to 1 per GPU — a 48G GPU with free VFs still reports 24× 2Q — while large profiles stop being overcounted. Profiles with unparseable framebuffer fall back to the free-VF count. OpenAPI description and thehypeman_resources_gpu_profile_slotsmetric description updated to match (lib/oapi/oapi.goregenerated viamake oapi-generate).2.
vgpu_cleanup_pendinghid the original create failure (#321)Both retained and unretained messages replaced the create error with cleanup guidance; the cause survived only in server logs. The response message now leads with the wrapped error before the guidance.
InnerErroris unchanged (vgpu_retained_instance/vgpu_unretained_instancecode + instance ID) so programmatic recovery keeps working.Tests
TestVendorVFIOListProfilesReportsPerGPUCapacity— 3 free VFs across 2 GPUs: 48Q reports 2, 2Q reports 3.TestVendorVFIOListProfilesCapsCapacityByRemainingFramebuffer— GPU with a 24Q assigned: one more 24Q despite two free VFs; 1Q stays VF-capped.vgpu_cleanup_pendinghandler tests to assert the cause survives.go build ./...andgo test ./lib/devices ./lib/resourcespass;cmd/api/apiunit tests for the touched handler pass (the package's KVM/registry-dependent tests fail here on clean HEAD too).