public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH qemu-server] qemuserver: make base path of libGL and libEGL libraries architecture aware
@ 2026-07-16  3:26 Kaiyang Wu
  2026-07-16  6:43 ` Dominik Csapak
  0 siblings, 1 reply; 3+ messages in thread
From: Kaiyang Wu @ 2026-07-16  3:26 UTC (permalink / raw)
  To: pve-devel; +Cc: Kaiyang Wu

'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 <wukaiyang@loongfans.cn>
---
 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";
+        }
+
         die "missing libraries for '$vga->{type}' detected! Please install 'libgl1' and 'libegl1'\n"
             if !-e "${base}EGL.so.1" || !-e "${base}GL.so.1";
 
-- 
2.52.0




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH qemu-server] qemuserver: make base path of libGL and libEGL libraries architecture aware
  2026-07-16  3:26 [PATCH qemu-server] qemuserver: make base path of libGL and libEGL libraries architecture aware Kaiyang Wu
@ 2026-07-16  6:43 ` Dominik Csapak
  2026-07-16  7:39   ` superseded: " Kaiyang Wu
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Csapak @ 2026-07-16  6:43 UTC (permalink / raw)
  To: Kaiyang Wu, pve-devel; +Cc: Kaiyang Wu



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 <wukaiyang@loongfans.cn>
> ---
>   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";
>   





^ permalink raw reply	[flat|nested] 3+ messages in thread

* superseded: [PATCH qemu-server] qemuserver: make base path of libGL and libEGL libraries architecture aware
  2026-07-16  6:43 ` Dominik Csapak
@ 2026-07-16  7:39   ` Kaiyang Wu
  0 siblings, 0 replies; 3+ messages in thread
From: Kaiyang Wu @ 2026-07-16  7:39 UTC (permalink / raw)
  To: Dominik Csapak, pve-devel; +Cc: Kaiyang Wu

https://lore.proxmox.com/pve-devel/20260716073544.284241-1-wukaiyang@loongfans.cn/#t

On 2026-07-16 14:43, Dominik Csapak wrote:
> 
> 
> 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 <wukaiyang@loongfans.cn>
>> ---
>>   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";
> 
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-16  7:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16  3:26 [PATCH qemu-server] qemuserver: make base path of libGL and libEGL libraries architecture aware Kaiyang Wu
2026-07-16  6:43 ` Dominik Csapak
2026-07-16  7:39   ` superseded: " Kaiyang Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal