You are not logged in.

#1 2024-12-25 08:13:39

MxnnyTRXPSTXR
Member
Registered: 2024-12-25
Posts: 6

VFIO Single Gpu Passthrough Error when starting VM

Ive setup a Windows 10 vm on kvm which work perfectly fine until i pass through my GPU give me an error, I followed a lot youtube guides and i was following the arch wiki i set up my VFIO correctly. My GPU is in the vfio group and i even isolated it from the pci controller all setting in BIOS are enable. I think it is a permission problem but im not because i was digging through libvirt confs for hours enabling permissions. If anyone has had this issue or know what it caused by any help would be appreciated as Im staying up countless nights trying to fix it but making no progress


Error starting domain: internal error: Process exited prior to exec: libvirt:  error : cannot limit locked memory of process 3876 to 9663676416: Operation not permitted

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 71, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 107, in tmpcb
    callback(*args, **kwargs)
    ~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1384, in startup
    self._backend.create()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/libvirt.py", line 1379, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: Process exited prior to exec: libvirt:  error : cannot limit locked memory of process 3876 to 9663676416: Operation not permitted

Offline

#2 2024-12-25 10:12:41

seth
Member
Registered: 2012-09-03
Posts: 60,815

Re: VFIO Single Gpu Passthrough Error when starting VM

I followed a lot youtube guides

roll
For the general problem see https://github.com/kubevirt/kubevirt/is … 1751893550

For clarification: you want to dynamically pass through the *only* GPU in the system to the VM at runtime? Or do you run the linux host completely headless, handing the GPU to the VM from the get-go?
The former is not trivial because you've to remove the GPU from the host first, what in any event will require you to stop your GUI session - and any other process using the GPU kernel module, unbind the device, bind it to vfio, https://wiki.archlinux.org/title/PCI_pa … _device_ID and then start your VM.

What does your current approach actually look like?

Offline

#3 2024-12-25 16:22:45

MxnnyTRXPSTXR
Member
Registered: 2024-12-25
Posts: 6

Re: VFIO Single Gpu Passthrough Error when starting VM

Sorry for the confusion, I’m not dynamically passing through my nvidia gpu, I use my intel integrated graphics instead. The GPU is isolated from the host and passed to the vfio drivers at boot

Offline

#4 2024-12-25 17:15:09

loqs
Member
Registered: 2014-03-06
Posts: 18,232

Re: VFIO Single Gpu Passthrough Error when starting VM

How is libvirt being started?  As a systemd service? From a root shell,  a none root shell,  something else?

Offline

#5 2024-12-26 21:49:18

seth
Member
Registered: 2012-09-03
Posts: 60,815

Re: VFIO Single Gpu Passthrough Error when starting VM

Also in that (standard) case, forget the youtube turorials, follow https://wiki.archlinux.org/title/PCI_pa … h_via_OVMF and post details about the situation, ie. actual groups, all devices in it, what devices you're delegating to vfio and how exactly.
A potential trap is to have the "regular" module in the initramfs, but not vfio - so it gets to the device late.

In doubt please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

Offline

#6 2024-12-27 01:50:23

MxnnyTRXPSTXR
Member
Registered: 2024-12-25
Posts: 6

Re: VFIO Single Gpu Passthrough Error when starting VM

EDIT: I fugured it out it was because i was running KVM under ///user i switched to ///system and it works flawlessly

Last edited by MxnnyTRXPSTXR (2024-12-27 07:30:18)

Offline

#7 2024-12-27 04:06:22

MxnnyTRXPSTXR
Member
Registered: 2024-12-25
Posts: 6

Re: VFIO Single Gpu Passthrough Error when starting VM

EDIT: when i run Virt manager as sudo the gpu passes through however none of my settings save and i cannot use XML editing as preferences dont save, Ive went through all the configs for qemu and libvirt enabling everything with max persmissions however it still doesnt work Im 100% missing something is there anyway to appy/confirm the permission settings?

Offline

#8 2024-12-27 10:38:57

seth
Member
Registered: 2012-09-03
Posts: 60,815

Offline

Board footer

Powered by FluxBB