RobertoBenzi

New Member
Feb 4, 2021
2
1
1
35
Hello there,
I am trying to passthrough my motherboard onboard audio to a Windows 10 guest, but every time it boots it crashes on blue screen;

the lspci --nnk output for the audio card I want to passthrough is
Code:
00:1b.0 Audio device [0403]: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller [8086:3a3e]
        Subsystem: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller [8086:0041]
        Kernel driver in use: vfio-pci
        Kernel modules: snd_hda_intel

while the graphic card is

Code:
03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)
        Subsystem: Micro-Star International Co., Ltd. [MSI] GP106 [GeForce GTX 1060 6GB] [1462:3283]
        Kernel driver in use: vfio-pci
        Kernel modules: nvidiafb, nouveau
03:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev a1)
        Subsystem: Micro-Star International Co., Ltd. [MSI] GP106 High Definition Audio Controller [1462:3283]
        Kernel driver in use: vfio-pci
        Kernel modules: snd_hda_intel


grub options are set as follow

Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on pcie_acs_override=downstream,multifunction video=efifb:off"



As far as I can understand each device has its own IOMMU group (12 for the audio card, 22 for the GPU and 23 for the audio device integrated in the GPU), cause from
Code:
find /sys/kernel/iommu_groups/ -type l
relevant line output are
Code:
/sys/kernel/iommu_groups/12/devices/0000:00:1b.0
/sys/kernel/iommu_groups/22/devices/0000:03:00.0
/sys/kernel/iommu_groups/23/devices/0000:03:00.1

and checking the respective folders are the only device in there

Before trying this I successfully passed through the host video card to the guest, following the indication on both the manual and the wiki;

trying to passthrough the audio card I added to /etc/modprobe.d/blacklist.conf the last line (the previous 3 are for the GPU passthrough)

Code:
blacklist radeon
blacklist nouveau
blacklist nvidia
blacklist snd_hda_intel

I also added the second line to /etc/modprobe.d/vfio.conf (again, previous one for the GPU)
Code:
options vfio-pci ids=10de:1c03,10de:10f1 disable_vga=1
options vfio-pci ids=8086:3a3e

and updated initramfs, then i edited
/etc/pve/qemu-server.201.conf (201 is my VM device ID) adding
hostpci1: 00:1b.0
(while hostpci0: 03:00.0;03:00.1,pcie=1,romfile=GTX10606Gb.rom is the line for the GPU passthrough)

Without the hostpci1 line the VM boots fine, as long as I try to configure the audio card adding that line I get blue screen on boot.
I also tried installing Windows from scratch, it boots fine as long as the GPU drivers are not loaded, but as soon as I try to load gpu drivers it crashes with blue screen, in both cases with

Code:
Stopcode: SYSTEM SERVICE EXCEPTION or SYSTEM THREAD EXCEPTION NOT HANDLED
What failed: nvlddmkm.sys

am I missing something? Is there something else I should add? How can I circumvent the problem?

Thank you in advance
Roberto
 
Last edited:
  • Like
Reactions: FabioMen10
Now I am posting all my final settings and steps (working) so that others can benefit from this.

1. Here is what my grub file looks like.
nano /etc/default/grub
Bash:
#If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Proxmox Virtual Environment"
#GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt"
GRUB_CMDLINE_LINUX=""

# Disable os-prober, it might add menu entries for each guest
GRUB_DISABLE_OS_PROBER=true

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

2. Update GRUB
update-grub2

3. Add Kernel Modules to be Loaded at Boot
nano /etc/modules

Bash:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd


4. Blacklist Graphics Driver on the Host - so that the GPU is not being used by the host
nano /etc/modprobe.d/blacklist.conf

Bash:
blacklist radeon
blacklist nouveau
blacklist nvidia

5. Reboot Host - after reboot, the GPU will not be used by the host
reboot

6. Create Windows 10 VM
Bash:
udio0: device=ich9-intel-hda,driver=spice
bios: ovmf
boot: order=scsi0
cores: 4
cpu: host
efidisk0: ssd-pool-pmx2:vm-102-disk-1,size=4M
hostpci0: 01:00,pcie=1,x-vga=1
machine: pc-q35-5.2
memory: 8196
name: win10
net0: e1000=6A:D3:A8:FF:6D:85,bridge=vmbr0,firewall=1
numa: 0
ostype: win10
scsi0: ssd-pool-pmx2:vm-102-disk-0,cache=writethrough,size=60G,ssd=1
scsi1: hdd-pool-pmx2:vm-102-disk-0,cache=writeback,size=1T
scsihw: virtio-scsi-pci
smbios1: uuid=190ea724-78a8-46c9-9a12-9d2967c92af0
sockets: 1
usb0: host=1b80:b504
usb1: host=1b80:b503,usb3=1
vga: none
vmgenid: 35bf6c9e-cfc4-4c9b-b31c-cc28e130301f

1622901015812.png

Apart from all the hardware attached, you will also have to attach
a. CD/DVD drive and make it point to windows-10.iso
b. CD/DVD drive and make it point to VirtIO-win.iso
As windows10 will not have the driver installed to talk to VirtIO device (Hard disk, memory ballooning driver) attached to the VM.
Set the windows-10 DVD to highest boot priority.
Add GPU as PCI Device.
Add USB mouse as USB device
Add USB keyboard as USB device
Add a default audio device
Make sure at this point a monitor is directly connected to the GPU card you have passed through.
Turn on the VM.
You should have the boot screen on the monitor by now and USB keyboard and a mouse should also by directly attached to the VM.
Follow the installation process.
Its should be working.
Enjoy :)
 

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!