-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
container-runtime: add nvidia-docker #15927
Conversation
Welcome @d4l3k! |
Hi @d4l3k. 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 Once the patch is verified, the new status will be reflected by the 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/test-infra repository. |
Can one of the admins verify this patch? |
I just signed the CLA, hasn't updated yet though |
@sharifelgamal when you get a chance could you take a look at this PR? I'm also wondering if you have any suggestions on how to handle the nvidia dependencies. I assume it doesn't make sense to add them to kicbase? Also the libnvidia-ml needs to match the host. We could try and grab it at runtime and overlay it in the container but that's pretty hacky. For my use case, right now building an custom kicbase is an acceptable step so this PR is sufficient Thanks! |
The nvidia
|
PR needs rebase. 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/test-infra repository. |
What's left here? Merging this would be great! |
@d4l3k sorry for the long delay in PR review, I would llke to know how this PR is different from nivdia addon ? can nvidia addon be enabled with this PR as well ? also I would like you to contribute the kicbase changes as well so we could test it too |
Kvm requires the GPU to use pcie pass through to the underlying VM. This PR instead makes the gpu device available with the host gpu driver so it can be shared between the host and minikube workers |
Hi @d4l3k, I tried your example and it seems to work. Is there a way I can confirm that the pods have access to the GPUs? I tried using TensorFlow but was getting:
|
@spowelljr do you have access to the I was testing this with TorchX https://pytorch.org/torchx/latest/quickstart.html but that requires some familiarity with pytorch to get started |
I wonder if there's other better options here as well via some of the other runtimes that might be easier to integrate https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuration |
I tried getting I see examples like this (https://jacobtomlinson.dev/posts/2022/how-to-check-your-nvidia-driver-and-cuda-version-in-kubernetes/) But when I try I tried installing the nvidia driver in a pod but got I'm new to running GPUs and AI/ML workloads in Kubernetes, so I'm welcome to any tips you may have |
@spowelljr have you tried getting nvidia-smi to work under just |
@d4l3k I was able to get
Then I was able to use your PR to start minikube |
Ahh nice! That makes sense, need it installed on the host to mount it and also need to set a Docker flags |
/ok-to-test |
This comment has been minimized.
This comment has been minimized.
@d4l3k If the tests look good I'll merge this PR. I'm working on a follow up PR that will make this work via a flag when starting minikube. I've discovered that I was able to get it to work without |
@spowelljr thanks for pushing this through! Looks good to me :) As for the It may also be nvidia-container-toolkit takes care of it now and it's no longer necessary |
This comment has been minimized.
This comment has been minimized.
/retest-this-please |
kvm2 driver with docker runtime
Times for minikube (PR 15927) start: 50.2s 50.6s 51.7s 49.5s 49.6s Times for minikube ingress: 27.7s 28.1s 27.7s 28.6s 28.2s docker driver with docker runtime
Times for minikube start: 24.4s 23.3s 21.6s 21.1s 21.8s Times for minikube (PR 15927) ingress: 20.8s 20.8s 20.8s 20.8s 20.8s docker driver with containerd runtime
Times for minikube start: 20.9s 21.1s 20.6s 24.1s 23.2s Times for minikube ingress: 27.4s 49.4s 31.3s 31.3s 31.3s |
These are the flake rates of all failed tests.
To see the flake rates of all tests by environment, click here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: d4l3k, spowelljr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This adds a new container-runtime that sets the correct configuration options for using with https://github.com/NVIDIA/k8s-device-plugin#nvidia-device-plugin-for-kubernetes
This requires a custom Dockerfile with
nvidia-container-toolkit
and a matchinglibnvidia-ml.so.1
file. The driver version on the host needs to exactly match the version of nvml in the container.kicbase Dockerfile
Commands to run:
Related issue #10229