Skip to content

Comments

fix entitlements handling for OnDemand CDI devices#5867

Merged
tonistiigi merged 1 commit intomoby:masterfrom
crazy-max:fix-cdi-entitlement
Mar 24, 2025
Merged

fix entitlements handling for OnDemand CDI devices#5867
tonistiigi merged 1 commit intomoby:masterfrom
crazy-max:fix-cdi-entitlement

Conversation

@crazy-max
Copy link
Member

@crazy-max crazy-max commented Mar 21, 2025

OnDemand devices are never allowed with current entitlements validation logic. That's because this kind of device is not yet registered in CDI cache at this point.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max added this to the v0.20.2 milestone Mar 21, 2025
@crazy-max crazy-max requested a review from tonistiigi March 21, 2025 09:11
@crazy-max crazy-max marked this pull request as ready for review March 21, 2025 09:11
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, I'm looking at implementation of FindDevices, is the problem that it is calling m.cache.ListDevices instead of m.ListDevices that adds the ondemand setups?

Additionally, does this have any restrictions with device name, eg. nvidia.com/gpu vs nvidia.com/gpu=all?

@crazy-max
Copy link
Member Author

Alternatively, I'm looking at implementation of FindDevices, is the problem that it is calling m.cache.ListDevices instead of m.ListDevices that adds the ondemand setups?

Yes that's it but with FindDevices we expect actual registered/mounted devices to be returned.

Additionally, does this have any restrictions with device name, eg. nvidia.com/gpu vs nvidia.com/gpu=all?

If no name is specified like nvidia.com/gpu it would return the first device registered such as nvidia.com/gpu=all but would fail for an OnDemand device as nothing is yet registered.

@crazy-max crazy-max removed this from the v0.20.2 milestone Mar 24, 2025
@tonistiigi
Copy link
Member

If no name is specified like nvidia.com/gpu it would return the first device registered such as nvidia.com/gpu=all but would fail for an OnDemand device as nothing is yet registered.

We should make it so the nvidia installer also adds =all and =0 (theoretically, we could also detect multi-gpu in Setup but not a high priority).

@tonistiigi tonistiigi merged commit 5aba36b into moby:master Mar 24, 2025
109 checks passed
@crazy-max crazy-max deleted the fix-cdi-entitlement branch April 9, 2025 11:10
@crazy-max crazy-max added this to the v0.21.0 milestone Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants