From 9f979d9f3162b91045dcffc28674b5c10fe05c96 Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Fri, 29 Apr 2022 18:50:07 +0200 Subject: [PATCH] check prerequisites for virtio-gl display 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 Signed-off-by: Stoiko Ivanov --- PVE/QemuServer.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 8e7cfb86..1290f338 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.39.5