G
G
Gennady2019-12-07 16:04:10
Debian
Gennady, 2019-12-07 16:04:10

Proxmox: how to forward an Intel UHD 605 GPU inside a virtual machine?

Hello gentlemen. There is the following hardware:
- ASRock J5005-ITX (UEFI);
- Intel Pentium Silver J5005 (VT-x, VT-d);
- Intel UHD Graphics 605 (connection to monitor via HDMI);
- 2 x 8 DDR4-2400 SO-DIMMs.
Installed Debian 10 ("Stretch"), over it "rolled" Proxmox 6 (further control is carried out via the Web interface from another PC located in the same local network).
0. Output of uname -a :

Linux j5005-itx 5.3.10-1-pve #1 SMP PVE 5.3.10-1 (Thu, 14 Nov 2019 10:43:13 +0100) x86_64 GNU/Linux

What I did next:
1. Changed the line in the /etc/default/grub file:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on video=efifb:off"

2. Added the following lines to the end of the /etc/modules file :
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

3. Added the following lines to the end of the /etc/modprobe.d/pve-blacklist.conf file :
blacklist snd_hda_intel
blacklist snd_hda_codec_hdmi
blacklist i915

4. Created the file /etc/modprobe.d/kvm.conf and added the line to it:
options kvm ignore_msrs=1
5. Created the file /etc/modprobe.d/vfio.conf and added the line to it:
options vfio-pci ids=8086:3184
because the command lspci -nn | grep "VGA" outputs the following:
00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 605 [8086:3184] (rev 03)

6. Extracted glk_dmc_ver1_04.bin file from firmware-misc-nonfree package and copied it to /usr/share/kvm directory .
7. Brought the virtual machine file /etc/pve/qemu-server/100.conf to the following form:
agent: 1
balloon: 0
bios: ovmf
boot: dc
bootdisk: sata0
cores: 2
cpu: host
efidisk0: local:100/vm-100-disk-1.qcow2,size=128K
hostpci0: 00:02,pcie=1,romfile=glk_dmc_ver1_04.bin,x-vga=1
machine: q35
memory: 2048
name: Win10
net0: virtio=DA:52:A4:8B:C5:6F,bridge=vmbr0,firewall=1
numa: 0
ostype: win10
sata0: local:iso/ru-en_windows_10_1903-Jun_x86-x64_32in1_HWID-act-FiraDisk.iso,media=cdrom
sata1: local:100/vm-100-disk-0.qcow2,size=32G
scsihw: virtio-scsi-pci
smbios1: uuid=a02656db-e97c-4c2c-a4ff-955328ad71fc
sockets: 1
vga: none
vmgenid: 26990a9f-5645-47c4-99f6-1fa87481c708

The output of the dmesg command | grep -aiE '((DMAR)|(kvm)|(acs)|(drm)|(Command line)|(iommu)|(vfio))' before starting the VM:
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.3.10-1-pve root=/dev/mapper/pve-root ro quiet intel_iommu=on video=efifb:off
[    0.009497] ACPI: FACS 0x000000006D6B1080 000040
[    0.009608] ACPI: DMAR 0x000000006D6A0D70 0000A8 (v01 INTEL  GLK-SOC  00000003 BRXT 0100000D)
[    0.142439] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.3.10-1-pve root=/dev/mapper/pve-root ro quiet intel_iommu=on video=efifb:off
[    0.142565] DMAR: IOMMU enabled
[    0.281246] DMAR: Host address width 39
[    0.281248] DMAR: DRHD base: 0x000000fed64000 flags: 0x0
[    0.281258] DMAR: dmar0: reg_base_addr fed64000 ver 1:0 cap 1c0000c40660462 ecap 9e2ff0505e
[    0.281260] DMAR: DRHD base: 0x000000fed65000 flags: 0x1
[    0.281269] DMAR: dmar1: reg_base_addr fed65000 ver 1:0 cap d2008c40660462 ecap f050da
[    0.281272] DMAR: RMRR base: 0x0000006d5d8000 end: 0x0000006d5f7fff
[    0.281274] DMAR: RMRR base: 0x0000006f800000 end: 0x0000007fffffff
[    0.281278] DMAR-IR: IOAPIC id 1 under DRHD base  0xfed65000 IOMMU 1
[    0.281280] DMAR-IR: HPET id 0 under DRHD base 0xfed65000
[    0.281281] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[    0.283216] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    0.820781] DMAR: No ATSR found
[    0.820867] DMAR: dmar0: Using Queued invalidation
[    0.820872] DMAR: dmar1: Using Queued invalidation
[    0.821278] pci 0000:00:00.0: Adding to iommu group 0
[    0.821296] pci 0000:00:00.1: Adding to iommu group 0
[    0.856475] pci 0000:00:02.0: Adding to iommu group 1
[    0.856620] pci 0000:00:0e.0: Adding to iommu group 2
[    0.856719] pci 0000:00:0f.0: Adding to iommu group 3
[    0.856828] pci 0000:00:12.0: Adding to iommu group 4
[    0.856944] pci 0000:00:13.0: Adding to iommu group 5
[    0.857030] pci 0000:00:13.1: Adding to iommu group 6
[    0.857143] pci 0000:00:13.2: Adding to iommu group 7
[    0.857238] pci 0000:00:13.3: Adding to iommu group 8
[    0.857388] pci 0000:00:15.0: Adding to iommu group 9
[    0.857484] pci 0000:00:1f.0: Adding to iommu group 10
[    0.857502] pci 0000:00:1f.1: Adding to iommu group 10
[    0.857618] pci 0000:01:00.0: Adding to iommu group 11
[    0.857715] pci 0000:03:00.0: Adding to iommu group 12
[    0.857844] pci 0000:04:00.0: Adding to iommu group 13
[    0.857919] DMAR: Intel(R) Virtualization Technology for Directed I/O
[    6.897158] VFIO - User Level meta-driver version: 0.3
[    7.368306] vfio-pci 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    7.385318] vfio_pci: add [8086:3184[ffffffff:ffffffff]] class 0x000000/00000000

When starting the virtual machine, the following lines appear there:
[ 1013.548131] DMAR: DRHD: handling fault status reg 2
[ 1013.548140] DMAR: [DMA Write] Request device [00:02.0] fault addr 0 [fault reason 02] Present bit in context entry is clear
[ 1014.177149] vfio-pci 0000:00:02.0: vfio_ecap_init: hiding ecap [email protected]

When the virtual machine is stopped, the following lines appear there:
[ 1149.230800] DMAR: DRHD: handling fault status reg 2
[ 1149.230809] DMAR: [DMA Write] Request device [00:02.0] fault addr 0 [fault reason 02] Present bit in context entry is clear

And, most importantly, when you start the virtual machine, the image on the monitor that is connected via HDMI completely disappears. The LED on the monitor starts flashing as if there is no video signal from the PC.
Tell me, please, how to achieve an image on the monitor, which (in theory) should be displayed from the virtual machine? I would like the video card in the virtual machine to work at the maximum of its performance (approximately like on real hardware).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2019-12-07
@SuNbka

Once I forwarded it following the example of this article, everything worked.
Suddenly it will help you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question