virglrenderer for 3d support

Yeah if you clone from latest master it'll have all relevant flags already enabled, so you'd only need to build the source as is then, alternatively one can also wait out a few weeks until we make our next qemu package bump and get it already enabled automatically.
Tnx for confirming, Tom! :)
 
Yeah if you clone from latest master it'll have all relevant flags already enabled, so you'd only need to build the source as is then, alternatively one can also wait out a few weeks until we make our next qemu package bump and get it already enabled automatically.

i am using the latest version but i still getting this error:

Code:
kvm: -display sdl,gl=on: SDL display supported is not available in this binary
stopping swtpm instance (pid 3960) due to QEMU startup error
TASK ERROR: start failed: QEMU exited with code 1

Code:
kvm: -display,egl-headless,gl=core: invalid option
stopping swtpm instance (pid 14552) due to QEMU startup error
TASK ERROR: start failed: QEMU exited with code 1

Code:
()
proxmox-ve: 7.1-1 (running kernel: 5.16.15-edge)
pve-manager: 7.1-10 (running version: 7.1-10/6ddebafe)
pve-kernel-helper: 7.1-13
pve-kernel-5.13: 7.1-8
pve-kernel-5.16-edge: 5.16.15-1
pve-kernel-5.16.15-edge: 5.16.15-1
pve-kernel-5.16.14-edge: 5.16.14-1
pve-kernel-5.16.13-edge: 5.16.13-1
pve-kernel-5.16.12-edge: 5.16.12-1
pve-kernel-5.13.19-5-pve: 5.13.19-13
pve-kernel-5.13.19-4-pve: 5.13.19-9
pve-kernel-5.13.19-2-pve: 5.13.19-4
ceph-fuse: 15.2.15-pve1
corosync: 3.1.5-pve2
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown2: 3.1.0-1+pmx3
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.22-pve2
libproxmox-acme-perl: 1.4.1
libproxmox-backup-qemu0: 1.2.0-1
libpve-access-control: 7.1-6
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.1-3
libpve-guest-common-perl: 4.1-1
libpve-http-server-perl: 4.1-1
libpve-storage-perl: 7.1-1
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 4.0.11-1
lxcfs: 4.0.11-pve1
novnc-pve: 1.3.0-2
proxmox-backup-client: 2.1.5-1
proxmox-backup-file-restore: 2.1.5-1
proxmox-mini-journalreader: 1.3-1
proxmox-widget-toolkit: 3.4-7
pve-cluster: 7.1-3
pve-container: 4.1-4
pve-docs: 7.1-2
pve-edk2-firmware: 3.20210831-2
pve-firewall: 4.2-5
pve-firmware: 3.3-6
pve-ha-manager: 3.3-3
pve-i18n: 2.6-2
pve-qemu-kvm: 6.2.0-2
pve-xtermjs: 4.16.0-1
qemu-server: 7.1-4
smartmontools: 7.2-1
spiceterm: 3.2-2
swtpm: 0.7.1~bpo11+1
vncterm: 1.7-1
zfsutils-linux: 2.1.2-pve1
 
Last edited:
As the error mentions, SDL support isn't built-in (lots of libraries added that most setups never use) and the egl-headless option format is wrong, it needs to be -display egl-headless,gl=core (i.e., a space, not a comma between the option and its value)
 
Hi,

I built the newer pve-qemu version, build log shows that virglrenderer dependency is added and enabled, libvirglrenderer1 is installed (as expected, since it is a Depends for pve-qemu-kvm), but it is still not a valid display option:

Code:
$ qemu-system-x86_64 -display ?
Available display backend types:
none
spice-app

This obviously causes qemu to fail if I try to use egl-headless in any way.

Code:
$ qemu-system-x86_64 -display egl-headless
qemu-system-x86_64: -display egl-headless: Parameter 'type' does not accept value 'egl-headless'

Can anyone help figure out what am I missing?

Code:
$ qemu-system-x86_64 -version
QEMU emulator version 6.2.0 (pve-qemu-kvm_6.2.0)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

From the build logs:
Code:
(snip)
Run-time dependency virglrenderer found: YES 0.8.2
(snip)
    virgl support                : YES 0.8.2
(snip)
[1612/3080] Compiling C object libcommon.fa.p/hw_display_virtio-gpu-virgl.c.o

Binary is linked:
Code:
$ ldd /bin/qemu-system-x86_64  | grep virgl
    libvirglrenderer.so.1 => /lib/x86_64-linux-gnu/libvirglrenderer.so.1 (0x00007f719df8b000)


Best regards,
Tiago
 
Last edited:
tl;dr pve-qemu-kvm source package needs to add libgbm-dev to Build-Depends as well as libgl1-mesa-glx to Recommends and then add an option to select virtio-vga-gl from the drop-down menu

To get egl-headless compiled-in I found that libgbm is needed, but it was not included in debian/control and it is checked via pkg-config - if it ever worked for somebody before I assume the build environment had gbm dev installed for some reason (I am using sbuild-qemu so I always get a clean build environment).

Adding libgbm-dev to debian/control Build-Depends fixed that part and now egl-headless shows up
Code:
$ qemu-system-x86_64 -display ?
Available display backend types:
none
egl-headless
spice-app

Still, to get a VM started I had to install libgl1-mesa-glx, so this needs to be added to pve-qemu package as Recommends or Suggests.

virgl is somewhat enabled on the guest:
Code:
$ dmesg | grep -i virgl
[    1.855512] [drm] features: +virgl +edid -resource_blob -host_visible

Unfortunately vlxgears/vlxinfo still use the default display device as Proxmox always adds it's own display, it gets used first. To workaround that I hacked /usr/share/perl5/PVE/QemuServer.pm to use virtio-vga-gl in place of vmware. With args: -display egl-headless,gl=core and after restarting pvedaemon.service I was finally able to use the host virgl - got about 3-5x speed improvement for a 5700G CPU+iGPU compared to the default virtio-vga or qxl drivers.

cheers!
 
Last edited:
tl;dr pve-qemu-kvm source package needs to add libgbm-dev to Build-Depends as well as libgl1-mesa-glx to Recommends and then add an option to select virtgl-vga-gl from the drop-down menu

To get egl-headless compiled-in I found that libgbm is needed, but it was not included in debian/control and it is checked via pkg-config - if it ever worked for somebody before I assume the build environment had gbm dev installed for some reason (I am using sbuild-qemu so I always get a clean build environment).

Adding libgbm-dev to debian/control Build-Depends fixed that part and now egl-headless shows up
Code:
$ qemu-system-x86_64 -display ?
Available display backend types:
none
egl-headless
spice-app

Still, to get a VM started I had to install libgl1-mesa-glx, so this needs to be added to pve-qemu package as Recommends or Suggests.

virgl is somewhat enabled on the guest:
Code:
$ dmesg | grep -i virgl
[    1.855512] [drm] features: +virgl +edid -resource_blob -host_visible

Unfortunately vlxgears/vlxinfo still use the default display device as Proxmox always adds it's own display, it gets used first. To workaround that I hacked /usr/share/perl5/PVE/QemuServer.pm to use virtgl-vga-gl in place of vmware. With args: -display egl-headless,gl=core and after restarting pvedaemon.service I was finally able to use the host virgl - got about 3-5x speed improvement for a 5700G CPU+iGPU compared to the default virtio-vga or qxl drivers.

cheers!

thanks a lot. this really helped me a lot!

but the is a small mistake in your original post

workaround that I hacked /usr/share/perl5/PVE/QemuServer.pm to use virtgl-vga-gl in place of vmware

should be virtio-vga-gl


my VM now running webgl benchmark is improved by about 2.5 times compared to previous without virgl

also please note that although i added libgbm-dev to debian/control
however i must manually install it so the compiler will compile with it correctly.

@t.lamprecht appreciate if you can have this covered in next release.
 
Last edited:
  • Like
Reactions: tdaitx
thanks a lot. this really helped me a lot!

but the is a small mistake in your original post

workaround that I hacked /usr/share/perl5/PVE/QemuServer.pm to use virtgl-vga-gl in place of vmware

should be virtio-vga-gl


my VM now running webgl benchmark is improved by about 2.5 times compared to previous without virgl

also please note that although i added libgbm-dev to debian/control
however i must manually install it so the compiler will compile with it correctly.

@t.lamprecht appreciate if you can have this covered in next release.
Hi,

Thanks for the feedback and the typo fix. I only made some loose comments as a reference for the developers so it made up a very bad tutorial, so I'm glad you were able to follow through it. ;-)

Hopefully the devs can now prepare a new package with the fixes in.

I highly recommend that you take a look at the sbuild-qemu package, it helps with having a clean build environment as well as automatically dealing with all the required dependencies. If you do so, I highly recommend diverting
Bash:
$ sudo dpkg-divert --rename --add /usr/bin/sbuild-qemu-create
and patching up /usr/bin/sbuild-qemu-create to build pve packages (there is probably a better way than this, but this was a quick hack)
Diff:
--- /usr/bin/sbuild-qemu-create.distrib    2022-04-18 14:23:56.853118673 -0300
+++ /usr/bin/sbuild-qemu-create    2022-04-18 14:23:47.581086480 -0300
@@ -57,4 +57,5 @@
         deb     {mirror} {dist} {' '.join(components)}
         deb-src {mirror} {dist} {' '.join(components)}
+        deb [trusted=yes] http://download.proxmox.com/debian bullseye pvetest
         """)
     if dist == 'experimental':
then just run
Bash:
$ sudo sbuild-qemu-create bullseye http://deb.debian.org/debian
copy the generated image into the default sbuild-qemu image directory (or you can specify the image dir when calling it later)
Bash:
$ sudo mv bullseye-autopkgtest-amd64.img ~/.cache/sbuild/
and to build packages just cd into the package directory and run (adjusting RAM)
Bash:
$ cd "deb source pkg dir"
$ sbuild-qemu -d bullseye --ram 8192
The build logs and generated binaries will be at the immediate top level directory.

cheers!
 
Last edited:
tl;dr pve-qemu-kvm source package needs to add libgbm-dev to Build-Depends as well as libgl1-mesa-glx to Recommends and then add an option to select virtio-vga-gl from the drop-down menu
The qemu-serve integration (at least in the backend) is simple and planned to do, and I'll retake a look at the qemu build, thanks for noticing us.
 
The qemu-serve integration (at least in the backend) is simple and planned to do, and I'll retake a look at the qemu build, thanks for noticing us.
I saw the changes on 6.0.2-4, thanks! With that only the actual virtio-vga-gl part is missing on the backend and the UI, so I went ahead and added patches for both in bug 3849.

cheers!
 
I saw the changes on 6.0.2-4, thanks! With that only the actual virtio-vga-gl part is missing on the backend and the UI, so I went ahead and added patches for both in bug 3849.

cheers!
The backend part is already applied in git: https://git.proxmox.com/?p=qemu-server.git;a=commitdiff;h=6f070e39dec2e6d1cc60718cc022b89c9a2b7355

Not so sure about adding the GUI part yet, on the one hand it's all rather technical preview and the future direction seems to go more in the direction of the same spirited, but vulkan based, venus, while on the other hand it works OK'ish enough already to be somewhat worthwhile to try for modern Linux VMs.

Anyhow, once the backend is bumped it's only a single time qm set VMID --vga virtio-gl to use it, so not that hard either.
 
Last edited:
not sure if it was just me, but after latest update i cannot change VM configuration anymore.

making any configuration change in the webui will return in this error.

1650720794811.png
 

Oh, I looked at the wrong place. That's great!

Just one thing: it seems the UI does not like dashes on the name/identifier for those items - at least it didn't work when I tried (but maybe I messed something else entirely?), that's why I changed from virtio-gl to virtiogl.

Not so sure about adding the GUI part yet, on the one hand it's all rather technical preview and the future direction seems to go more in the direction of the same spirited, but vulkan based, venus, while on the other hand it works OK'ish enough already to be somewhat worthwhile to try for modern Linux VMs.

Anyhow, once the backend is bumped it's only a single time qemu set VMID --vga virtio-gl to use it, so not that hard either.

Right, it makes sense. I was not aware of venus virtio project, seems to be working fine for Google, but as you said it will take even more time for distros to catch up on that: requires mesa 22.1 (at least) and some experimental flags to enable it. But it does seem nice! Glad to have more options here.
 
it seems the UI does not like dashes on the name/identifier for those items - at least it didn't work when I tried (but maybe I messed something else entirely?),

JavaScript object keys need to be quoted if they contain "advanced" characters like - or whitespace, so the change would be (confirmed working):

Diff:
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index fe5be283..e2a5e64a 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -593,6 +593,7 @@ Ext.define('PVE.Utils', {
        serial2: gettext('Serial terminal') + ' 2',
        serial3: gettext('Serial terminal') + ' 3',
        virtio: 'VirtIO-GPU',
+       'virtio-gl': 'VirGL GPU',
        none: Proxmox.Utils.noneText,
     },
 
You guys are awesome. I tried to follow but got lost easily. I know nothing about qemu, proxmox backend and required dependencies, I would require some guidance in order to test virgl.

it's only a single time qemu set VMID --vga virtio-gl to use it, so not that hard either.
Actually it is not that obvious for me. I am running pve-qemu-kvm 6.2.0-4 from Test Repo.
Then what?
qemu set VMID --vga virtio-gl is not a command line as qemu package does not exist.
I went into qm monitor VMID, issued the above command and same result.
Searched the web, found some qemu args in XML possible, but those were located into a libvirt/qemu.conf file that I don't have.


Now that I do have 6.2.0-4, what else do I need to install, type and where?

Sorry for bringing your smart brains back in the stone age. :)


Tnx!
 
You guys are awesome. I tried to follow but got lost easily. I know nothing about qemu, proxmox backend and required dependencies, I would require some guidance in order to test virgl.


Actually it is not that obvious for me. I am running pve-qemu-kvm 6.2.0-4 from Test Repo.
Then what?
qemu set VMID --vga virtio-gl is not a command line as qemu package does not exist.
I went into qm monitor VMID, issued the above command and same result.
Searched the web, found some qemu args in XML possible, but those were located into a libvirt/qemu.conf file that I don't have.


Now that I do have 6.2.0-4, what else do I need to install, type and where?

Sorry for bringing your smart brains back in the stone age. :)


Tnx!

qm set VMID --vga virtio-gl
 
Now that I do have 6.2.0-4, what else do I need to install, type and where?
I made a typo in the CLI command, it should have been qm not qemu (now edited), besides that you need to wait for a new qemu-server package version bump, should be available in a few days max.
 
Well that was the dumbest Linux question I've asked in at least 10 years. loll The worst part is I have used qm command a couple of times but never crossed my mind there was a typo. loll

You are certainly correct Tom, I am missing something cuz the output shows:

Code:
root@proxmox:~# qm set 101 --vga virtio-gl

400 Parameter verification failed.
vga: invalid format - format error
vga.type: value 'virtio-gl' does not have a value in the enumeration 'cirrus, qxl, qxl2, qxl3, qxl4, none, serial0, serial1, serial2, serial3, std, virtio, vmware'

qm set <vmid> [OPTIONS]

I am using TEST Repos, not compiling. That's part of what I want to do, which is test the actual packages and not hack into one.

I will patiently wait until the qemu-server is bumped in there. :)
What version # should I be looking for?

Tnx a lot!!!
 
  • Like
Reactions: janssensm
Well that was the dumbest Linux question I've asked in at least 10 years. loll The worst part is I have used qm command a couple of times but never crossed my mind there was a typo. loll

You are certainly correct Tom, I am missing something cuz the output shows:

Code:
root@proxmox:~# qm set 101 --vga virtio-gl

400 Parameter verification failed.
vga: invalid format - format error
vga.type: value 'virtio-gl' does not have a value in the enumeration 'cirrus, qxl, qxl2, qxl3, qxl4, none, serial0, serial1, serial2, serial3, std, virtio, vmware'

qm set <vmid> [OPTIONS]

I am using TEST Repos, not compiling. That's part of what I want to do, which is test the actual packages and not hack into one.

I will patiently wait until the qemu-server is bumped in there. :)
What version # should I be looking for?

Tnx a lot!!!
or you may manually apply this patch here

https://git.proxmox.com/?p=qemu-ser...5;hp=a183576e3038f9b06c3a6f23f694693386186591

"/usr/share/perl5/PVE/QemuServer.pm"
 
I will patiently wait until the qemu-server is bumped in there. :)
What version # should I be looking for?
It's now available on pvetest with qemu-server version 7.1-5.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!