Gpu pass through

Hi all,
I am attempting to pass through a quadro p400 to a vm running jellyfin for transcoding purposes. I have isolated the gpu in advanced settings and i am able to see it in the config options for the vm but when i try to start the vm after adding the gpu i get the following error :
Error: Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor.py”, line 182, in start
if self.domain.create() < 0:
^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/libvirt.py”, line 1373, in create
raise libvirtError(‘virDomainCreate() failed’)
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2024-07-06T23:37:57.024330Z qemu-system-x86_64: -device {“driver”:“vfio-pci”,“host”:“0000:06:00.1”,“id”:“hostdev0”,“bus”:“pci.0”,“addr”:“0x5”}: vfio 0000:06:00.1: failed to setup container for group 18: Failed to set iommu for container: Operation not permitted

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 198, in call_method
result = await self.middleware.call_with_audit(message[‘method’], serviceobj, methodobj, params, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1466, in call_with_audit
result = await self._call(method, serviceobj, methodobj, params, app=app,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1417, in _call
return await methodobj(*prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/schema/processor.py”, line 187, in nf
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/schema/processor.py”, line 47, in nf
res = await f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_lifecycle.py”, line 58, in start
await self.middleware.run_in_thread(self._start, vm[‘name’])
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1324, in run_in_thread
return await self.run_in_executor(self.thread_pool_executor, method, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1321, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_supervisor.py”, line 68, in _start
self.vms[vm_name].start(vm_data=self._vm_from_name(vm_name))
File “/usr/lib/python3/dist-packages/middlewared/plugins/vm/supervisor/supervisor.py”, line 191, in start
raise CallError(‘\n’.join(errors))
middlewared.service_exception.CallError: [EFAULT] internal error: qemu unexpectedly closed the monitor: 2024-07-06T23:37:57.024330Z qemu-system-x86_64: -device {“driver”:“vfio-pci”,“host”:“0000:06:00.1”,“id”:“hostdev0”,“bus”:“pci.0”,“addr”:“0x5”}: vfio 0000:06:00.1: failed to setup container for group 18: Failed to set iommu for container: Operation not permitted
`
I have also attached a screen shot for reference
Hardware is a dell r710 running 2 X5670 on Dragonfish-24.04.1.1 I have confirmed that virtulization is enabled in bios
Thanks

I’ve got almost the same hardware: Dell T420 + quadro p400 + Dragonfish-24.04.1.1
Everything work as a charm!

Try these steps:

  1. Delete all GPU isolation: System Settings > Advanced > Isolated GPU Device(s)
  2. Disable GPU for apps: Apps > Setting > Advanced Settings > (uncheck) Enable GPU support
  3. Add GPU isolation
  4. Add GPU in VM devices
  5. Start VM

Ill give that a try thanks

Unfortunately that didnt help still got the same error did you renable gpu for apps after re isolating it?

GPU isolation - only for VM usage (GPU passthrough inside VM)
Apps > Setting > Advanced Settings > Enable GPU support - only for docker apps passthrough
You can choose either VM passthrough or the apps passthrough.