I’ve been using Ubuntu for virtualization (with virt-manager) with great success, but with the Lunar Lake iGPU (which has great performance) I am having trouble getting VirGL to work.
Here’s a video of what happens: https://www.youtube.com/watch?v=f6xW9RszZe0 – this happens just when using VirGL. Gnome appears around 1:03. Then I run glmark2 -b terrain. With no OpenGL acceleration, everything works well, but obviously performance is worse.
Any ideas how to fix this? Or how to find the cause? I tried some older versions of the Linux kernel, maybe since 6.14 it looked like this, earlier versions don’t support the CPU too well. Or it is likely to be dependent of the version of mesa? It’s been like this since a while.
EDIT: yeah, it doesn’t work. virt-manager added so many commands I can’t figure out which ones to remove. Your scripts launches but the display output is not active.
I tried changing the video to virtio-vga-gl but it just made things worse.
EDIT2: OK I found some working options (still without virgl) but why do you use vga=none? This makes the display output nonexistent.
I am constantly getting this error:
Unable to create OpenGL context >= 3.0
qemu-system-x86_64: virgl could not be initialized: 22
Make sure your host&guest has the necessary packages for virgl & virtio-gpu-gl. Your qemu version should be > 9 and you should be running kernel >6.15(?) and I believe you need mesa too. Sadly can’t find the page where the requirements are listed, going off from memory here.
Below a few packages I could find relating to virgl & virtio-gpu-gl
When virgl works, it initializes as a ‘vga device’ so I don’t need another vga device.
Try a different display mode like -display gkt, gl=on too. virtio-gpu rutabaga seems to not work with sdl but it does with gtk. Rutabaga is a bit slower from my testing than virgl but it does provide 3d acceleration. (needs the rutabaga packages)
Yeah, this would be the solution if VirGL did not already work with the same VM on other systems. All the necessary guest packages were installed (of the ones you listed, I could only find libvirglrenderer1, which only seems to be needed on the host). Another pointer to this is that VirGL worked with Spice, but just the visual output was garbled. But it is garbled only on Lunar Lake. Anyone with an Intel Battlemage GPU to test out others from this generation?
No need to disable gl (gl=off), the VM starts up with gl=on but fails to start VirGL and falls back to no acceleration.
This rutabaga thing doesn’t work at all, I am just getting: 'virtio-gpu-rutabaga' (alias 'virtio-gpu-rutabaga-pci') is not a valid device model name.
I am a bit wary of running a VM with vga=none right now, I can’t figure out a way to communicate with it or even know its IP and I have to force it off. I tried checking the IP from within the VM but could not ssh to it (while when run via virt-manager, I could). Not sure how to connect through serial. Obviously not ideal for data integrity (I’ll make a drive copy…).
Any idea how to run it from the terminal just like using virt-manager but with VirGL + Spice display? As it is the only combination that does something now.
it is garbled only on Lunar Lake. Anyone with an Intel Battlemage GPU to test out others from this generation?
No, not garbled only on Lunar Lake. I have arc B580 and I have the same issue with virtual machine manager. Discovered the same issue on qemu too after some tinkering
but fails to start VirGL
You tested with both SDL and GTK displays? You can also try to run -display spice-app,gl=on with vga=qxl - Just make sure your parameter -name "OS" contains no spaces.
It works with a pretty loose definition of works. See those two lines of “graphics processor” - 2 being virgl that is jumbled, 1 being llvmpipe (vga=qxl) that displays a picture but its not 3d accelerated.
Sadly no, you cannot run VirGL + Spice display with qemu. I’d wager this jumbled mess is not limited to Intel graphics. Maybe we could have a confirmation from someone running nvidia/amd ( marks in the chat )
VirGL + GTK/SDL is very good when it works.
What is your device argument when trying to run rutabaga? I used this succesfully:
I found the site talking about requirements, check that you have the prerequisites listed here: https://gist.github.com/peppergrayxyz/fdc9042760273d137dddd3e97034385f
If you have all the prerequisites, then I’m at my wits end. We could try to summon someone with shorter hair & longer beard
I have to enable some sort of VGA because VirGL always fails to initialize and with vga none I can’t interact with the VM (will try the ssh manual but ugh, I much prefer the GUI to a zillion command line args). Maybe the Ubuntu qemu was indeed not built with the correct flags? This is the build log of the version currently installed on my system: amd64 build : 1:10.1.0+ds-5ubuntu2 : qemu package : Ubuntu – not sure where to find the flags. But the configuration does say:
Graphics backends
VirGL support : YES 1.1.0
Rutabaga support : NO
So we know why Rutabaga fails (I just replaced the device line with what you just wrote). Still, VirGL should work.
When I replaced sdl with gtk the display appeared with vga qxl. With vga none I just got a window saying “Display output is not active” but nothing about VirGL failing to initialize. The gtk window is nicer and at least has some VM controls and an option for serial connection (but again, not working due to a stupid pre-boot message from a broken piece of software this whole machine exists for, like the power down button for safe shutdown).
Adding hostmem=8G,blob=true,venus=true made no difference.
With vga none I just got a window saying “Display output is not active” but nothing about VirGL failing to initialize.
We are getting closer now, I think. I’ve had this appear too when I run with seabios (not ovmf/uefi, I’ll describe using that bit later) with vga none What happens with vga virtio? Because that has fixed the display output (seeing boot menu) & booting for me when I used seabios.
Get ovmf for your distro & find where the ovmf files are located. For fedora its edk2-ovmf and they can be found at /usr/share/edk2/ovmf/
Add this to your script:
With that, you should be able to see output of the window that popups when you run the script, even with vga off.
TBH, I don’t know the difference between all the OVMF_* -files, but I know from experience that CODE.fd works for cachyos & VARS.fd works for fedora but YMMV. Some guides direct you to use both CODE.fd and VARS.fd. OH, after reading archwiki:Unified_Extensible_Firmware_Interface#Testing_UEFI_in_systems_without_native_support - the reason for using two different OVMF-files seems to be that one is readonly & another is not… Figures haha, I was struggling with this earlier today.