QEMU/KVM and GPU Passthrough Troubleshooting: Difference between revisions
m (Стадий: 5 [Фаза:Утвърждаване, Статус:Авторизиран]; Категория:Virtual Machines) |
m (Стадий: 6 [Фаза:Утвърждаване, Статус:Утвърден]; Категория:Virtual Machines) |
||
Line 190: | Line 190: | ||
| Прндл = Virtual Machines | | Прндл = Virtual Machines | ||
| Прндл1 = Proxmox | | Прндл1 = Proxmox | ||
| Стадий = | | Стадий = 6 | ||
| Фаза = Утвърждаване | | Фаза = Утвърждаване | ||
| Статус = | | Статус = Утвърден | ||
| ИдтПт = Spas | | ИдтПт = Spas | ||
| РзбПт = Spas | | РзбПт = Spas |
Revision as of 19:32, 22 September 2022
Guest HDMI Audio Crackling and IRQ xx: Nobody Cared
Windows
The solution of the issue Guest GPU HDMI Audio Crackling, Broken or Losing is well explained by Jonp at UNRAID Forums. In short we must try to enable the MSI – Message Signaled Interrupts option if the device support it. Here is a detailed step-by-step instruction how to do that.
I was mentioned the kernel command irqpool
as solution for this issue, but in my opinion and according to some other posts, provided in the references section, this setting is an actual solution for the problem irq 44: nobody cared (try booting with the "irqpool" option); handlers: vfio_intx_handler; Disabling IRQ #44
, that appears at my system when booting a VM with GPU passthrough with a display attached to it, which was causing host system reboot.
Linux
Linux guests usually enable MSI by themselves. To force use of MSI (Message Signaled Interrupts) for GPU audio devices, use the following command and reboot.
echo "options snd-hda-intel enable_msi=1" | sudo tee /etc/modprobe.d/snd-hda-intel.conf
sudo update-initramfs -u -k all
Use lspci ‑vv
and check for the following line on your device to see if MSI is enabled.
sudo lspci -nnv -s 09:00
09:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU117GL [T600] [10de:1fb1] (rev a1) (prog-if 00 [VGA controller])
Subsystem: NVIDIA Corporation TU117GL [T600] [10de:1488]
Flags: bus master, fast devsel, latency 0, IRQ 103, IOMMU group 23
Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
Memory at 7fd0000000 (64-bit, prefetchable) [size=256M]
Memory at 7fe0000000 (64-bit, prefetchable) [size=32M]
I/O ports at f000 [size=128]
Expansion ROM at fc000000 [virtual] [disabled] [size=512K]
Capabilities: [60] Power Management version 3
Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [78] Express Legacy Endpoint, MSI 00
Capabilities: [100] Virtual Channel
Capabilities: [250] Latency Tolerance Reporting
Capabilities: [258] L1 PM Substates
Capabilities: [128] Power Budgeting <?>
Capabilities: [420] Advanced Error Reporting
Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
Capabilities: [900] Secondary PCI Express
Capabilities: [bb0] Physical Resizable BAR
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia_drm, nvidia
09:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:10fa] (rev a1)
Subsystem: NVIDIA Corporation Device [10de:1488]
Flags: bus master, fast devsel, latency 0, IRQ 99, IOMMU group 23
Memory at fc080000 (32-bit, non-prefetchable) [size=16K]
Capabilities: [60] Power Management version 3
Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [78] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
If it says Enable+
, MSI is working, Enable-
means it is supported but disabled, and if the line is missing, MSI is not supported by the PCIe hardware.
This can potentially also improve performance for other passthrough devices, including GPUs, but that depends on the hardware being used.
References
- UNRAID Forums: Windows 10 VM Losing Audio
- UNRAID Forums: Kernel Disabling IRQ #16
- RedHat ListMAN: Kernel panic at vfio_intx_handler leads to low performance in guest VM
- Alex Williamson: VFIO tips and tricks (at vifo.blogspot.com): Usefully Q&A
- Proxmox Wiki: Pci passthrough » HDMI Audio crackling/broken
Passthrough GPU: Windows and SPICE/VNC
Don't use emulated Video and Graphic while you are using GPU passthrough. It leads performance loss.
Spice may give trouble when passing through a GPU as it presents a "virtual" PCI graphic card to the guest and some drivers have problems with that, even when both cards show up. It's always worth a try to disable SPICE and check again if something fails.
References
Passthrough GPU: Windows and 6ch/9ch vs ac97 audio
Do not use 6ch/9ch audio devices in the virtual machine. It creates awful stuttering and performance loss. Use ac97 audio devices instead. This information is outdated – probably the drivers have been updated.
References
Passthrough GPU: Windows and NVIDIA GPU Error 43
I've experiencing this issue with the default OVMF image (OVMF_CODE.ms.fd
-> OVMF_CODE.secboot.fd
). With the image OVMF_VARS-with-csm.fd
the things were well. However here is a general solution. Apply the following changes in the Windows' virtual machine XML file. You can use either virsh edit {your-windows-vm-name}
or the XML tab in virt-manager
.
...
<features>
<acpi/>
<apic/>
<hyperv>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='8191'/>
<vendor_id state='on' value='1234567890ab'/>
</hyperv>
<kvm>
<hidden state='on'/>
</kvm>
<vmport state='off'/>
<ioapic driver='kvm'/>
</features>
...
References
- Mathias Hueber: Fighting error 43 – Nvidia GPU in a Virtual machine
- Reddit: Nvidia NVS315 code 43
Hide the Warnings KVM: vcpu0 ignored rdmsr
sudo nano /etc/modprobe.d/kvm.conf
options kvm report_ignored_msrs=0 # Or: GRUB_CMDLINE_LINUX_DEFAULT="... kvm.report_ignored_msrs=0 ..."
sudo update-initramfs -u -k all
- Note, according to my experience, this option may cause crashes of the host system!?
References
- Proxmox: How to stop warnings "kvm: vcpu0 ignored rdmsr"
- ignore_msrs for host CPU being ignored
KVM Modeinfo
modinfo kvm
filename: /lib/modules/5.4.0-77-generic/kernel/arch/x86/kvm/kvm.ko
license: GPL
author: Qumranet
srcversion: 20C68083F39E14AB616D0B8
depends:
retpoline: Y
intree: Y
name: kvm
vermagic: 5.4.0-77-generic SMP mod_unload modversions
sig_id: PKCS#7
signer: Build time autogenerated kernel key
sig_key: 67:66:2F:F8:26:8F:56:E9:37:7F:B7:AD:33:FA:97:31:CA:7F:FF:50
sig_hashalgo: sha512
signature: 6C:0B:65:F9:46:AC:D8:B7:94:E8:B9:9D:A0:4B:97:E6:63:52:5A:FF:
...
parm: nx_huge_pages:bool
parm: nx_huge_pages_recovery_ratio:uint
parm: ignore_msrs:bool
parm: report_ignored_msrs:bool
parm: min_timer_period_us:uint
parm: kvmclock_periodic_sync:bool
parm: tsc_tolerance_ppm:uint
parm: lapic_timer_advance_ns:int
parm: vector_hashing:bool
parm: enable_vmware_backdoor:bool
parm: force_emulation_prefix:bool
parm: pi_inject_timer:bint
parm: halt_poll_ns:uint
parm: halt_poll_ns_grow:uint
parm: halt_poll_ns_grow_start:uint
parm: halt_poll_ns_shrink:uint
ThinkServer TD350 Issues
Within the TD350's documentation is written it doesn't support any video card. However NVS 315 works with minor issues as these mentioned here.