From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id BAAF81FF0AE for ; Tue, 01 Sep 2026 13:28:45 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4897021541; Tue, 01 Sep 2026 13:28:45 +0200 (CEST) Message-ID: <58c382e5-ed6e-4217-9e47-5107b7a0bcea@proxmox.com> Date: Tue, 1 Sep 2026 13:28:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH qemu-server v4 1/3] fix #6277: virtio-vga-gl: add OpenGL 4.6 and Vulkan (Venus) support To: Markus Frank , pve-devel@lists.proxmox.com References: <20260831094605.114396-1-m.frank@proxmox.com> <20260831094605.114396-2-m.frank@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20260831094605.114396-2-m.frank@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788262112404 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.587 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: RZ2TQMCO2ZNHDKUSBGYQMS2LF2LKT5AY X-Message-ID-Hash: RZ2TQMCO2ZNHDKUSBGYQMS2LF2LKT5AY X-MailFrom: d.csapak@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: some comments inline On 8/31/26 11:46 AM, Markus Frank wrote: > 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 > --- > v4: > * made the description of virgl-features more general > * added bugzilla number to commit message > > src/PVE/QemuServer.pm | 36 +++++++++++++++++++++++++++++++++++- > 1 file changed, 35 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm > index 63d8c135..65c4a804 100644 > --- a/src/PVE/QemuServer.pm > +++ b/src/PVE/QemuServer.pm > @@ -171,6 +171,20 @@ my $vga_fmt = { > qw(cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio virtio-gl vmware) > ], > }, > + 'virgl-features' => { > + description => 'Enable additional features on VirGL GPU.', > + type => 'string', > + optional => 1, > + enum => ['opengl4.6', 'opengl4.6+vulkan'], for now that seems fine, but I hope that does not explode when there are more (possibly independent) features arrive, e.g. consider that 2 new features (a, b) arrive and they don't depend on each other and also not on vulkan, we'd now have to add: 'opengl4.6+a', 'opengl4.6+b', 'opengl4.6+a+b' and the same for 'opengl4.6.+vulkan' so in total 6 new enum values for 2 new features That assumes of course that these new features are independent and directly related to virgl, which seems unlikely A feature list: 'opengl4.6;vulkan' could maybe help with that, but then it's not really possible to properly encode dependencies Not a blocker for me, but wanted to spell it out for others to read > + }, > + 'virgl-memory-window' => { > + description => 'Set the VirGL host memory window. This option allocates' > + . ' host memory to act as VRAM in the VM.', Here the unit is missing, please add something like below (e.g. 'in MiB') also, writing that these have to be powers of two can make sense here and explains why it's an enum of strings, instead of a number > + 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', > @@ -1549,6 +1563,23 @@ 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"; > + } > + } elsif ($vga->{'virgl-memory-window'}) { > + die "To use a VirGL host memory window, please select a compatible VirGL feature set.\n"; > + } > + > if ($vga->{type} eq 'virtio-gl') { > # VirGL renders on the host, so the guest arch is irrelevant for the library lookup > my $host_arch = get_host_arch(); > @@ -1560,9 +1591,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"; > } in addition to checking here on vm start, it might make sense to check these also in the api while setting, but not a must from me > > - 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 {