How to get qemu/spice to be smooth?

I’m trying to get qemu graphical performance in virt-manager to be ‘smooth’ (respectable average fps of 60+ across the board for simple/non-3d applications without any lagginess/choppiness, just want a ‘smooth’ experience) without any passthrough shenanigans. I would like my vm experience to be indiscernable from my regular desktop experience under casual loads (like browsing, watching videos or other general desktop use things), it’s a lot harder than expected.

The problem is that anything short of vga passthrough seems to leave me with a choppy experience (I have actually done vga passthrough before and indeed it resulted in a silky smooth experience… But it’s a bit extreme for the kind of vm i have in mind this time)

I know even just software-rendering (straight up lava/llvmpipe) should be able to achieve this with contemptuous ease:

Virgl vs Swrast tests

Virtio/LLVMPipe XWayland: :ok_hand: (Ideal performance right here, at least if we go by numbers, but the experience despite the numbers is not smooth indicating an issue/limitation of qemu or spice or libvirt)

VirGL/LLVMPipe XWayland: :-1:

VirGL/VirGL XWayland: :face_vomiting:

VirGL/LLVMPipe X11: :man_shrugging:

VirGL/VirGL X11: :man_shrugging:

The only scenario where i get ideal performance and smoothness is ironically the only scenario where VirGL is completely disabled.

It’s interesting how VirGL performs way better on X11 than Wayland… And how laughably behind software rendering it seems to be, the only real reason to enable it is because unless it’s enabled, wlroots compositors have rendering errors (plasma wayland interestingly doesn’t have that problem).

As you can see virgl is garbage (seriously, this is just embarrassing) but llvmpipe and lavapipe are not and should be fully capable of rendering a smooth 60fps experience for me on qemu so long as it’s outside of gaming (and even sometimes while gaming really, if the game is really really old anyhow.

The conditions I’m hoping to satisfy are these:

  • Playing videos is smooth (Achieved)
  • Dragging windows is smooth (Not achieved)
  • Moving the cursor is smooth (Not Achieved)
  • Wlroots compositors render right (Without VirGL they have serious rendering artifacts, with VirGL active they render right but performance is worse (even if i use swrast instead) as you can see in above tests)

I really don’t understand how glxgears can run smoothly but dragging windows or moving the cursor around is laggy.

What I’ve tried:

  • 60fps patch (tho i set it to 120hz instead of 60hz), this should make it possble for conditions 1-3 to be met, and indeed I managed to fulfill condition 1, but for some reason not 2 and 3.
  • Using my nvidia gpu for virgl. Framerate went up a bit (less than you’d think, still lower than plain llvmpipe… it’s acceptably high though) but it’s a moot point if the spice rendering is too shit to display it.