Estou tentando fazer com que o PCI / GPU repasse para o trabalho por alguns dias, mas acertei uma parede. Não consigo obter nenhuma saída de vídeo da GPU aprovada. Eu segui de perto o tutorial no Arch Wiki enquanto ocasionalmente checava este da Level1Techs. O sistema operacional que estou virtualizando é o Windows 10 Home Edition.
Especificações do PC:
O VT-d é habilitado no UEFI BIOS e o IOMMU é habilitado no kernel (saída de dmesg | grep -i iommu
):
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=c6c3c8f3-030c-4dce-be63-8938386ac963 rw quiet intel_iommu=on
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=c6c3c8f3-030c-4dce-be63-8938386ac963 rw quiet intel_iommu=on
[ 0.000000] DMAR: IOMMU enabled
...
Minha GPU e o controlador de áudio HDMI estão usando o driver vfio-pci
e estão no grupo IOMMU 1 com um controlador PCIe (saída de lspci -nnk
):
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Tonga PRO [Radeon R9 285/380] [1002:6939] (rev f1)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:2015]
Kernel driver in use: vfio-pci
Kernel modules: amdgpu
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Tonga HDMI Audio [Radeon R9 285/380] [1002:aad8]
Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:aad8]
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
vfio-pci
está sendo executado corretamente, comprovado por dmesg | grep -i vfio
:
[ 0.773952] VFIO - User Level meta-driver version: 0.3
[ 0.774978] vfio-pci 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=none
[ 0.789351] vfio_pci: add [1002:6939[ffff:ffff]] class 0x000000/00000000
[ 0.806016] vfio_pci: add [1002:aad8[ffff:ffff]] class 0x000000/00000000
[ 2.767507] vfio-pci 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=none
[ 1310.412510] vfio-pci 0000:01:00.0: enabling device (0000 -> 0003)
qemu
, libvirt
, ovmf-git
e virt-manager
estão instalados e libvirtd
está em execução (saída de systemctl status libvirtd
):
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2017-04-15 12:16:01 EEST; 4h 10min ago
Docs: man:libvirtd(8)
http://libvirt.org
Main PID: 469 (libvirtd)
Tasks: 21 (limit: 4915)
CGroup: /system.slice/libvirtd.service
├─469 /usr/bin/libvirtd
├─708 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
├─709 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
├─754 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/wireless.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
└─755 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/wireless.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
Apr 15 15:46:21 elias-arch dnsmasq[754]: using nameserver 192.168.43.1#53
Apr 15 15:46:21 elias-arch dnsmasq[708]: reading /etc/resolv.conf
Apr 15 15:46:21 elias-arch dnsmasq[708]: using nameserver 2001:14b8:1000::1#53
Apr 15 15:46:21 elias-arch dnsmasq[708]: using nameserver fe80::e658:b8ff:fe4a:5394%wlp4s0#53
Apr 15 15:46:21 elias-arch dnsmasq[708]: using nameserver 192.168.43.1#53
Apr 15 15:52:23 elias-arch libvirtd[469]: 2017-04-15 12:52:23.783+0000: 525: warning : qemuDomainObjTaint:4148 : Domain id=3 name='Windows10' uuid=dd4cb32a-0311-4b7c-9bd6-4553051945be is tainted: host-cpu
Apr 15 15:52:24 elias-arch libvirtd[469]: 2017-04-15 12:52:24.017+0000: 469: error : qemuMonitorIORead:588 : Unable to read from monitor: Connection reset by peer
Apr 15 15:52:24 elias-arch libvirtd[469]: 2017-04-15 12:52:24.038+0000: 469: error : qemuProcessReportLogError:1845 : internal error: qemu unexpectedly closed the monitor: 2017-04-15T12:52:23.899918Z qemu-system-x86_64: cannot set up guest memory 'pc.ram
Apr 15 15:52:24 elias-arch libvirtd[469]: 2017-04-15 12:52:24.041+0000: 525: error : qemuProcessReportLogError:1845 : internal error: process exited while connecting to monitor: 2017-04-15T12:52:23.899918Z qemu-system-x86_64: cannot set up guest memory '
Apr 15 15:52:48 elias-arch libvirtd[469]: 2017-04-15 12:52:48.858+0000: 524: warning : qemuDomainObjTaint:4148 : Domain id=4 name='Windows10' uuid=dd4cb32a-0311-4b7c-9bd6-4553051945be is tainted: host-cpu
Não se preocupe com isso cannot set up guest memory
-error, foi um erro meu dar pouca RAM para a VM.
Minhas configurações de virt-manager
devem estar corretas. Estou executando principalmente nas configurações padrão, exceto:
/usr/share/ovmf/x64/ovmf_x64.bin
host-passthrough
Instalei o Windows no adaptador de vídeo QXL e ele foi bem-sucedido. Depois disso, removi o canal Spice, o adaptador de vídeo QXL, o mouse e teclado emulados, o dispositivo de mesa USB e dois redirecionadores USB. Eu também adicionei dois dispositivos host PCI: minha GPU e seu controlador de áudio HDMI. Depois disso, não houve saída proveniente da GPU passada (sei que a saída deve chegar ao monitor que está conectado à placa de vídeo dedicada). O sistema está claramente inicializando: está alocando RAM e usando o processador. Eu já tentei isso no Fedora no início desta semana e falhei no mesmo estágio.
Aqui está o arquivo de log do /var/log/libvirt/qemu/Windows10.log
Existe algum arquivo de registro que eu precise incluir? Eu não estou muito familiarizado com o KVM, então não sei. Isso poderia ser um problema de hardware ou estou apenas fazendo algo estúpido?
Obrigado!
Editar: minha configuração XML de virsh edit Windows10
:
<domain type='kvm'>
<name>Windows10</name>
<uuid>dd4cb32a-0311-4b7c-9bd6-4553051945be</uuid>
<memory unit='KiB'>5120000</memory>
<currentMemory unit='KiB'>5120000</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-2.8'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/ovmf/x64/ovmf_x64.bin</loader>
<nvram>/var/lib/libvirt/qemu/nvram/Windows10_VARS.fd</nvram>
<bootmenu enable='yes'/>
</os>
<features>
<acpi/>
<apic/>
<hyperv>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='8191'/>
</hyperv>
<vmport state='off'/>
</features>
<cpu mode='host-passthrough' check='none'/>
<clock offset='localtime'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
<timer name='hypervclock' present='yes'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
<devices>
<emulator>/usr/sbin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writeback'/>
<source file='/opt/os-storage/win10.qcow2'/>
<target dev='sda' bus='scsi'/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writeback'/>
<source file='/home/elias/os-images/storage/win10-data.qcow2'/>
<target dev='sdb' bus='scsi'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/home/elias/os-images/win10-amd64.iso'/>
<target dev='sdc' bus='sata'/>
<readonly/>
<boot order='2'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/home/elias/os-images/virtio-win-0.1.126.iso'/>
<target dev='sdd' bus='sata'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='3'/>
</disk>
<controller type='scsi' index='0' model='virtio-scsi'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<controller type='usb' index='0' model='nec-xhci'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</controller>
<controller type='virtio-serial' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</controller>
<interface type='network'>
<mac address='52:54:00:98:06:a4'/>
<source network='default'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<interface type='network'>
<mac address='52:54:00:2e:5c:88'/>
<source network='wireless'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
</hostdev>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</memballoon>
</devices>
</domain>
Tags virtualization gpu linux arch-linux