ubuntuusers.de

libvirt GPU Intel UHD 770 13900T passthrough zu einem Windows 10 Gast

Status: Ungelöst | Ubuntu-Version: Ubuntu 22.10 (Kinetic Kudu)
Antworten |

egophil

Anmeldungsdatum:
2. Februar 2023

Beiträge: Zähle...

Hallo in die Runde,

ich versuche meine iGPU in vom Hostsystem in eine Windows 10 VM durchzureichen leider bisher ohne Erfolg. Ich wollte gerne wissen, ob von euch jemand mit ähnlicher Hardware erfolgreich war. Hardware: Gigabyte Auros Elite AX, CPU Intel 13900T

ich benutze eine Kernel in Version 6.1.8 und übergebe beim booten folgende Parameter (/etc/default/grub)

GRUB_CMDLINE_LINUX_DEFAULT="rd_NO_LUKS intel_iommu=on iommu=pt pcie_acs_override=downstream,multifunction initcall_blacklist=sysfb_init video=simplefb:off video=vesafb:off video=efifb:off video=vesa:off disable_vga=1 vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1 modprobe.blacklist=snd_hda_intel,snd_hda_codec_hdmi,i915"

in der /etc/initramfs-tools/modules übergebe ich folgende Parameter:

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

in der Konfigurationsdatei: /etc/modprobe.d/vfio.conf steht folgendes

options vfio-pci ids=8086:a780 disable_vga=1

das Kommando: dmesg | grep -e DMAR -e IOMMU gibt soweit Auskunft darüber, dass IOMMU funktioniert:

[    0.032516] ACPI: DMAR 0x00000000370E9000 000088 (v02 INTEL  EDK2     00000002      01000013)
[    0.032627] ACPI: Reserving DMAR table memory at [mem 0x370e9000-0x370e9087]
[    0.374527] DMAR: IOMMU enabled
[    0.686506] DMAR: Host address width 39
[    0.686511] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[    0.686528] DMAR: dmar0: reg_base_addr fed90000 ver 4:0 cap 1c0000c40660462 ecap 29a00f0505e
[    0.686538] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[    0.686550] DMAR: dmar1: reg_base_addr fed91000 ver 5:0 cap d2008c40660462 ecap f050da
[    0.686559] DMAR: RMRR base: 0x0000003c000000 end: 0x000000403fffff
[    0.686570] DMAR-IR: IOAPIC id 2 under DRHD base  0xfed91000 IOMMU 1
[    0.686577] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[    0.686583] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[    0.688871] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    3.509677] pci 0000:00:02.0: DMAR: Skip IOMMU disabling for graphics
[    3.669840] DMAR: No ATSR found
[    3.669845] DMAR: No SATC found
[    3.669850] DMAR: IOMMU feature fl1gp_support inconsistent
[    3.669853] DMAR: IOMMU feature pgsel_inv inconsistent
[    3.669878] DMAR: IOMMU feature nwfs inconsistent
[    3.669882] DMAR: IOMMU feature dit inconsistent
[    3.669891] DMAR: IOMMU feature sc_support inconsistent
[    3.669897] DMAR: IOMMU feature dev_iotlb_support inconsistent
[    3.669905] DMAR: dmar0: Using Queued invalidation
[    3.669921] DMAR: dmar1: Using Queued invalidation
[    3.671608] DMAR: Intel(R) Virtualization Technology for Directed I/O
[    4.621052] AMD-Vi: AMD IOMMUv2 functionality not available on this system - This is not a bug.

Die VM habe ich in libvirt eingerichtet: als chipset: pc-q35-7.2 und BIOS ist ein UEFI: UEFI x86_64: /usr/share/OVMF/OVMF_CODE_4M.ms.fd XML-Datei von libvirt:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<domain type="kvm">
  <name>Win10UEFI-konsti</name>
  <uuid>ef6ac324-3eff-46ac-bb44-260d44874a9e</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">4194304</memory>
  <currentMemory unit="KiB">4194304</currentMemory>
  <vcpu placement="static">2</vcpu>
  <os firmware="efi">
    <type arch="x86_64" machine="pc-q35-7.2">hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode="custom">
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
  </features>
  <cpu mode="host-passthrough" check="none" migratable="on"/>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/mnt/daten/vm/virtStorage0/Windows10/virtio-win.iso"/>
      <target dev="sdc" bus="sata"/>
      <readonly/>
      <boot order="3"/>
      <address type="drive" controller="0" bus="0" target="0" unit="2"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/mnt/daten/vm/virtStorage0/Windows10/Konsti_hdd0.qcow2"/>
      <target dev="vda" bus="virtio"/>
      <boot order="2"/>
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    </disk>
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    </controller>
    <controller type="pci" index="0" model="pcie-root"/>
    <controller type="pci" index="1" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="1" port="0x10"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="2" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="2" port="0x11"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x1"/>
    </controller>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="3" port="0x12"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x2"/>
    </controller>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="4" port="0x13"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x3"/>
    </controller>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="5" port="0x14"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0x15"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>
    </controller>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="7" port="0x16"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x6"/>
    </controller>
    <controller type="pci" index="8" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="8" port="0x17"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x7"/>
    </controller>
    <controller type="pci" index="9" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="9" port="0x18"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="10" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="10" port="0x19"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x1"/>
    </controller>
    <controller type="pci" index="11" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="11" port="0x1a"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x2"/>
    </controller>
    <controller type="pci" index="12" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="12" port="0x1b"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x3"/>
    </controller>
    <controller type="pci" index="13" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="13" port="0x1c"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x4"/>
    </controller>
    <controller type="pci" index="14" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="14" port="0x1d"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x5"/>
    </controller>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </controller>
    <interface type="bridge">
      <mac address="52:54:00:10:28:c6"/>
      <source bridge="br0"/>
      <model type="virtio"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </interface>
    <serial type="pty">
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
      </target>
    </serial>
    <console type="pty">
      <target type="serial" port="0"/>
    </console>
    <input type="tablet" bus="usb">
      <address type="usb" bus="0" port="1"/>
    </input>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice" autoport="yes" listen="0.0.0.0">
      <listen type="address" address="0.0.0.0"/>
      <gl enable="no"/>
    </graphics>
    <sound model="ich9">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
    </sound>
    <audio id="1" type="none"/>
    <video>
      <model type="virtio" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </video>
    <hostdev mode="subsystem" type="pci" managed="yes">
      <source>
        <address domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
      </source>
      <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
    </hostdev>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </memballoon>
  </devices>
</domain>

wenn ich die VM starte und anschließend den Befehl: lspci -nnk ausführe sieht man, dass die GPU von vfio-pci angesprochen wird.

00:02.0 VGA compatible controller [0300]: Intel Corporation Raptor Lake-S GT1 [UHD Graphics 770] [8086:a780] (rev 04)
	DeviceName: Onboard - Video
	Subsystem: Gigabyte Technology Co., Ltd Raptor Lake-S UHD Graphics [1458:d000]
	Kernel driver in use: vfio-pci
	Kernel modules: i915

Ich habe Windows 10 ohne passthrough installiert. Hierzu verwende ich das Grafikinterface virtio. Nachdem Windows 10 installiert war habe ich den aktuellen Windows Patchstand eingespielt. VM Heruntergefahren und in der Konfiguration passthrough aktiviert (siehe libvirt XML-Datei). Windows bootet in diesem Fall ganz normal und man sieht im Gerätemanager ein neues PCI device als Grafikkarte. Windows 10 holt sich automatisch die Treiber installiert sie und zum Schluss steht im Gerätemanager eine UHD 770. Jedoch muss man Windows nach der Treiberinstallation neu starten.

Bisheriges Ergebnis: Die VM startet jedoch bleibt der Bildschirm schwarz und Windows läuft in den Reperaturmodus, da der Bootvorgang nicht erfolgreich war. Die Ausgabe läuft nur auf dem virtio mittels spice interface. Ich habe auch schon versucht nur die GPU der VM zu übergeben ohne virtio und spice-server. Leider ohne Erfolg Sobald ich den passthrough deaktiviere fährt die VM(Windows 10) normal hoch.

Hat jemand noch Ideen was helfen könnte? Besten Dank,

Phil

ubuntu--anfaenger

Avatar von ubuntu--anfaenger

Anmeldungsdatum:
12. Oktober 2013

Beiträge: 1223

Wohnort: Belgien

Hallo egophil,

Hast Du Dir das hier schonmal angeschaut?

https://www.youtube.com/watch?v=tDMoEvf8Q18

Es ist aber komplett andere Hardware, und auch ein anderes Ubuntu, aber vielleicht hilft es ja.

lg,

TNTMaster

Anmeldungsdatum:
30. Juli 2009

Beiträge: 876

Im Arch Wiki PCI_passthrough_via_OVMF/Examples unter Punkt 1.2 steht etwas dazu:

For some reason, enabling intel_iommu=on on the kernel commmand line without CSM support enabled in UEFI causes a black screen on boot. Enable it (Windows 8/10 features need to be enabled to show "CSM Support", selecting "Other OS" hides that).

Die Hardware ist eine andere, aber vielleicht hilfts dir der Tip weiter.

Gruß TNT

Antworten |