Repository navigation
feat(cli): name the card for berth hold and berth vfio run - #271
Merged
Merged
Conversation
On a node with several cards, berth hold and berth vfio run always took the first one. Both now take --gpu, the same card names and PCI addresses berth run takes. hold accepts a comma list for one hold on several cards. vfio run takes one card, refuses a list, and reads the named card's nvidia-smi index from berthd's status narrowed to that card. Without --gpu, both take the first card as before.
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.
On a node with several cards,
berth holdandberth vfio runalways took the first card. A game ongpu1or a passthrough of the second card had no way to name its card. Both commands now take--gpu, with the same valuesberth run --gputakes.Changes
berth hold --gpu CARDsends the card on the acquire. berthd already routes an acquire to the broker of each card it names. A comma list holds several cards under one lease.berth vfio run --gpu CARDtakes one card and refuses a comma list. It narrows berthd's status to that card withnode.Viewbefore it reads the card's nvidia-smi index, so the preflight, the opener check and the wait for the card to come back all use the named card. A card berthd does not schedule is refused before any hold is asked.--gpu, both commands take the first card, as before.docs/leasing.md,docs/vfio.md, the skill table and the CHANGELOG[Unreleased]section are updated.Tests
The tests run against a real berthd with one broker per card (
serveNode, factored out ofstartNode):TestHoldTakesTheCardItNameschecks--gpu gpu1,--gpu gpu0,gpu2and no flag on a three-card node. Each card is held or left alone as expected.TestHoldRefusesABadGPUandTestHoldRefusesACardTheNodeLackscover a malformed name andgpu7.TestVfioRunTakesTheCardItNamesuses an nvidia-smi stub that answers index 0 with a different card. With--gpu gpu1the hold lands on gpu1 only, and the run finishes with the card back.TestVfioRunRefusesSeveralCardsOrOneTheNodeLackscovers a comma list andgpu7.I checked each test against a broken build. Dropping
Cardfrom the hold acquire, dropping it from the vfio acquire, and skipping the status narrowing each fail the matching test.Full proof:
go build,gofmt,go vet, the Windows build and vet,golangci-lint(0 issues) andgo test ./..., all green. Against the live berthd on a one-card host,hold --gpu gpu7andvfio run --gpu gpu7are refused with nothing drained. The two-card path is tested only against the in-process berthd, because no multi-card host was available.