and exit early if they are not met.
The necessary libraries were taken from Thomas' post in our community
forum:
https://forum.proxmox.com/threads/.61801/post-466767 (ff)

The /dev/dri/renderD.* check is based on util/drm.c in the current
qemu source code.

Suggested-by: Thomas Lamprecht <t.lampre...@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.iva...@proxmox.com>
---
 PVE/QemuServer.pm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 8e7cfb8..1290f33 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1880,6 +1880,17 @@ sub print_vga_device {
        $pciaddr = print_pci_addr($vgaid, $bridges, $arch, $machine);
     }
 
+    if ($vga->{type} eq 'virtio-gl') {
+       if ( ! -e '/usr/lib/x86_64-linux-gnu/libEGL.so.1' ||
+           ! -e '/usr/lib/x86_64-linux-gnu/libGL.so.1') {
+           die "missing libraries for '$vga->{type}' detected (install libgl1 
and libegl1)\n";
+       }
+
+       if ( ! PVE::Tools::dir_glob_regex('/dev/dri/', "renderD.*")) {
+           die "no drm render node detected (/dev/dri/renderD*) - needed for 
'$vga->{type}' display\n";
+       }
+    }
+
     return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}${edidoff}";
 }
 
-- 
2.30.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to