2016-08-28 12 views
1

を使用してパススルーGPUは、QEMUログがvfio_dma_mapエラーここでlibvirtの

2016-08-28T02:52:05.699498Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio_dma_map(0x7f67ea3b3e10, 0x100000, 0xbff00000, 0x7f6651d00000) = -12 (Cannot allocate memory) 
2016-08-28T02:52:05.847310Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio_dma_map(0x7f67ea3b3e10, 0x100000000, 0xae400000, 0x7f6711c00000) = -12 (Cannot allocate memory) 
2016-08-28T02:52:05.847323Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: memory listener initialization failed for container 
2016-08-28T02:52:05.847330Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: failed to setup container for group 1 
2016-08-28T02:52:05.847440Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: failed to get group 1 

あるのdmesg:

[ 356.004278] vfio_pin_pages: RLIMIT_MEMLOCK (7218397184) exceeded 
[ 356.004446] vfio_pin_pages: RLIMIT_MEMLOCK (7218397184) exceeded 
[ 356.371582] vfio_pin_pages: RLIMIT_MEMLOCK (7218397184) exceeded 
[ 356.371698] vfio_pin_pages: RLIMIT_MEMLOCK (7218397184) exceeded 

libvirtのバージョン:ulimitのは限らず、使用するには、-l

Compiled against library: libvirt 1.2.9 
Using library: libvirt 1.2.9 
Using API: QEMU 1.2.9 
Running hypervisor: QEMU 2.1.2 

を設定してみました

[email protected]:/home/deb# ulimit -l 
unlimited 

答えて

0

また、あなたのlibvirtのxmlを投稿してください。この問題が発生したら、libvirtのxmlを変更して、
qemu-argsの代わりにエントリを使用するように修正しました。

+0

こんにちは、XMLは階下です – SirTeddy

0

XML:通常通りVFIOを実行している場合、ここで解決策があるとは思えないよう

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> 
    <name>host2</name> 
    <uuid>d35811f6-7865-4144-b78b-a0366ca30888</uuid> 
    <metadata> 
     <vmtemplate name="Custom" icon="windows7.png" os="windows7"/> 
    </metadata> 
    <memory unit='KiB'>6291456</memory> 
    <currentMemory unit='KiB'>6291456</currentMemory> 
    <memoryBacking> 
     <nosharepages/> 
     <locked/> 
    </memoryBacking> 
    <vcpu placement='static'>4</vcpu> 
    <cputune> 
    <vcpupin vcpu='0' cpuset='0'/> 
    <vcpupin vcpu='1' cpuset='1'/> 
    <vcpupin vcpu='2' cpuset='2'/> 
    <vcpupin vcpu='3' cpuset='3'/> 
    </cputune> 
    <os> 
    <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type> 
    <boot dev='network'/> 
    </os> 
    <features> 
    <acpi/> 
    <apic/> 
    </features> 
    <cpu mode='host-passthrough'> 
    <topology sockets='1' cores='4' threads='1'/> 
    </cpu> 
    <clock offset='localtime'> 
    <timer name='rtc' tickpolicy='catchup'/> 
    <timer name='pit' tickpolicy='delay'/> 
    <timer name='hpet' present='no'/> 
    </clock> 
    <on_poweroff>destroy</on_poweroff> 
    <on_reboot>restart</on_reboot> 
    <on_crash>restart</on_crash> 
    <devices> 
    <emulator>/usr/bin/qemu-system-x86_64</emulator> 
    <controller type='usb' index='0'> 
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> 
    </controller> 
    <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> 
    <interface type='direct'> 
     <mac address='52:54:00:33:ac:18'/> 
     <source dev='eth0' mode='bridge'/> 
     <model type='e1000'/> 
     <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> 
    </interface> 
    <serial type='pty'> 
     <target port='0'/> 
    </serial> 
    <console type='pty'> 
     <target type='serial' port='0'/> 
    </console> 
    <memballoon model='virtio'> 
     <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> 
    </memballoon> 
    </devices> 
    <qemu:commandline> 
    <qemu:arg value='-device'/> 
    <qemu:arg value='vfio-pci,host=01:00.0,x-vga=on'/> 
    </qemu:commandline> 
</domain> 
2

は、同じ問題に走りました。 /etc/security/limits.d/99-memlock.confのユーザ "user"に1Gのメモリ "1048576"を追加することで、ロックされたメモリの制限を増やしました(とにかく私のシステム用)。

user hard memlock 1048576 
    user soft memlock 1048576