Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zenity takes too long to launch (aborts on Fedora Minimal) due to GTK trying EGL #9268

Closed
ben-grande opened this issue May 29, 2024 · 26 comments · Fixed by QubesOS/qubes-gui-agent-linux#214 or QubesOS/qubes-core-agent-linux#506
Assignees
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: Fedora diagnosed Technical diagnosis has been performed (see issue comments). P: major Priority: major. Between "default" and "critical" in severity. pr submitted A pull request has been submitted for this issue. r4.2-vm-bookworm-stable r4.2-vm-fc39-stable r4.2-vm-fc40-stable r4.2-vm-fc41-stable r4.2-vm-trixie-stable r4.3-vm-bookworm-cur-test r4.3-vm-fc39-cur-test r4.3-vm-fc40-cur-test r4.3-vm-fc41-cur-test r4.3-vm-trixie-cur-test T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@ben-grande
Copy link

How to file a helpful issue

Qubes OS release

R4.2, Fedora 39.

Brief summary

Fedora 39 zenity takes too long to launch, it tests for hardware accelaration that are not present.

Ideally, these applications should be patched or an environment variable should be set to skip trying hardware acceleration when it is not available.

References:

Steps to reproduce

  • On Fedora Minimal with zenity installed:
$ time zenity --question --title "title" --text "text" --timeout 1
libEGL warning: DRI2: failed to authenticate
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
failed to load driver: zink

real    0m4.298s
user    0m0.515s
sys     0m0.266s
  • On Debian Minimal with zenity installed:
$ time zenity --question --title "title" --text "text" --timeout 1

(zenity:1089022): Gdk-CRITICAL **: gdk_atom_intern: assertion 'atom_name != NULL' failed

(zenity:1089022): Gdk-CRITICAL **: gdk_atom_intern: assertion 'atom_name != NULL' failed

(zenity:1089022): dbind-WARNING **: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

real    0m1.873s
user    0m0.086s
sys     0m0.020s
  • Timeout = 1
  • Realtime = real - timeout
  • Fedora real time: 3.298s
  • Debian real time: 0.873s

Expected behavior

GTK apps do not try hardware acceleration.

Actual behavior

GTK apps keeps trying hardware acceleration, taking much longer to launch applications.

@ben-grande ben-grande added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. labels May 29, 2024
@DemiMarie
Copy link

There are a couple of options here:

  1. Force GTK to use the deprecated Cairo renderer (GSK_RENDERER=cairo). This is not supported and is known to mis-renderer certain applications. It is also likely to go away in GTK5.
  2. Force Mesa to use llvmpipe.

@ben-grande
Copy link
Author

Thanks Demi!

I did not find how to force mesa to use llvmpipe, but I found LIBGL_ALWAYS_SOFTWARE:

$ export LIBGL_ALWAYS_SOFTWARE=0; time zenity --question --title "title" --text "text" --timeout 1
libEGL warning: DRI2: failed to authenticate
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
failed to load driver: zink

real    0m5.136s
user    0m0.474s
sys     0m0.250s
$ export LIBGL_ALWAYS_SOFTWARE=1; time zenity --question --title "title" --text "text" --timeout 1

real    0m3.611s
user    0m0.344s
sys     0m0.219s

If you set it to true, it "uses" software rendering but does not try to detect it apparently. There is also RUSTICL_ENABLE and GALLIUM_DRIVER that has the option llvmpipe, but I did not get results that matter.

@andrewdavidwong andrewdavidwong added C: Fedora needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. affects-4.2 This issue affects Qubes OS 4.2. C: gui-virtualization and removed needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. C: Fedora labels May 31, 2024
@ben-grande
Copy link
Author

My Fedora qube stopped split-gpg2 from working due to a recent upgrade in zenity.

As the split-gpg2 package calls zenity, it breaks when zenity breaks. Can the priority be bumped?

$ dnf list installed zenity
Installed Packages
zenity.x86_64                        4.0.1-2.fc40                        @fedora
$ zenity --question --title title --text text
libEGL warning: DRI2: failed to authenticate
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
Couldn't open libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory
Aborted (core dumped)

Using what Demi recommended above (GSK_RENDERER=cairo) works to render the dialog:

$ env GSK_RENDERER=cairo zenity --question --title title --text text
libEGL warning: DRI2: failed to authenticate
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen

But it is still checks for graphics acceleration which can make the dialog slow:

$ time env GSK_RENDERER=cairo LIBGL_ALWAYS_SOFTWARE=1 zenity --question --title title --text text  --timeout 1

real    0m2.256s
user    0m0.238s
sys     0m0.070s
$ time env GSK_RENDERER=cairo zenity --question --title title --text text  --timeout 1
libEGL warning: DRI2: failed to authenticate
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen

real    0m2.778s
user    0m0.363s
sys     0m0.144s

@ben-grande
Copy link
Author

Oh, and it is not possible to switch to a Debian qube as the split-gpg2 server because them it breaks when Fedora is the client. A gpg2 client cannot be newer than the gpg-agent server, it breaks. The client emits a warning, but it should be an error, anyway, this is a GPG bug just to explain why it can't be a Debian gpg server.

@ben-grande
Copy link
Author

Modifying splitgpg2/init.py to use:

        if subprocess.call(['env', 'GSK_RENDERER=cairo', 'zenity', '--question', '--title', short_msg,
                            '--text', question, '--timeout', '30']) != 0:

works in the meantime, but as per Demi's comment, it is not future-proof.

@DemiMarie
Copy link

@ben-grande can you report this to Fedora? That looks like a missing dependency, which indicates a packaging bug.

In the future, I think we should move away from Zenity and towards XDG notifications.

@andrewdavidwong andrewdavidwong added P: major Priority: major. Between "default" and "critical" in severity. diagnosed Technical diagnosis has been performed (see issue comments). waiting for upstream This issue is waiting for something from an upstream project to arrive in Qubes. Remove when closed. C: Fedora and removed P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. C: gui-virtualization labels Jun 17, 2024
@ben-grande
Copy link
Author

@ben-grande can you report this to Fedora? That looks like a missing dependency, which indicates a packaging bug.

[user@disp3784 ~]$ sudo find /usr/lib /usr/lib64 -name "libGLESv2.so.2" 2>/dev/null
/usr/lib64/libGLESv2.so.2
[user@disp3784 ~]$ rpm -qf /usr/lib64/libGLESv2.so.2
libglvnd-gles-1.7.0-4.fc40.x86_64

True, my template is based on Fedora minimal and doesn't have libglvnd-gles installed. The Full Fedora has it installed, but nothing ever requires, recommends or suggests it:

[user@disp3784 ~]$ rpm -q --whatrequires libglvnd-gles
no package requires libglvnd-gles
[user@disp3784 ~]$ rpm -q --whatprovides libglvnd-gles
libglvnd-gles-1.7.0-4.fc40.x86_64
[user@disp3784 ~]$ rpm -q --whatrecommends libglvnd-gles
no package recommends libglvnd-gles
[user@disp3784 ~]$ rpm -q --whatsuggests libglvnd-gles
no package suggests libglvnd-gles

Submitted report to upstream.

@ben-grande
Copy link
Author

ben-grande commented Jun 18, 2024

In the future, I think we should move away from Zenity and towards XDG notifications.

Zenity is used on Qubes many times as an interactive dialog rather than a notification that can be dismissed. Although XDG notifications supports specific actions, they are still notifications, not dialogs.

@DemiMarie Does it make sense to add to the file qubes-gui-agent-linux/appvm-scripts/etc/profile.d/qubes-gui.sh the following:

export GSK_RENDERER=cairo LIBGL_ALWAYS_SOFTWARE=1

Edit: In "does it make sense", I mean, will it causes problem in the future or if user is using hardware acceleration with GPU passtrough?

@ben-grande ben-grande changed the title Zenity takes too long to launch due to GTK trying EGL Zenity takes too long to launch (aborts on Fedora Minimal) due to GTK trying EGL Jun 18, 2024
ben-grande added a commit to ben-grande/qubes-gui-agent-linux that referenced this issue Jun 18, 2024
@andrewdavidwong andrewdavidwong added pr submitted A pull request has been submitted for this issue. and removed waiting for upstream This issue is waiting for something from an upstream project to arrive in Qubes. Remove when closed. labels Jun 19, 2024
@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.2 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.2 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.3 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bookworm-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.3 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.3-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-agent-linux has been pushed to the r4.3 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing trixie-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.3 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.3-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-agent-linux (including package core-agent-linux) has been pushed to the r4.3 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.3-current-testing

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: Fedora diagnosed Technical diagnosis has been performed (see issue comments). P: major Priority: major. Between "default" and "critical" in severity. pr submitted A pull request has been submitted for this issue. r4.2-vm-bookworm-stable r4.2-vm-fc39-stable r4.2-vm-fc40-stable r4.2-vm-fc41-stable r4.2-vm-trixie-stable r4.3-vm-bookworm-cur-test r4.3-vm-fc39-cur-test r4.3-vm-fc40-cur-test r4.3-vm-fc41-cur-test r4.3-vm-trixie-cur-test T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
5 participants