VM GPU Passthrough crashing when installing driver

Grub:

GRUB_CMDLINE_LINUX_DEFAULT=“initcall_blacklist=sysfb_init intel_iommu=on video=vesafb:off video=efifb:off video=simplefb:off kvm.ignore_msrs=1”
GRUB_CMDLINE_LINUX=“nomodeset iommu=pt console=tty0”

/etc/modules

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

/etc/modprobe.d/vfio.conf

blacklist i915
options vfio-pci ids=8086:016a

dmesg | grep -e DMAR -e IOMMU

0.079664] DMAR: IOMMU enabled
DMAR: Intel(R) Virtualization Technology for Directed I/O

dmesg | grep ‘remapping’

[ 0.191562] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.192029] DMAR-IR: Enabled IRQ remapping in x2apic mode

dmesg | grep -i vfio

[ 0.509629] VFIO - User Level meta-driver version: 0.3
[ 103.293381] vfio-pci 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[ 205.210820] vfio-pci 0000:00:02.0: Relaying device request to user (#0)
[ 206.205934] vfio-pci 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem

lspci -nn

00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v2/Ivy Bridge DRAM Controller [8086:0158] (rev 09)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port [8086:0151] (rev 09)
00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller [8086:016a] (rev 09)
00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)

The driver is not in use by the kernel:

00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller [8086:016a] (rev 09)
DeviceName: Onboard IGD
Subsystem: ASUSTeK Computer Inc. Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller [1043:84ca]
Kernel modules: i915

The problem:
The graphicscard (Intel IGP) is present in the LXD VM. When I try to install the intel driver, the vm turns off hard (critical shutdown in event viewer). dmesg is not showing special errors, so I need some help. I can’t get this working.

LXD version:
5.0/stable/ubuntu-22.04
OS:
Ubuntu 22.04 5.15.0-91-generic
CPU:
Intel(R) Xeon(R) CPU E3-1245 V2
VM OS:
Windows 10 Pro (default VM, no special configs)

Command to add GPU to windows VM:
lxc config device add win10 gpu gpu gputype=physical pci=00:02.0

When I try to install the intel driver, the vm turns off hard (critical shutdown in event viewer).

As well as you have Windows inside the VM it’s a bit problematic to debug, because Windows is a proprietary closed-source software. I personally can only suggest you to try to get more info from:

And I believe that it’s a good option here to reproduce the same setup but with Linux inside the VM. Just to be sure that with the Linux-based OS, GPU pass-through works well for you and if not, then we can debug it on the Linux at first place and then get back to Windows.

1 Like

Also, when you’ll have a reproducer on a Linux VM, could you try to test it with different version of your Intel IGPU (just to see if some drivers are instable or if its unrelated) ? Also, something worth checking is the resources allocated to the VM. Ensure it has enough RAM and CPU resources. Sometimes, a driver update might require more resources temporarily, causing issues if the VM is near its limits.