VFIO permission issue with dGPU passthrough

1

I'm trying to follow this guide but I cannot make it work.

I'm trying to pass through my dGPU but:

1) The main problem is that I doesn't have permission to VFIO. I fixed it by following this guide: https://www.evonide.com/non-root-gpu-passthrough-setup/#Permissions_for_non-root_GPU_passthrough

2) the follow up is that I get a: cannot allocate memory

mamluk@mamluk-xps:~/Projects/kvm$ ./test.sh
qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on: VFIO_MAP_DMA: -12
qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on: 
vfio_dma_map(0x55fed7e2ab40, 0x0, 0xa0000, 0x7f1f1fe00000) = -12 (Cannot allocate memory)
qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on: VFIO_MAP_DMA: -12
qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on: vfio_dma_map(0x55fed7e2ab40, 0xc0000, 0x7ff40000, 0x7f1f1fec0000) = -12 (Cannot allocate memory)
qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on: VFIO_MAP_DMA: -12
qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on: vfio_dma_map(0x55fed7e2ab40, 0x100000000, 0x180000000, 0x7f1f9fe00000) = -12 (Cannot allocate memory)
qemu-system-x86_64: -device vfio-pci,host=01:00.0,multifunction=on: vfio error: 0000:01:00.0: failed to setup container for group 1: memory listener initialization failed for container: Cannot allocate memory

If run as root it complains it can't find the SDL device.

3) I cannot make OVMF to work, but that I guess is second to this.

My system is a Dell XPS 15 9560, with ubuntu 17.10 . My current qemu script is

qemu-system-x86_64 \
  -enable-kvm \
  -machine q35,accel=kvm,mem-merge=off \
  -cpu host,kvm=off,hv_vendor_id=vgaptrocks,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time \
  -smp 2,cores=2,sockets=1,threads=1 \
  -m 8192 \
  -rtc base=localtime \
  -serial none -parallel none \
  -usb \
  -device usb-host,vendorid=0x413c,productid=0x2110 \
  -device usb-host,vendorid=0x046d,productid=0xc52b \
  -drive file=win10.iso,index=0,media=cdrom \
  -drive file=virtio-win.iso,index=1,media=cdrom \
  -drive file=test.img,format=raw \
  -net nic,model=virtio \
  -net user,smb=/home/mamluk/Projects \
  -device vfio-pci,host=01:00.0,multifunction=on \
  -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd \
  -drive if=pflash,format=raw,file=WIN_VARS.fd

any help?

Muad'Dib

Posted 2018-01-01T18:07:38.110

Reputation: 165

Answers

-1

never seen that cpuid in the wild- assuming this is win10 (ovmf/uefi bios)

and why are you listing vendor ids- thats undocumented.

-device vfio-pci,host=01:00.0,multifunction=on \

you forgot the hdmi audio. I doesnt work w just one entry.

try this instead(you can put it on one line if you must, but use your pci ids, not mine):

(ati r9-290X or 7850(spare) on gigabyte UDER w 4300AMD cpu)

-usb \

-usbdevice host:1002:6819 \

-usbdevice host:1002:aab0 \

-device vfio-pci,host=03:00.0,multifunction=on \

-device vfio-pci,host=03:00.1 \

the rest is up to linux and your iommu controller cooperating.

jazzmaster5950

Posted 2018-01-01T18:07:38.110

Reputation: 1