kubevirt-gpu-device-plugin: The virtual machine cannot use the GPU

Hello, I want to connect my GPU directly to the virtual machine in my kubevirt through the current method, but when I create the virtual machine, I was prompted by describe vmi:

Events:
  Type     Reason            Age                 From                       Message
  ----     ------            ----                ----                       -------
  Normal   SuccessfulCreate  6m6s                virtualmachine-controller  Created virtual machine pod virt-launcher-vmi-gpu-n4lh7
  Warning  SyncFailed        117s                virt-handler, k8s-master   server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:15:38.830552Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"
  Warning  SyncFailed        117s                virt-handler, k8s-master   server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:15:39.372653Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"
  Warning  SyncFailed        117s                virt-handler, k8s-master   server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:15:39.745594Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"
  Warning  SyncFailed        116s                virt-handler, k8s-master   server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:15:40.131267Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"
  Warning  SyncFailed        116s                virt-handler, k8s-master   server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:15:40.514658Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"
  Warning  SyncFailed        115s                virt-handler, k8s-master   server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:15:40.843721Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"
  Warning  SyncFailed        115s                virt-handler, k8s-master   server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:15:41.185059Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"
  Warning  SyncFailed        115s                virt-handler, k8s-master   server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:15:41.521218Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"
  Warning  SyncFailed        114s                virt-handler, k8s-master   server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:15:42.421670Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"
  Warning  SyncFailed        34s (x6 over 114s)  virt-handler, k8s-master   (combined from similar events): server error. command SyncVMI failed: "LibvirtError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2021-11-02T02:17:02.182163Z qemu-kvm: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.6,addr=0x0: vfio 0000:01:00.0: group 1 is not viable\nPlease ensure all devices within the iommu_group are bound to their vfio bus driver.')"

The GPU resource pool is as follows:

$ kubectl get node k8s-master -o json | jq '.status.allocatable'
{
  "cpu": "8",
  "devices.kubevirt.io/kvm": "110",
  "devices.kubevirt.io/tun": "110",
  "devices.kubevirt.io/vhost-net": "110",
  "ephemeral-storage": "891766110780",
  "hugepages-1Gi": "0",
  "hugepages-2Mi": "0",
  "memory": "16338732Ki",
  "nvidia.com/GM107M_GeForce_GTX_860M": "1",
  "pods": "110"
}

What I understand is this, you can use the GPU directly, or you can create a VGPU, and I am currently using the GPU, do I need other configurations?

About this issue

Most upvoted comments

Hello, through the settings here, the virtual machine has been successfully started, but there are currently two problems:

@newhuangchuan what did you do to start the VM? I’m hitting the same issue… Hello, I am here to unbind the graphics card from the host, and then change the graphics card driver to vfio-pci

$ modprobe pci_stub

$ echo "10de 1b80" > /sys/bus/pci/drivers/pci-stub/new_id

$ echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind

$ echo 0000:01:00.0 > /sys/bus/pci/drivers/pci-stub/bind

$ echo "10de 10f0" > /sys/bus/pci/drivers/pci-stub/new_id

$ echo 0000:01:00.1 > /sys/bus/pci/devices/0000:01:00.1/driver/unbind

$ echo 0000:01:00.1 > /sys/bus/pci/drivers/pci-stub/bind

Sorry for replying to you now, I hope it will be useful to you