GPU passthru of Nvidia VM fails to boot with Error

I have a Debian 12 host (a fresh install) with Incus 6.11 from the Zabbly repos. The system is an Intel i7-13700 with a Nvidia 4060 ti 16GB video card.

I am trying to get the GPU to passthru to a Ubuntu VM. I have set it to ‘true’ and added the device, and I have added the /opt/incus/bin to the path. If I unattach the GPU the VM works fine, but as soon as it is attached the VM fails to start. I also changed the system memory limit to ‘unlimited’, but nothing has worked so far.

Here is the error log:

Name: OllamaVM
Description: Ollama VM on Ubuntu
Status: STOPPED
Type: virtual-machine
Architecture: x86_64
Created: 2025/04/23 13:07 EDT
Last Used: 2025/04/23 18:45 EDT

Log:

qemu-system-x86_64: VFIO_MAP_DMA failed: Cannot allocate memory
qemu-system-x86_64: vfio_container_dma_map(0x55fbbaee3ae0, 0xc0000, 0x20000, 0x7f7d32000000) = -12 (Cannot allocate memory)
qemu: hardware error: vfio: DMA mapping failed, unable to continue
CPU #0:
EAX=00000000 EBX=00000000 ECX=00000000 EDX=000b0671
ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0000 00000000 0000ffff 00009300
CS =f000 ffff0000 0000ffff 00009b00
SS =0000 00000000 0000ffff 00009300
DS =0000 00000000 0000ffff 00009300
FS =0000 00000000 0000ffff 00009300
GS =0000 00000000 0000ffff 00009300
LDT=0000 00000000 0000ffff 00008200
TR =0000 00000000 0000ffff 00008b00
GDT= 00000000 0000ffff
IDT= 00000000 0000ffff
CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000000
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
XMM00=0000000000000000 0000000000000000 XMM01=0000000000000000 0000000000000000
XMM02=0000000000000000 0000000000000000 XMM03=0000000000000000 0000000000000000
XMM04=0000000000000000 0000000000000000 XMM05=0000000000000000 0000000000000000
XMM06=0000000000000000 0000000000000000 XMM07=0000000000000000 0000000000000000

Any help would be appreciated, thanks,

Bill

This is a known regression with the current Debian 12 kernel (Debian kernel 6.1.0-33-amd64 VFIO_MAP_DMA issue). It looks like the fix will be included in the upcoming 6.1.135 kernel release, which will then need to be handled by the Debian kernel team.

1 Like

Thanks for the quick reply. I confirmed I am indeed running the cited version of the kernel, namely 6.1.0-33-amd64.

Bill

Should be fixed with the recently released linux-image-6-1-0-34-amd64 package.