Intel Sandybridge iGPU pass thru

I’m really struggling with an iGPU pass thru… I’m on Proxmox I have grub set with:
GRUB_CMDLINE_LINUX_DEFAULT=“quiet intel_iommu=on video=vesafb:off,efifb:off vfio-pci.ids=8086:010a”

I’ve loaded all the proper vfio kernel drivers and black listed all of the intel drivers. lspci shows that the vfio driver is loaded on the adapter. I have my qemu config setup with i440fx and:
args: -device vfio-pci,host=00:02.0,addr=0x02,x-igd-opregion=on,x-igd-gms=1,romfile=hd2000_vbios.rom

When I boot the VM I get:
kvm: -device vfio-pci,host=00:02.0,addr=0x02,x-igd-opregion=on,x-igd-gms=1,romfile=hd2000_vbios.rom: vfio 0000:00:02.0: error getting device from group 1: Cannot allocate memory
Verify all devices in group 1 are bound to vfio- or pci-stub and not already in use
TASK ERROR: start failed: QEMU exited with code 1

The strange part is that the proxmox boot options menu still displays and then it clicks by and freezes. The system does boot and is accessible from the web gui and ssh. But it feels like grub isnt letting go of the igpu and thus it cant be used. The screen does go blank as soon as I start the VM but the VM wont actually start due to the error. I’ve been trying to fix this on my own for a week now and I’ve finally hit the end of my talent… and need help.

and yes i tried the proxmox forum but came up empty there too…

I got a little further… I’m now getting a “vfio-pci 0000:00:02.0: vfio_pci: Failed to setup Intel IGD regions” when I run: dmesg | grep -i vfio

Here are the IOMMU Groups, Group1 is only the iGPU:

/sys/kernel/iommu_groups/0/devices/0000:00:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:02.0
/sys/kernel/iommu_groups/2/devices/0000:00:16.0
/sys/kernel/iommu_groups/2/devices/0000:00:16.2
/sys/kernel/iommu_groups/2/devices/0000:00:16.3
/sys/kernel/iommu_groups/3/devices/0000:00:19.0
/sys/kernel/iommu_groups/4/devices/0000:00:1a.0
/sys/kernel/iommu_groups/5/devices/0000:00:1d.0
/sys/kernel/iommu_groups/6/devices/0000:00:1e.0
/sys/kernel/iommu_groups/7/devices/0000:00:1f.0
/sys/kernel/iommu_groups/7/devices/0000:00:1f.2
/sys/kernel/iommu_groups/7/devices/0000:00:1f.3

And I thought I should probably put this on here too:

00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 Processor Family Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])
Subsystem: Acer Incorporated [ALI] Xeon E3-1200 Processor Family Integrated Graphics Controller
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 16
Region 0: Memory at fe000000 (64-bit, non-prefetchable) [size=4M]
Region 2: Memory at d0000000 (64-bit, prefetchable) [size=256M]
Region 4: I/O ports at f000 [size=64]
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-
Address: 00000000 Data: 0000
Capabilities: [d0] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D3 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [a4] PCI Advanced Features
AFCap: TP+ FLR+
AFCtrl: FLR-
AFStatus: TP-
Kernel driver in use: vfio-pci
Kernel modules: i915

I’m not sure if this is allowed but I found an entry on patchwork that talks about quirks… do i have to do something special to enable vfio quirks?

https://patchwork.ozlabs.org/project/qemu-devel/patch/[email protected]/

Still working on this… so it would appear that it is grub reserving the iGPU… so i need to prevent Grub from grabbing it. I saw someone had switched to console=serial to solve this issue… but i don’t have a serial port and it wont let me just force the value in (everytime i try to update-grub it says error serial not found). Is there a way to force grub to not output to the screen?

Serial can often be enabled in the bios. It’s present on many motherboards as a unpopulated header.

Yeah I checked… its not on this little unit. I guess some back ground on what I’m trying to do might help… this is for a friend who doesn’t have alot of money. I got him an Acer AC100 with a Xeon E3-1260L with 16gb of RAM and what I’m trying to do is basically hand Windows 10 the wheel as far as the video is concerned and run several LXC containers under the hood. He’s not good with Linux (I’m feeling like Im not that good right now either…) so I want the Windows 10 VM to autostart and grab the monitor so he doesn’t have to work the back end. I can always remote manage this at his home, but I know he’s going to want some way to look at the unit when he needs to. I know its old hardware and a lot of people dismiss it because of that… but It runs LXC and proxmox great! It even runs windows with VirtIO really good! I just dont want him to see the terminal and F the thing up because he has no idea what he’s doing.

Have you tried adding a USB UART adapter?

I haven’t tried that yet, but I think that’s my next step. I’m honestly taking shots in the dark at this point… I have read so much documentation lately that i’m not sure where I’m at. Some people say that grub cant hit the frame buffer because it will lock in the IGPU and even with VFIO loaded it wont release the igd… but i’ve also read that grub needs to hit it to pass it to the OS with the vfio driver loaded… I’m not even sure this will fix my issue. The igd has vfio loaded as its driver… its just weird to me that with all the disable flags set that grub still displays the boot menu but immediately after stops. So the OS is getting the adapter and stoping it, when i go to run the VM it clears the screen, like its trying to pass it… but in the logs I get a “vfio-pci 0000:00:02.0: vfio_pci: Failed to setup Intel IGD regions”. So i feel like this is a memory lock somewhere. The qemu pages all talk about the memory regions and that the drivers should be updated to deal with this… but yet nothing works.

It’s always tricky working with those small boards :frowning: What about Intel GVT-g?

Its too old for GVT-g… so it has be handled through the legacy channel… unfortunately…

you have a second dedicated gpu for the base o.s to run off and you want the igpu to be the display adapter for the vm?
you have made sure the igpu isn’t disabled in bios? it can be automatically when you insert a dedicated gfx card.
so check again to make sure its set to enabled. you may also have to mess with peg mode to select your primary display adapter.

if you have no gpu then the vm wont be able to release the igpu hardware from the main system hosting the vm so it wont be usable. in that case nothing more you can do till you get a dedicated gpu.

oh and just in case none of the above is right…
check the settings for your vm and see how much ram you have allocated to the display. (your first post mentions cant allocate memory, so might be worth a look)
as you might currently be asking for the driver to allocate more than you have set aside for the vm.

I do not have a second GPU in the system. Proxmox talks about support for headless systems, where the GPU is passed to a VM and the rest of the system runs headless… I assume this to be correct, but this might just be the issue (as you said)… Like i said tho i did find a post about pushing grub to serial and someone using the igpu for VM, would this be because the system booted to a serial console? And proxmox is booting without screen output… and it does show that the gpu is being passed to vfio. I’ve also found a ton of people using laptops and intel NUC systems that do the igpu passthru with no other GPU’s attached.

The igpu is on in the bios. How do i dedicate memory to the GPU itself? This is a legacy passthru for qemu and i don’t see any options to push memory to the GPU.

I’m sure there is something missing… luckily this is a test system for now and I’ve killed it twice already and I’ll keep trying things until i hopefully find a solution.

In the bios it’s usually called something like “Shared video memory”.

I don’t actually have that option… but I know its doing that because i have video output so it wouldn’t work without having some reserved memory. The issue is more that i can even get qemu to hit the boot manager. It kills itself before seabios even comes up, due to not being able to allocate the hardware.