-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add GPU flag support for Docker provider #1
base: main
Are you sure you want to change the base?
Conversation
Here's a linux amd64 binary to save building one. kind-0.11.1-with-gpu-patch.zip |
Thanks for pushing this. i.e.:
But trying to adopt Kind as a testing kubernetes solution is not working for me. I can't get GPU passthrough following your steps:
Do you have any idea to progress on this setup? Thanks! |
UPDATE: I found out WSL2 setup is not supported for this case because the NVIDIA driver plugin and container runtime rely on the NVIDIA Management Library (NVML) which is not yet supported, as seen on this threads: |
Yeah I wrote this blog post on Running Kubeflow in Kind with GPUs, mainly to record the steps I took to get things running on my linux workstation. But yeah I can imagine Windows being more challenging. |
thanks @jacobtomlinson 👍 👍 do you plan to open a PR direclty on kind repo ? |
@raphaelauv It's on my wishlist but I'm not sure I'll ever get to it. It seems folks have previously made PRs and tried to get the |
Okay I see , thanks for your time 👍 I will make a try of your solution soon |
reference: - jacobtomlinson/kind#1 - https://jacobtomlinson.dev/posts/2022/quick-hack-adding-gpu-support-to-kind/ Creating log: $ ../kind/bin/kind create cluster --config kind-gpu.yml Creating cluster "gpu-test" ... ✓ Ensuring node image (kindest/node:v1.23.1) 🖼 ✓ Preparing nodes 📦 ✓ Writing configuration 📜 ✓ Starting control-plane 🕹️ ✓ Installing CNI 🔌 ✓ Installing StorageClass 💾 Set kubectl context to "kind-gpu-test" You can now use your cluster with: kubectl cluster-info --context kind-gpu-test Have a nice day! 👋
Just updated this PR with the latest code from upstream. Still, no intention to make this a real PR, but at least it is up to date for now. |
FYI: the discussion for adding GPU support has been re-opened here and seems to be progressing, your PR was referenced in the conversation: Here is a WIP PR coming from that discussion for anyone interested: |
Please see kubernetes-sigs#3257 (comment) for a discussion on how to enable GPU support today without any patched needed to |
I follow the blog and meet some problems.
run
It seens kind node loss nvidia runtime. After entering the kind node image and found that it use containerd instead of docker and loss nvidia-container-runtime. |
BTW, it's also necessary to add |
Did you try following the instructions linked in the comment just above yours? They supercede the need for this patch: |
|
Awesome job! Looking forward to this feature. |
Adds a
gpus
node config option which in turn passes the--gpus=all
flag to Docker. This approach was already rejected in kubernetes-sigs#1886 but it looks like that PR got force pushed with a more generic implementation that was also rejected. I wanted to have a go at implementing this feature quickly myself for my own use.I don't intend on trying to get this merged upstream right now as I don't have time to go off on this tangent, but wanted to put this here in case it inspires someone else to do so.
Demo
Enable GPUs in cluster spec.
Create cluster.
$ ./bin/kind create cluster --config kind-gpu.yaml
Install NVIDIA operator (but skip driver install as it should already be installed).
Test scheduling a pod.
$ kubectl apply --context kind-gpu-test -f gpu-pod.yaml
Check the pod logs.