From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id EC5101FF0E9 for ; Thu, 16 Jul 2026 08:44:23 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 0986E21376; Thu, 16 Jul 2026 08:44:23 +0200 (CEST) Message-ID: <8c161d95-f4f9-43fe-ad17-0b60ceb9cb8e@proxmox.com> Date: Thu, 16 Jul 2026 08:43:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH qemu-server] qemuserver: make base path of libGL and libEGL libraries architecture aware To: Kaiyang Wu , pve-devel@lists.proxmox.com References: <20260716032704.250445-1-wukaiyang@loongfans.cn> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20260716032704.250445-1-wukaiyang@loongfans.cn> 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: 1784184206483 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.039 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) 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: LW3WIDCZKX6BNRJFHHIIIKZFHP5YTS6S X-Message-ID-Hash: LW3WIDCZKX6BNRJFHHIIIKZFHP5YTS6S 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 CC: Kaiyang Wu X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 7/16/26 5:27 AM, Kaiyang Wu wrote: > 'print_vga_device' assumed x86_64 library path to look for 'libGL.so.1' > and 'libEGL.so.1', which leads to missing libraries error regardless of > whether 'libgl1' and 'libegl1' were installed or not, on architectures > other than x86_64. > > Make base path of the libraries architecture aware to correctly locate > the libraries on non-x86_64 architectures. > > Signed-off-by: Kaiyang Wu > --- > src/PVE/QemuServer.pm | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm > index 191ae549..1d740f81 100644 > --- a/src/PVE/QemuServer.pm > +++ b/src/PVE/QemuServer.pm > @@ -1540,7 +1540,15 @@ sub print_vga_device { > } > > if ($vga->{type} eq 'virtio-gl') { > - my $base = '/usr/lib/x86_64-linux-gnu/lib'; > + my $base; > + if ($arch eq 'x86_64') { > + $base = '/usr/lib/x86_64-linux-gnu/lib'; > + } elsif ($arch eq 'aarch64') { > + $base = '/usr/lib/aarch64-linux-gnu/lib'; > + } else { > + die "unsupported architecture $arch for '$vga->{type}'\n"; > + } > + i think this is wrong because 'arch' is the guest architecture, not the host one, but we need the library in the hosts context so doing my $host_arch = PVE::QemuServer::Helpers::get_host_arch(); and using that would be better IMO also, we could probably simply interpolate that: my $base = "/usr/lib/${host_arch}-lnux-gnu/lib"; (if that does not work because the arch string is not equivalent for the dirs, we could have a map: my $libs_map = { 'x86_64' => '/usr/lib/x86_64-linux-gnu/lib', ... }; and then do: my $base = $libs_map->{$host_arch} // die "unsupported..." (note that the snippets are just examples and untested) > die "missing libraries for '$vga->{type}' detected! Please install 'libgl1' and 'libegl1'\n" > if !-e "${base}EGL.so.1" || !-e "${base}GL.so.1"; >