[BUG] HD P630 Use GVT-g+DMA-BUF on Windows Guest exceptionally get two monitors #233
Description
System:PVE 8.1.3
Kernel:Linux 6.5.11-7-pve
CPU:QL33 ( maybe is E3-1275 v6 ES)
iGPU: HD P630
The problem I'm having is that there should be only one monitor, but two appear in my VM and the resolution is locked at 800x600
The reason I think this is processor related is that the same VM works fine with GVT-g + DMA-BUF on my other device with 6700HQ processor (HD530).
Here's the VM running the same parameters on my other device
This is my linux startup parameters
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt pcie_acs_override=downstream,multifunction i915.enable_gvt=1 i915.enable_guc=0 video=efifb:off,vesafb:off drm.edid_firmware=edid/1024x768.bin"
Because I encountered the kernel: EDID block 0 is all zeroes error, I added "drm.edid_firmware=edid/1024x768.bin" in /etc/default/grub, and after that I encountered another error, but the relevance to my encounter is unclear.
I am sure that GVT-g is working, because it creates mdevs, but even if I add "display=on,x-igd-opregion=on" to the VM config file, I can't get DMA-BUF to work.
root@pve251:~# ls -la /sys/devices/pci0000:00/0000:00:02.0/mdev_supported_types
total 0
drwxr-xr-x 6 root root 0 Jan 4 16:06 .
drwxr-xr-x 11 root root 0 Jan 4 15:59 ..
drwxr-xr-x 3 root root 0 Jan 4 17:05 i915-GVTg_V5_1
drwxr-xr-x 3 root root 0 Jan 4 17:05 i915-GVTg_V5_2
drwxr-xr-x 3 root root 0 Jan 4 16:06 i915-GVTg_V5_4
drwxr-xr-x 3 root root 0 Jan 4 17:05 i915-GVTg_V5_8
[ 2947.316028] intel_vgpu_mdev df81aedb-05ed-4fee-9802-99e0e060c1e7: Adding to iommu group 33
.conf file contents
agent: 1
args: -cpu host,hypervisor=off,vmware-cpuid-freq=false,enforce=false,host-phys-bits=true -device vfio-pci-nohotplug,addr=0x02,sysfsdev=/sys/bus/mdev/devices/df81aedb-05ed-4fee-9802-99e0e060c1e7,x-igd-opregion=on,display=on,ramfb=on,xres=1920,yres=1080 -vnc unix:/var/run/qemu-server/104.vnc,password=on -display egl-headless,gl=core
balloon: 0
bios: ovmf
boot: order=scsi0
cores: 4
cpu: host
efidisk0: local:104/vm-104-disk-0.qcow2,efitype=4m,size=528K
hookscript: local:snippets/LTSC-2021.pl
localtime: 1
machine: pc-q35-8.1
memory: 8192
meta: creation-qemu=8.1.2,ctime=1704345388
name: LTSC-2
net0: virtio=BC:24:11:CB:06:4F,bridge=vmbr0
numa: 0
ostype: win10
scsi0: local:104/vm-104-disk-1.qcow2,iothread=1,size=80G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=ed540818-6aa0-4513-9066-59e2230a8ec1
sockets: 1
vga: none
vmgenid: 7d101ff1-89c1-4caa-a105-4518a7ffe837
Here are the parameters I used to start the VM
/usr/bin/kvm \
-id 104 \
-name 'LTSC-2,debug-threads=on' \
-no-shutdown \
-chardev 'socket,id=qmp,path=/var/run/qemu-server/104.qmp,server=on,wait=off' \
-mon 'chardev=qmp,mode=control' \
-chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5' \
-mon 'chardev=qmp-event,mode=control' \
-pidfile /var/run/qemu-server/104.pid \
-daemonize \
-smbios 'type=1,uuid=ed540818-6aa0-4513-9066-59e2230a8ec1' \
-drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE_4M.secboot.fd' \
-drive 'if=pflash,unit=1,id=drive-efidisk0,format=qcow2,file=/var/lib/vz/images/104/vm-104-disk-0.qcow2' \
-smp '4,sockets=1,cores=4,maxcpus=4' \
-nodefaults \
-boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
-vga none \
-nographic \
-cpu 'host,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vpindex,+kvm_pv_eoi,+kvm_pv_unhalt' \
-m 8192 \
-object 'iothread,id=iothread-virtioscsi0' \
-readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \
-device 'vmgenid,guid=7d101ff1-89c1-4caa-a105-4518a7ffe837' \
-device 'usb-tablet,id=tablet,bus=ehci.0,port=1' \
-chardev 'socket,path=/var/run/qemu-server/104.qga,server=on,wait=off,id=qga0' \
-device 'virtio-serial,id=qga0,bus=pci.0,addr=0x8' \
-device 'virtserialport,chardev=qga0,name=org.qemu.guest_agent.0' \
-iscsi 'initiator-name=iqn.1993-08.org.debian:01:8bf89e458fa' \
-device 'virtio-scsi-pci,id=virtioscsi0,bus=pci.3,addr=0x1,iothread=iothread-virtioscsi0' \
-drive 'file=/var/lib/vz/images/104/vm-104-disk-1.qcow2,if=none,id=drive-scsi0,format=qcow2,cache=none,aio=io_uring,detect-zeroes=on' \
-device 'scsi-hd,bus=virtioscsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,rotation_rate=1,bootindex=100' \
-netdev 'type=tap,id=net0,ifname=tap104i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' \
-device 'virtio-net-pci,mac=BC:24:11:CB:06:4F,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256' \
-rtc 'driftfix=slew,base=localtime' \
-machine 'hpet=off,type=pc-q35-8.1+pve0' \
-global 'kvm-pit.lost_tick_policy=discard' \
-cpu 'host,hypervisor=off,vmware-cpuid-freq=false,enforce=false,host-phys-bits=true,' \
-device 'vfio-pci-nohotplug,addr=0x02,sysfsdev=/sys/bus/mdev/devices/df81aedb-05ed-4fee-9802-99e0e060c1e7,x-igd-opregion=on,display=on,ramfb=on,xres=1920,yres=1080' \
-vnc 'unix:/var/run/qemu-server/104.vnc,password=on' \
-display 'egl-headless,gl=core'
Information about the version of kvmgt
root@pve251:~# modinfo kvmgt
filename: /lib/modules/6.5.11-7-pve/kernel/drivers/gpu/drm/i915/kvmgt.ko
author: Intel Corporation
license: GPL and additional rights
import_ns: I915_GVT
import_ns: DMA_BUF
srcversion: C484DE61848F8648DB83E14
depends: i915,kvm,vfio,drm,mdev
retpoline: Y
intree: Y
name: kvmgt
vermagic: 6.5.11-7-pve SMP preempt mod_unload modversions
sig_id: PKCS#7
signer: Build time autogenerated kernel key
sig_key: 20:4A:0E:D5:14:C1:A2:98:9F:09:1A:F3:63:B7:A4:F3:FD:A6:88:6A
sig_hashalgo: sha512
signature: 8A:70:A4:E9:CA:3B:BC:8E:DE:12:B1:B3:A1:3D:B7:62:5B:F1:86:7A:
1F:28:C6:C1:B2:BB:67:9A:65:33:DC:72:7D:8D:D9:55:BB:D2:CE:77:
13:4B:34:D3:9B:51:98:9E:7A:F7:9B:EF:04:AC:97:D8:22:A3:8B:AB:
35:AB:5F:0A:52:5D:F4:FE:BD:D0:19:DF:81:E0:04:30:A6:1B:EC:11:
53:34:1C:2B:97:F7:21:40:F5:54:0C:7E:AE:30:A2:A1:9D:82:4B:E2:
B4:03:12:A5:D7:19:19:01:C8:F8:A8:95:35:95:81:AE:96:4E:73:F2:
BA:88:88:44:40:B1:97:B3:68:75:D1:C3:C1:2E:C3:DB:96:0F:1D:53:
82:D0:35:BB:E4:6E:CE:9C:CF:B0:66:54:99:E9:34:90:EC:84:03:DA:
1D:40:60:0E:45:24:01:FA:C8:FE:C1:0E:0F:BA:CD:EF:B6:24:D2:6D:
5E:5A:35:30:41:1D:57:17:3A:01:5F:61:E2:F0:20:88:D6:36:36:C2:
93:3A:ED:BB:4A:42:BF:22:AF:10:C2:97:46:16:DA:E2:6C:76:C3:9C:
56:00:25:64:7D:0B:93:99:C2:19:5E:D0:16:DF:3C:9D:F2:D3:BF:3B:
7F:3E:84:1A:ED:E5:06:51:59:8F:95:FF:A3:85:A0:71:1B:88:37:C7:
1A:A8:2D:91:6D:C4:6C:72:AE:71:CF:77:A6:AF:75:45:95:C0:C6:67:
1A:69:04:61:82:70:97:B4:48:50:24:17:B4:CE:73:43:BD:D9:E3:C2:
4D:1A:CD:1B:32:B2:4B:03:4A:0D:C6:90:50:31:5F:85:7F:9A:49:1C:
C8:1B:AB:A1:1F:0D:03:25:C7:FC:97:2D:64:7B:4F:41:FC:4B:E3:3F:
3C:F8:85:86:A2:F2:21:01:9B:E3:5D:8F:F1:8A:1B:FE:FF:64:72:E8:
98:BA:11:DB:0A:40:D1:91:3A:9E:80:E0:0D:FF:EA:38:2C:CD:34:89:
BC:88:89:CF:62:A5:E5:D7:19:64:55:25:CC:DF:C6:40:82:B6:9D:BB:
B3:D5:C5:6C:B3:47:0B:8F:EA:00:79:BB:FD:37:2B:92:79:A8:3E:98:
04:39:53:AC:06:64:1D:4C:70:5D:AB:94:69:4D:FD:5A:4B:97:24:BC:
C1:DC:E7:F0:55:2A:93:D5:D8:90:6C:A8:9E:C4:AD:34:5F:29:78:B3:
08:F3:F6:70:E5:35:1A:B3:73:4D:22:07:0A:32:6A:B0:76:79:FE:B8:
B1:C6:33:7B:34:4C:DA:C8:D9:11:D9:A6:33:F1:C2:DA:E5:9D:B5:30:
B9:EF:61:AE:06:C5:36:F9:ED:30:C5:F8