'virt-manager install aborting due to memory
Running Linux 5.16.10-arch1-1 #1 SMP PREEMPT Wed, 16 Feb 2022 19:35:18
Been trying my hand at setting up a Windows 10 virtual machine through virt-manager utilizing QEMU and KVM, and I've run into quite a fair bit of trouble in the process. This error message appears when clicking "Begin Installation":
internal error: qemu unexpectedly closed the monitor: 2022-02-21T14:05:58.222051Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T14:05:58.222249Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T14:05:58.222327Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: vfio 0000:01:00.0: failed to setup container for group 1: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x55ce3e4e7d80, 0x0, 0x80000000, 0x7f46abe00000) = -12 (Cannot allocate memory)
I'm not particularly experienced with Linux or its derivatives (I'm starting with EndeavourOS, which I freshly installed yesterday) but I am somewhat tech savvy, so I have made several attempts to fix this. However, all of the similar issues and solutions I found online after running out of ideas provided me no reprieve. This does also include frequently reading, re-reading and testing concepts provided by the Arch Linux wiki itself. I've ensured that IOMMU is properly enabled and configured. My GPU (gtx 1080) is completely isolated and has been bound to vfio-pci, libvirt has been configured, access permission for /dev/vfio/1 has been granted as needed, I've edited /etc/pam.d/sudo and changed permissions for /etc/libvirt/qemu.conf. Unless I am hilariously misinformed, none of that is the cause of this issue.
I've been largely unsuccessful in finding and fixing the cause of this error message. I have changed hard and soft ram limits and tried many different values for memory allocation (2048, 4096, 8192, 12288) and none have made any difference in the error message.
I don't know what logs or outputs would be beneficial to attach, so please feel free to request any that you would need and I will provide them to the best of my ability.
Edit 1
Realized it would probably be a good idea to post the entire error log. Here it is:
Unable to complete install: 'internal error: qemu unexpectedly closed the monitor: 2022-02-21T19:36:08.149009Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T19:36:08.150079Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T19:36:08.150300Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: vfio 0000:01:00.0: failed to setup container for group 1: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x55d714ea5a30, 0x0, 0x80000000, 0x7fa233e00000) = -12 (Cannot allocate memory)'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/createvm.py", line 2001, in _do_async_install
installer.start_install(guest, meter=meter)
File "/usr/share/virt-manager/virtinst/install/installer.py", line 701, in start_install
domain = self._create_guest(
File "/usr/share/virt-manager/virtinst/install/installer.py", line 649, in _create_guest
domain = self.conn.createXML(install_xml or final_xml, 0)
File "/usr/lib/python3.10/site-packages/libvirt.py", line 4400, in createXML
raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2022-02-21T19:36:08.149009Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T19:36:08.150079Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T19:36:08.150300Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: vfio 0000:01:00.0: failed to setup container for group 1: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x55d714ea5a30, 0x0, 0x80000000, 0x7fa233e00000) = -12 (Cannot allocate memory)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|