Can't pass "0000:01:00:1 NVIDIA Corporation TU102 High Definition Audio Controller" from qemu + xen + libvirt + virt-manager VM to windows 10 guest os
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
New
|
Low
|
Unassigned |
Bug Description
Hello to everyone.
I'm trying to pass-through my nvidia RTX 2080 ti with qemu + xen + libvirt + virt-manager. I've realized that I can't pass every device located inside the IOMMU group. Basically,if I try to pass the "0000:01:00:1 NVIDIA Corporation TU102 High Definition Audio Controller",windows 10 guest os is not able to boot properly. It freezes forever on the boot. Anyway,if I decide to don't pass through that device to the vm,I'm not able to make work the nvidia driver and it reports the error 43,I'm sure because it needs also the missing component to work properly. I don't have this problem if I don't use libvirt. what to do ? I'm using ubuntu 20.04,xen version :
root@ziomario-
host : ziomario-
release : 5.4.0-42-generic
version : #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020
machine : x86_64
nr_cpus : 16
max_cpu_id : 15
nr_nodes : 1
cores_per_socket : 8
threads_per_core : 2
cpu_mhz : 3600.603
hw_caps : bfebfbff:
virt_caps : hvm hvm_directio
total_memory : 32627
free_memory : 14117
sharing_
sharing_used_memory : 0
outstanding_claims : 0
free_cpus : 0
xen_major : 4
xen_minor : 11
xen_extra : .4-pre
xen_version : 4.11.4-pre
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=
xen_changeset :
xen_commandline : placeholder
cc_compiler : gcc (Ubuntu 9.2.1-31ubuntu3) 9.2.1 20200306
cc_compile_by : ubuntu-devel-di
cc_compile_domain : lists.ubuntu.com
cc_compile_date : Tue Mar 10 09:04:06 UTC 2020
build_id : 70edf50fce444a7
xend_config_format : 4
and this xen / libvirt cfg file :
<domain type='xen'>
<name>
<uuid>
<memory unit='KiB'
<currentMemory unit='KiB'
<vcpu placement=
<os>
<type arch='x86_64' machine=
<loader type='rom'
<boot dev='hd'/>
<bootmenu enable='yes'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<cpu mode='host-model'/>
<clock offset='utc'/>
<on_poweroff>
<on_reboot>
<on_crash>
<devices>
<emulator>
<disk type='block' device='disk'>
<driver name='phy' type='raw'/>
<source dev='/dev/sdb'/>
<target dev='sda' bus='scsi'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver type='raw'/>
<target dev='sdb' bus='scsi'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='xenbus' index='0'/>
<controller type='scsi' index='0'/>
<controller type='usb' index='0'/>
<interface type='bridge'>
<mac address=
<source bridge='virbr0'/>
<model type='e1000'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' keymap='lt'>
<listen type='address'/>
</graphics>
<video>
<model type='vga' vram='16384' heads='1' primary='yes'/>
</video>
<hostdev mode='subsystem' type='pci' managed='no'>
<driver name='xen'/>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='no'>
<driver name='xen'/>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x2'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='no'>
<driver name='xen'/>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x3'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='no'>
<source>
<vendor id='0x045e'/>
<product id='0x02c4'/>
</source>
</hostdev>
<memballoon model='xen'/>
</devices>
</domain>
let me know.
lspci -nnk | grep nvidia
root@ziomario- z390aoruspro: /etc/xen# lspci -nnk | grep nvidia
Kernel modules: nvidiafb, nouveau, nvidia\_drm, nvidia
Kernel modules: i2c\_nvidia\_gpu
this is how to I assign the 4 devices of the NVIDIA iommu group to xen :
root@ziomario- z390aoruspro: /etc/xen# ./pciback- 0000:01: 00.0.sh 0000:01:00.0
root@ziomario- z390aoruspro: /etc/xen# ./pciback- 0000:01: 00.0.sh 0000:01:00.1
root@ziomario- z390aoruspro: /etc/xen# ./pciback- 0000:01: 00.0.sh 0000:01:00.2
root@ziomario- z390aoruspro: /etc/xen# ./pciback- 0000:01: 00.0.sh 0000:01:00.3
this is the script pciback.sh :
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Require PCI devices in format: <domain> :<bus>: <slot>. <function> "
echo "Eg: $(basename $0) 0000:00:1b.0"
exit 1
fi
modprobe xen-pciback
for pcidev in $@; do
if [ -h /sys/bus/ pci/devices/ "$pcidev" /driver ]; then
echo "Unbinding $pcidev from" $(basename $(readlink /sys/bus/ pci/devices/ "$pcidev>
echo -n "$pcidev" > /sys/bus/ pci/devices/ "$pcidev" /driver/ unbind
fi
echo "Binding $pcidev to pciback"
echo -n "$pcidev" > /sys/bus/ pci/drivers/ pciback/ new_slot
echo -n "$pcidev" > /sys/bus/ pci/drivers/ pciback/ bind
done
as I said,it works if I don't use libvirt / virt-manager. It means that I can pass also the audio device.