许珂诚 Posted September 19, 2022 Share Posted September 19, 2022 我显卡直通了 GTX960,但是经常有时候开不了机,日志里报错:vfio_region_write(0000:01:00.0:region1+0xfff93, 0x0,1) failed: Device or resource busy。然后更离谱的是,有时候我又能正常开机。。。 配置在下面: <?xml version='1.0' encoding='UTF-8'?> <domain type='kvm'> <name>Windows 11</name> <uuid>7243851b-6429-3acc-63c4-7fd89bbe407c</uuid> <metadata> <vmtemplate xmlns="unraid" name="Windows 11" icon="windows11.png" os="windowstpm"/> </metadata> <memory unit='KiB'>8388608</memory> <currentMemory unit='KiB'>8388608</currentMemory> <memoryBacking> <nosharepages/> </memoryBacking> <vcpu placement='static'>8</vcpu> <cputune> <vcpupin vcpu='0' cpuset='0'/> <vcpupin vcpu='1' cpuset='4'/> <vcpupin vcpu='2' cpuset='1'/> <vcpupin vcpu='3' cpuset='5'/> <vcpupin vcpu='4' cpuset='2'/> <vcpupin vcpu='5' cpuset='6'/> <vcpupin vcpu='6' cpuset='3'/> <vcpupin vcpu='7' cpuset='7'/> </cputune> <os> <type arch='x86_64' machine='pc-i440fx-6.2'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd</loader> <nvram>/etc/libvirt/qemu/nvram/7243851b-6429-3acc-63c4-7fd89bbe407c_VARS-pure-efi-tpm.fd</nvram> </os> <features> <acpi/> <apic/> <hyperv mode='custom'> <relaxed state='on'/> <vapic state='on'/> <spinlocks state='on' retries='8191'/> <vendor_id state='on' value='none'/> </hyperv> </features> <cpu mode='host-passthrough' check='none' migratable='on'> <topology sockets='1' dies='1' cores='4' threads='2'/> <cache mode='passthrough'/> <feature policy='disable' name='hypervisor'/> </cpu> <clock offset='localtime'> <timer name='hypervclock' present='yes'/> <timer name='hpet' present='no'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/local/sbin/qemu</emulator> <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='writeback'/> <source file='/mnt/user/domains/Windows 11/vdisk1.img'/> <target dev='hdc' bus='virtio'/> <boot order='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/mnt/user/isos/zh-cn_windows_11_business_editions_updated_may_2022_x64_dvd_a526f4d7.iso'/> <target dev='hda' bus='ide'/> <readonly/> <boot order='2'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/mnt/user/isos/virtio-win-0.1.217-2.iso'/> <target dev='hdb' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> <controller type='pci' index='0' model='pci-root'/> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <controller type='virtio-serial' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </controller> <controller type='usb' index='0' model='ich9-ehci1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/> </controller> <controller type='usb' index='0' model='ich9-uhci2'> <master startport='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/> </controller> <controller type='usb' index='0' model='ich9-uhci3'> <master startport='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/> </controller> <interface type='bridge'> <mac address='52:54:00:42:fa:0f'/> <source bridge='br0'/> <model type='virtio-net'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </interface> <serial type='pty'> <target type='isa-serial' port='0'> <model name='isa-serial'/> </target> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <channel type='unix'> <target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <input type='tablet' bus='usb'> <address type='usb' bus='0' port='3'/> </input> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <tpm model='tpm-tis'> <backend type='emulator' version='2.0' persistent_state='yes'/> </tpm> <audio id='1' type='none'/> <hostdev mode='subsystem' type='pci' managed='yes'> <driver name='vfio'/> <source> <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </source> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/> </hostdev> <hostdev mode='subsystem' type='pci' managed='yes'> <driver name='vfio'/> <source> <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/> </source> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/> </hostdev> <hostdev mode='subsystem' type='usb' managed='no'> <source> <vendor id='0x0a12'/> <product id='0x0001'/> </source> <address type='usb' bus='0' port='1'/> </hostdev> <hostdev mode='subsystem' type='usb' managed='no'> <source> <vendor id='0x26ce'/> <product id='0x01a2'/> </source> <address type='usb' bus='0' port='2'/> </hostdev> <memballoon model='none'/> </devices> </domain> Quote Link to comment
SimonF Posted September 19, 2022 Share Posted September 19, 2022 Not in own group. Try different slot? Quote Link to comment
许珂诚 Posted September 19, 2022 Author Share Posted September 19, 2022 39 minutes ago, SimonF said: Not in own group. Try different slot? What do you mean “Not in own group. Try different slot” ? Do I need to turn on the computer and replace the graphics card to another slot? Quote Link to comment
darkwalker Posted September 19, 2022 Share Posted September 19, 2022 (edited) 我感觉是IOMMU group 没有分对,在一个IOMMU group里面应该只包含你的显卡和显卡上的声卡这两个设备,而看你的截图IOMMU group 1里面还有个PCI bridge,估计是这个问题导致的,建议改一下PCIe ACS override 每个选项都试试吧,每个人的设备不一样没法说哪种就一定行,我自己的两台机子一个得用both 另一个得用disable Edited September 19, 2022 by darkwalker Quote Link to comment
许珂诚 Posted September 19, 2022 Author Share Posted September 19, 2022 36 minutes ago, darkwalker said: 我感觉是IOMMU group 没有分对,在一个IOMMU group里面应该只包含你的显卡和显卡上的声卡这两个设备,而看你的截图IOMMU group 1里面还有个PCI bridge,估计是这个问题导致的,建议改一下PCIe ACS override 每个选项都试试吧,每个人的设备不一样没法说哪种就一定行,我自己的两台机子一个得用both 另一个得用disable 好的,感谢,我试试 Quote Link to comment
许珂诚 Posted September 21, 2022 Author Share Posted September 21, 2022 On 9/19/2022 at 4:52 PM, darkwalker said: 我感觉是IOMMU group 没有分对,在一个IOMMU group里面应该只包含你的显卡和显卡上的声卡这两个设备,而看你的截图IOMMU group 1里面还有个PCI bridge,估计是这个问题导致的,建议改一下PCIe ACS override 每个选项都试试吧,每个人的设备不一样没法说哪种就一定行,我自己的两台机子一个得用both 另一个得用disable 还是不行。目前是这样,也还是会出现 现在只有重启才有几率不出现这个报错 Quote Link to comment
Solution 许珂诚 Posted September 21, 2022 Author Solution Share Posted September 21, 2022 (edited) 目前发现似乎通过这种方式可以解决: #fix video for VM echo 0 > /sys/class/vtconsole/vtcon0/bind echo 0 > /sys/class/vtconsole/vtcon1/bind echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind 放到 /flash/config/go 中 源链接: Edited September 21, 2022 by 许珂诚 update wrong Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.