I read a lot tutorial of gpu passthrough, and I did it in proxmox 8.HDMI did show what shows in the vm. But no matter what I try, there is no audio output.
Here is what i did:
Which means bootloader is GRUB.
change
And reboot.
IOMMU enabled, good to go.
And reboot.
Everything indicate GPU and audio are in their own IOMMU group.
And reboot.
Then I frist created a debian vm without GPU passthrough.
And I installed tigervnc. Shutdown wm, and add pci device of GPU and Audio, set vga to none.
Start the vm, and monitor display the output of debian vm, and I knew GPU passthough successed.
And I opened a video, video is playing, but no sound.
Then I follow https://pve.proxmox.com/wiki/PCI_Passthrough#Troubleshooting. I did it in debian vm.
Still no sound.
But Audio device MSI is disabled. And I don't know what to do now.
Here is what i did:
Bash:
efibootmgr -v
Boot0010* proxmox HD(2,GPT,0d01c215-bceb-4aad-9afc-165f4c3bed79,0x800,0x200000)/File(\EFI\PROXMOX\GRUBX64.EFI)
Which means bootloader is GRUB.
Bash:
nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
to this GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on,igfx_off iommu=pt nomodeset initcall_blacklist=sysfb_init"
Bash:
update-grub
Bash:
dmesg | grep -i -e DMAR -e IOMMU
[ 0.095212] DMAR: IOMMU enabled
[ 2.604266] DMAR: Intel(R) Virtualization Technology for Directed I/O
IOMMU enabled, good to go.
Bash:
echo "vfio" >> /etc/modules
echo "vfio_iommu_type1" >> /etc/modules
echo "vfio_pci" >> /etc/modules
update-initramfs -u -k all
Bash:
dmesg | grep -i vfio
[ 6.118244] VFIO - User Level meta-driver version: 0.3
Bash:
dmesg | grep 'remapping'
[ 0.292240] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.294725] DMAR-IR: Enabled IRQ remapping in x2apic mode
Bash:
lspci -nnk | grep VGA
00:02.0 VGA compatible controller [0300]: Intel Corporation GeminiLake [UHD Graphics 600] [8086:3185] (rev 06)
Bash:
lspci -nnk | grep Audio
00:0e.0 Audio device [0403]: Intel Corporation Celeron/Pentium Silver Processor High Definition Audio [8086:3198] (rev 06)
Bash:
find /sys/kernel/iommu_groups/ -type l
/sys/kernel/iommu_groups/17/devices/0000:01:00.0
/sys/kernel/iommu_groups/7/devices/0000:00:13.2
/sys/kernel/iommu_groups/15/devices/0000:00:1e.0
/sys/kernel/iommu_groups/5/devices/0000:00:12.0
/sys/kernel/iommu_groups/13/devices/0000:00:19.2
/sys/kernel/iommu_groups/13/devices/0000:00:19.0
/sys/kernel/iommu_groups/13/devices/0000:00:19.1
/sys/kernel/iommu_groups/3/devices/0000:00:0e.0
/sys/kernel/iommu_groups/11/devices/0000:00:17.0
/sys/kernel/iommu_groups/11/devices/0000:00:17.3
/sys/kernel/iommu_groups/11/devices/0000:00:17.1
/sys/kernel/iommu_groups/11/devices/0000:00:17.2
/sys/kernel/iommu_groups/1/devices/0000:00:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:00.1
/sys/kernel/iommu_groups/18/devices/0000:02:00.0
/sys/kernel/iommu_groups/8/devices/0000:00:13.3
/sys/kernel/iommu_groups/16/devices/0000:00:1f.0
/sys/kernel/iommu_groups/16/devices/0000:00:1f.1
/sys/kernel/iommu_groups/6/devices/0000:00:13.0
/sys/kernel/iommu_groups/14/devices/0000:00:1c.0
/sys/kernel/iommu_groups/4/devices/0000:00:0f.0
/sys/kernel/iommu_groups/12/devices/0000:00:18.3
/sys/kernel/iommu_groups/12/devices/0000:00:18.1
/sys/kernel/iommu_groups/12/devices/0000:00:18.2
/sys/kernel/iommu_groups/12/devices/0000:00:18.0
/sys/kernel/iommu_groups/2/devices/0000:00:0c.0
/sys/kernel/iommu_groups/10/devices/0000:00:16.2
/sys/kernel/iommu_groups/10/devices/0000:00:16.0
/sys/kernel/iommu_groups/10/devices/0000:00:16.3
/sys/kernel/iommu_groups/10/devices/0000:00:16.1
/sys/kernel/iommu_groups/0/devices/0000:00:02.0
/sys/kernel/iommu_groups/19/devices/0000:03:00.0
/sys/kernel/iommu_groups/9/devices/0000:00:15.0
Bash:
pvesh get /nodes/home/hardware/pci --pci-class-blacklist ""
0x030000 │ 0x3185 │ 0000:00:02.0 │ 0 │ 0x8086 │ GeminiLake [UHD Graphics 600]
0x040300 │ 0x3198 │ 0000:00:0e.0 │ 3 │ 0x8086 │ Celeron/Pentium Silver Processor High Definition Audio
Everything indicate GPU and audio are in their own IOMMU group.
Bash:
echo "options kvm ignore_msrs=1 report_ignored_msrs=0" > /etc/modprobe.d/kvm.conf
echo "softdep snd_hda_intel pre: vfio-pci" >> /etc/modprobe.d/vfio.conf
echo "softdep snd_hda_codec_hdmi pre: vfio-pci" >> /etc/modprobe.d/vfio.conf
echo "softdep i915 pre: vfio-pci" >> /etc/modprobe.d/vfio.conf
echo "options vfio-pci ids=8086:3185,8086:3198 disable_vga=1" >> /etc/modprobe.d/vfio.conf
update-initramfs -u -k all
Then I frist created a debian vm without GPU passthrough.
balloon: 0
bios: ovmf
boot: order=scsi0;ide2;net0
cores: 4
cpu: x86-64-v2-AES
efidisk0: local-lvm:vm-100-disk-0,efitype=4m,pre-enrolled-keys=1,size=4M
ide2: local:iso/debian-12.1.0-amd64-DVD-1.iso,media=cdrom,size=3900480K
machine: q35
memory: 4096
meta: creation-qemu=8.0.2,ctime=1696232110
name: debianDesktop
net0: virtio=D2:E1:64:AD:76:7A,bridge=vmbr0
numa: 0
ostype: l26
runningcpu: qemu64,+aes,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+pni,+popcnt,+sse4.1,+sse4.2,+ssse3
runningmachine: pc-q35-8.0+pve0
scsi0: local-lvm:vm-100-disk-1,iothread=1,size=64G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=eb33622b-216b-48cb-849c-aa71a40741f4
snaptime: 1696240734
sockets: 1
vmgenid: 5fc4389c-e827-46dd-867a-4227036d73fa
balloon: 0
bios: ovmf
boot: order=scsi0;net0
cores: 4
cpu: x86-64-v2-AES
efidisk0: local-lvm:vm-100-disk-0,efitype=4m,pre-enrolled-keys=1,size=4M
hostpci0: 0000:00:02,pcie=1,x-vga=1
hostpci1: 0000:00:0e,pcie=1
machine: q35
memory: 4096
meta: creation-qemu=8.0.2,ctime=1696232110
name: debianDesktop
net0: virtio=D2:E1:64:AD:76:7A,bridge=vmbr0
numa: 0
ostype: l26
parent: done
scsi0: local-lvm:vm-100-disk-1,iothread=1,size=64G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=eb33622b-216b-48cb-849c-aa71a40741f4
sockets: 1
usb0: host=1915:1011
vga: none
vmgenid: 696bfc21-52a2-4a43-8670-88a1bf6e933d
And I opened a video, video is playing, but no sound.
Then I follow https://pve.proxmox.com/wiki/PCI_Passthrough#Troubleshooting. I did it in debian vm.
Bash:
echo "options snd-hda-intel enable_msi=1" >> /etc/modprobe.d/snd-hda-intel.conf
update-initramfs -u -k all
systemctl reboot
Bash:
lspci -vv
Capabilities: [60] MSI: Enable- Count=1/1 Maskable- 64bit+
But Audio device MSI is disabled. And I don't know what to do now.