Manjaro guest with wayland sluggish

With Wayland coming soon, I wanted to test it in a VM. But as soon as I enable Wayland within the guest Manjaro, the guest system feels sluggish. Every animation (opening/closing windows, mouseovers) is slow and causes CPU spikes, specifically in the kwin_wayland process.

In an X11 session, the guest has been running smoothly and without issues for years.

Host: Manjaro Stable
Guest: Manjaro Testing via SPICE & Virtio Video

It seems that video rendering requires more resources under Wayland. Can I change any settings in KVM to make it work better with Wayland? If so, which ones?

Heya,

My experience with kvm is to enable 3d acceleration & set the opengl to the device that renders in the display spice. But since it is a vm your mileage may vary depending on the host & workload.

Some settings I have set for a KDE manjaro vm that performs nicely on my system as a reference.

settings
 <memory unit="KiB">8388608</memory>
  <currentMemory unit="KiB">8388608</currentMemory>
  <vcpu placement="static">4</vcpu>

<cpu mode="host-passthrough" check="none" migratable="on"/>

<graphics type="spice">
      <listen type="none"/>
      <image compression="off"/>
      <gl enable="yes" rendernode="/dev/dri/by-path/pci-0000:09:00.0-render"/>
    </graphics>

<video>
      <model type="virtio" heads="1" primary="yes" device="virtio-vga-gl">
        <acceleration accel3d="yes"/>
      </model>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </video>

Thank you very much for your configuration settings. Until now, with all other settings the same as you, I hadn’t enabled 3D acceleration, but I decided to give it a try. Unfortunately, it didn’t make any difference. X11 snappy, Wayland still sluggish.

The emulated video is always horribly sluggish. (I usually have workarounds to bypass it entirely.)

Hardware acceleration is even more important in Wayland on its own. So if you want a usable desktop using virt-manager (I assume you are using), I believe this is your only hope.

I see you have started the first steps in at least attempting enabling 3D acceleration. What happened?

In the guest, what is the output of:

inxi -Gxxx

The host also needs working Mesa acceleration for virgl to work properly.

So what is the output of that same command on the host?

(So two inxis.)

So you are :100:% sure you are using the VirtIO driver and SPICE? (You can dynamically resize desktops just by resizing the window if you are doing it this way.)

I used to find VirtIO without SPICE was quicker, but it’s been a while since I’ve made the comparison. (And you lose a few pretty handy features, and resolution, losing SPICE.)

It may be easiest to provide your whole config.

sudo virsh dumpxml NAME

I also find anything with to do with the display stuttery without hugepages enabled. But I think we have to fix it before optimising it.

Have you considered testing it with a live session?
That way you could test the performance with your actual hardware without any emulation.

I have already tested Wayland native on different systems. No performance issues there. It’s just about the virtualisation. As my systems are heavily modified, I want to figure out how to deal with the cutbacks I’ve experienced with Wayland in a clean test environment.

I wasn’t denying the fact that there may be a problem.

We would need to start with more information.

That would be a minimum amount of information for us to attempt to reproduce it. And that’s only if it’s a glaring wide-spread bug, but it can be hardware specific to the host, or something else entirely.

Often when there is an issue, you will see errors and/or warnings generated in your logs, I would start on the guest. (But make sure to check the host’s logs as well.)

You can watch them live with:

journalctl -f

And there are tons of way to filter back through old logs. Just make sure to use the --no-pager option when copying, for pasting to here.

But the more information we have the better. Even post your entire logs from startup.

At least start by doing whatever UI task that’s problematic, while watching the logs on the guest.

We can’t help fix a problem without any information.