From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7295F1FF14C for ; Fri, 26 Jun 2026 16:12:21 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2F2BF151BC; Fri, 26 Jun 2026 16:12:18 +0200 (CEST) From: Markus Frank To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v3 1/2] virtio-vga-gl: add OpenGL 4.6 and Vulkan (Venus) support Date: Fri, 26 Jun 2026 16:07:55 +0200 Message-ID: <20260626141044.311778-2-m.frank@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260626141044.311778-1-m.frank@proxmox.com> References: <20260626141044.311778-1-m.frank@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1782483095723 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.008 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm] Message-ID-Hash: RYBTWN4AEFCZHIMTTHKZT3XFQPD25YWH X-Message-ID-Hash: RYBTWN4AEFCZHIMTTHKZT3XFQPD25YWH X-MailFrom: m.frank@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Adding the 'blob=on,hostmem=' parameters to the 'virtio-gpu-gl' device allows the VM to use OpenGL 4.6. By default virtio-gpu-gl only supports up to OpenGL 4.3. If Vulkan support is needed, the 'venus=on' parameter is added to the 'virtio-gpu-gl' device, in addition to the two parameters required for OpenGL 4.6. The Venus protocol facilitates the translation of Vulkan API calls via the virglrenderer. To use it, the virgl-server package must be installed on the host. Set the default VirGL memory window to 2048 MiB, as having less could lead to instability inside the VM. Signed-off-by: Markus Frank --- src/PVE/QemuServer.pm | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 55e9f520..30d08f32 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -170,6 +170,20 @@ my $vga_fmt = { qw(cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio virtio-gl vmware) ], }, + 'virgl-features' => { + description => 'Enable support for OpenGL 4.6 and Vulkan with the VirGL GPU.', + type => 'string', + optional => 1, + enum => ['opengl4.6', 'opengl4.6+vulkan'], + }, + 'virgl-memory-window' => { + description => 'Set the VirGL host memory window. This option allocates' + . ' host memory to act as VRAM in the VM.', + type => 'string', + default => '2048', + optional => 1, + enum => ['512', '1024', '2048', '4096', '8192'], + }, memory => { description => "Sets the VGA memory (in MiB). Has no effect with serial display.", type => 'integer', @@ -1524,6 +1538,21 @@ sub print_vga_device { $pciaddr = print_pci_addr($vgaid, $bridges, $arch); } + my $virgl_param = ""; + my $virgl_mode = $vga->{'virgl-features'}; + if ($virgl_mode) { + my $virgl_memory_window = $vga->{'virgl-memory-window'} + // $vga_fmt->{'virgl-memory-window'}->{'default'}; + $virgl_param = ",hostmem=${virgl_memory_window}M,blob=on"; + + if ($virgl_mode eq 'opengl4.6+vulkan') { + $virgl_param .= ",venus=on"; + log_warn( + "missing virgl render server for Vulkan (Venus) support! Please install 'virgl-server'.\n" + ) if !-e "/usr/libexec/virgl_render_server"; + } + } + if ($vga->{type} eq 'virtio-gl') { my $base = '/usr/lib/x86_64-linux-gnu/lib'; die "missing libraries for '$vga->{type}' detected! Please install 'libgl1' and 'libegl1'\n" @@ -1532,9 +1561,12 @@ sub print_vga_device { die "no DRM render node detected (/dev/dri/renderD*), no GPU? - needed for '$vga->{type}' display\n" if !PVE::Tools::dir_glob_regex('/dev/dri/', "renderD.*"); + + } elsif ($virgl_mode) { + die "You need to use virtio-gl to enable OpenGL 4.6 or Vulkan support!\n"; } - return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}${edidoff}"; + return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}${edidoff}${virgl_param}"; } sub vm_is_volid_owner { -- 2.47.3