NVIDIA / kubevirt-gpu-device-plugin

NVIDIA k8s device plugin for Kubevirt
BSD 3-Clause "New" or "Revised" License
220 stars 66 forks source link

allocate GPUs to vm or pod in the same node? #52

Open caohuilong opened 2 years ago

caohuilong commented 2 years ago

Can i use kubevirt-gpu-device-plugin to allocate GPUs to Kubevirt VMs and use k8s-device-plugin to allocate GPUs to my container workloads in the same node?

rthallisey commented 2 years ago

It's a good question. I haven't tried it, but my guess is that they will both fight for the resources and allocation will fail.

caohuilong commented 2 years ago

It's a good question. I haven't tried it, but my guess is that they will both fight for the resources and allocation will fail.

I have tried it. It can work but needs lots of manual operations to change the GPU device driver from nvidia to vfio-pci or from vfio-pci to nvidia in the node.

Vigilans commented 1 month ago

Hi @caohuilong , I am also looking into this issue and is quite interested in allocating gpu to VM or pod in the same node. Could you share your setup about how to do the nvidia <-> vfio-pci driver switch? I wonder if a plugin in kubernetes could be made to make this process automatic.