How to enable 3d acceleration in KVM?

Got it working and ran benchmark tests last couple of hours under different conditions. You can verify it’s on by seeing the host GPU driver listed in glmark.

There was one more required tweak to get the vm to boot, namely configuring spice to connect locally or via UNIX sockets because remote GL is currently unavailable so this needs to be added too under the following settings block:

  <graphics type="spice">
      <listen type="socket"/>

Benchmark:

sudo apt install glmark2-x11

glmark2


Results:

Deeply disappointing.

With 3D enabled I got half the performance of without under comparable conditions (4 CPUs unpinned)

Without 3D I get 1/3 of the baremetal score. So with 3D that drops to 1/6.

Within the disappointing 3D on trials battery, it seems CPU no. does have a slight positive effect doubling the score from just assigning 1.

1 Like