Skip to content

Add support to docker runtime for OCI access to NVIDIA GPUs #20959

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
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

aaron-nall
Copy link

fixes #20597

Adds support for OCI interface to NVIDIA GPUS with a new valid --gpus option "nvidia.com".

Copy link

linux-foundation-easycla bot commented Jun 22, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 22, 2025
@k8s-ci-robot k8s-ci-robot requested review from medyagh and prezha June 22, 2025 21:16
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aaron-nall
Once this PR has been reviewed and has the lgtm label, please assign medyagh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

Welcome @aaron-nall!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @aaron-nall. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 22, 2025
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@medyagh
Copy link
Member

medyagh commented Jun 23, 2025

@aaron-nall can you plz help me undrestand this PR more ? maybe a Before/After this PR ? what exactly is being enabled in this PR ? what couldn't have been done before it ?

and also I think if you do --gpus=all it will automatically enable the addon and not needed to specifiy it

@medyagh
Copy link
Member

medyagh commented Jun 30, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 30, 2025
@ComradeProgrammer
Copy link
Member

containers/podman#21156 I think it is related to this pr

@minikube-pr-bot

This comment has been minimized.

@aronahl
Copy link

aronahl commented Jul 2, 2025

@aaron-nall can you plz help me undrestand this PR more ? maybe a Before/After this PR ? what exactly is being enabled in this PR ? what couldn't have been done before it ?

and also I think if you do --gpus=all it will automatically enable the addon and not needed to specifiy it

If CDI Devices are enabled for dockerd, at least in the latest stable NixOS release, the --gpus=all flag has been replaced with --device=nvidia.com/gpu=all.

The dockerd feature is listed as experimental, but it seems to be the only way to access Nvidia GPUs in current NixOS docker installs.

@medyagh
Copy link
Member

medyagh commented Jul 2, 2025

@aaron-nall can you plz fix the unit test

"make test"

--- FAIL: TestValidateGPUs (0.00s)
start_test.go:830: validateGPUs(cat, docker, docker) = "The gpus flag must be passed a value of "nvidia", "nvidia.com", "amd" or "all""; want = "The gpus flag must be passed a value of "nvidia", "amd" or "all""
FAIL

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20959) |
+----------------+----------+---------------------+
| minikube start | 50.7s    | 50.8s               |
| enable ingress | 15.4s    | 14.9s               |
+----------------+----------+---------------------+

Times for minikube start: 50.5s 51.3s 53.8s 49.9s 48.2s
Times for minikube (PR 20959) start: 51.8s 49.1s 53.3s 49.7s 50.3s

Times for minikube ingress: 16.1s 15.5s 16.0s 15.0s 14.5s
Times for minikube (PR 20959) ingress: 14.5s 14.5s 15.0s 15.5s 15.0s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20959) |
+----------------+----------+---------------------+
| minikube start | 23.9s    | 23.1s               |
| enable ingress | 12.6s    | 12.8s               |
+----------------+----------+---------------------+

Times for minikube ingress: 12.8s 12.3s 13.3s 12.3s 12.3s
Times for minikube (PR 20959) ingress: 13.8s 12.3s 13.3s 13.3s 11.3s

Times for minikube start: 22.5s 25.6s 24.1s 24.9s 22.6s
Times for minikube (PR 20959) start: 23.0s 23.1s 22.4s 23.0s 23.8s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 20959) |
+----------------+----------+---------------------+
| minikube start | 22.6s    | 23.0s               |
| enable ingress | 29.7s    | 23.2s               |
+----------------+----------+---------------------+

Times for minikube (PR 20959) start: 22.4s 22.0s 23.4s 24.3s 23.0s
Times for minikube start: 24.2s 21.6s 23.1s 21.9s 22.4s

Times for minikube ingress: 24.3s 38.8s 22.8s 22.8s 39.8s
Times for minikube (PR 20959) ingress: 23.3s 22.8s 23.3s 23.8s 22.8s

@medyagh
Copy link
Member

medyagh commented Jul 9, 2025

/retest-this-please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support option --device=nvidia.com/gpu=all for nixos
7 participants