Video playback out-of-sync with audio (stutter) on W10 VM with AMD iGPU Passthrough

Coomer

New Member
Sep 17, 2023
4
0
1
Hey there peeps,

I am having issues with the Windows 10 VM iGPU Passthrough, it seems to throw ALL video playback out-of-sync after a while, regardless of the player used, e.g. local player (MPC-BE/MPV/etc.), browser stream (YouTube/Twitch), dedicated streaming apps (Netflix, etc.).

Initially I was using the integrated sound card from the mainboard that was passed through to the VM but every video playback was out-of-sync after ~20-30 minutes, and getting worse every minute. Workaround was to close/restart the player/browser/app and it was fine for the next ~20-30 minutes.

Frustrated that I could not troubleshoot the issue properly I bought a USB sound card (also passed through to the VM, obviously), thinking it would ease my pain.
Well, it is better but instead of video being out-of-sync after a while I now have a different issue. The audio freezes, then video freezes, audio unfreezes, and then they both resume and are in-sync, also there is a short stutter before it happens.

Please find below captures of said issue.
(Pay no mind to the icon in top-right part of the screen, I captured this with OBS via Parsec, but what you see is precisely what happens on the main display normally).

https://streamable.com/y7o15h
https://streamable.com/smxgay

It still irks me that the video/audio just stutters intermittently after a while, but at least I no longer have to close/re-open my player/browser/app every 20 minutes or so.

At this point I would very much appreciate ANY ideas or hints on how to resolve this issue :)
Many thanks in advance and thanks for being here guys, this forum has helped me greatly when I initially struggled with VM passthrough on AMD iGPUs :)

Proxmox version 8.1.4
The CPU is AMD Ryzen 7 8700G, however, the issue was also present when a different CPU (AMD Ryzen 5 7600X) was installed.

Please find below configs for the Proxmox and the VM itself.

/etc/default/grub

Code:
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt"
GRUB_CMDLINE_LINUX=""

/etc/modules
Code:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

/etc/modprobe.d/vfio.conf
Code:
options vfio-pci ids=1002:15bf,1002:1640,1022:15e3
softdep radeon pre: vfio-pci
softdep amdgpu pre: vfio-pci
softdep snd_hda_intel pre: vfio-pci

What is passed through here are:
- iGPU
- iGPU audio (HDMI)
- on-board sound card (no longer in use as it caused v/a out-of-sync after ~20 minutes, mentioned above)

/etc/pve/qemu-server/W10.conf
Code:
agent: 1
args: -cpu 'host,-hypervisor,kvm=off'
balloon: 0
bios: ovmf
boot: order=sata0;net0
cores: 14
cpu: host
efidisk0: PVE:200/vm-200-disk-0.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K
hostpci0: 0000:0c:00.0,pcie=1,romfile=vbios_8700G.bin
hostpci1: 0000:0c:00.1,pcie=1,romfile=AMDGopDriver.rom
machine: pc-q35-8.1
memory: 14336
meta: creation-qemu=8.1.5,ctime=1707507084
name: W10
net0: e1000=***MACADDRESS***,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: win10
sata0: PVE:200/vm-200-disk-1.qcow2,discard=on,size=101G,ssd=1
sata1: PVE:200/vm-200-disk-3.qcow2,size=100G
scsihw: virtio-scsi-single
smbios1: uuid=***UUID***
sockets: 1
startup: order=4
tpmstate0: PVE:200/vm-200-disk-2.raw,size=17K,version=v2.0
usb0: host=1-9
usb1: host=1-8
usb2: host=1-6
usb3: host=2-4
vga: none
vmgenid: ***vmgenid***

Passed through here are 4 USB ports - mice, keyboard, USB sound card (Antlion) and 1 unoccupied port (for pendrives).


The CPU is AMD Ryzen 7 8700G, however, the issue was also present when a different CPU (AMD Ryzen 5 7600X) was installed.



Again, any help is greatly appreciated, thanks! <3
 
Last edited:
Try giving the VM only 6 (virtual) cores and 8192MiB of memory, to prevent maxing out your host. Also move the virtual disks to VirtIO SCSI Single and enabled IO Thread to split off IO to separate threads. Don't use USB passthrough for low-latency or high-bandwidth; use a passed through USB controller instead (like the GPU).
 
  • Like
Reactions: Coomer
The host system was not maxed out so I ruled that out first.
Your second suggestion turned out to be the solution I was looking for, as after a fix the issue is gone :)

Disks were attached as SATA, what I did was create a new disk as VirtIO SCSI Single, booted the VM up, let Windows detect it and install appropriate SCSI drivers. After that I initiated a shutdown, detached the disks (including the primary one, containing OS) and re-attached it as SCSI Single, with IO Thread enabled.

I did not pass through the USB controller, at least not yet, since the issue was resolved after "converting" the disk types.


You have my gratitude @leesteken - you have helped me immensely :)

My burning issue is now solved! <3
 
Last edited:
Yeah, no, the issue is not solved, my celebration was premature, I will try to pass through the USB controller tomorrow.
However, I do not anticipate it being the solution as the issue also presented itself when I was using integrated sound card (motherboard-based, non-USB). Host system has 32 gigs of RAM currently so, again, maxing out should be a non-issue.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!