Match device driver on name and ignore capabilities#50717
Merged
thaJeztah merged 1 commit intomoby:masterfrom Aug 14, 2025
Merged
Match device driver on name and ignore capabilities#50717thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah merged 1 commit intomoby:masterfrom
Conversation
702bbb7 to
80f1b0b
Compare
elezar
commented
Aug 13, 2025
daemon/devices.go
Outdated
| "driver": req.Driver, | ||
| "capabilities": req.Capabilities, | ||
| }).Debugf("Selecting device driver by driver name; possibly ignoring capabilities") | ||
| return dd.updateSpec(spec, &deviceInstance{req: req}) |
Contributor
Author
There was a problem hiding this comment.
@thaJeztah I moved this over from #50099 since I think it may be easier to reason about as a standalone change following the discussion in #50099 (comment).
This change ignores requested capabilities when a driver is explicitly requested. This simplifies the logic for selecting a driver and means that users need not spefify redundant capabilities. With the exception of the catch-all "gpu" capability the remaining capabilities are only relevant for the "nvidia" driver. Signed-off-by: Evan Lezar <elezar@nvidia.com>
80f1b0b to
4803834
Compare
This was referenced Aug 14, 2025
vvoland
approved these changes
Aug 14, 2025
| "requested": req.Capabilities, | ||
| "selected": selected, | ||
| }, | ||
| }).Debugf("Selecting device driver by driver name; possibly ignoring capabilities") |
Contributor
There was a problem hiding this comment.
nit:
Suggested change
| }).Debugf("Selecting device driver by driver name; possibly ignoring capabilities") | |
| }).Debug("Selecting device driver by driver name; possibly ignoring capabilities") |
Merged
This was referenced Sep 5, 2025
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.
This change ignores requested capabilities when a driver is explicitly requested. This simplifies the logic for selecting a driver and means that users need not spefify redundant capabilities. This aligns the behaviour for all drivers with the CDI driver.
With the exception of the catch-all "gpu" capability the remaining capabilities are only relevant for the "nvidia" driver.
See also the discussion in #50099
- What I did
Changed the logic for selecting a device driver to ignore capabilities when selecting a driver by name. If no driver name is specified, the current behaviour remains and an appropriate driver is selected based on the set of required capabilities.
- How I did it
Updated the
handleDeviceimplementation- How to verify it
When running a modified daemon in debug mode on a system with
nvidiadevices (and therefore annvidiadriver registered):Check the logs:
Check the logs:
Check the logs
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)