NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.99k stars 14.01k forks source link

element-destkop-wayland: Failed to load GLES library: libGLESv2.so.2 #158947

Closed nixbitcoin closed 9 months ago

nixbitcoin commented 2 years ago

Describe the bug

Starting element-desktop-wayland produces the following error message

[38:0210/110747.330884:ERROR:egl_util.cc(74)] Failed to load GLES library: libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory
[38:0210/110747.340808:ERROR:viz_main_impl.cc(161)] Exiting GPU process due to errors during initialization
[50:0210/110747.385964:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install element-desktop-wayland package
  2. Run element-desktop from command line
  3. See error message in command output and witness slow performance.

Expected behavior

element-desktop-wayland should use OpenGL under wayland and work smoothly.

Additional context

Probably related to https://github.com/siraben/nixpkgs/commit/8faa4ba586c2dec935b23a166305d40044bc2c70

Notify maintainers

@ma27 @fadenb @mguentner @ekleog @ralith @mjlbach @dandellion @sumnerevans @wmertens

RyanGibb commented 2 years ago

Same issue trying to run obsidian without xwayland:

% obsidian --enable-features=UseOzonePlatform --ozone-platform=wayland
2022-05-05 14:14:57 Loading updated app package /home/ryan/.config/obsidian/obsidian-0.14.6.asar
[3129454:0505/151458.112554:ERROR:object_proxy.cc(642)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[3129454:0505/151458.112642:ERROR:select_file_dialog_impl_portal.cc(243)] Failed to read portal version property
[3129454:0505/151458.130380:ERROR:cursor_loader.cc(114)] Failed to load a platform cursor of type kNull
zsh: segmentation fault (core dumped)  obsidian --enable-features=UseOzonePlatform --ozone-platform=wayland
[3129544:0100/000000.147346:ERROR:egl_util.cc(74)] Failed to load GLES library: libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory
GrabbenD commented 1 year ago

Same issue with GitKraken:

# gitkraken --enable-features=UseOzonePlatform --ozone-platform=wayland
[3984:0220/192307.792110:ERROR:egl_util.cc(74)] Failed to load GLES library: libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory
[3984:0220/192307.792724:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization
LaunchProcess: failed to execvp:
xdg-settings
[3947:0220/192307.867322:ERROR:cursor_loader.cc(116)] Failed to load a platform cursor of type kNull

Is there any workaround to this?

ppenguin commented 1 year ago

Any news on this? Recently vscode has been pretty unstable on wayland for me, often crashing on startup with the same error (but not always?!). (Later there are also some related warnings (e.g. wayland_surface.cc(149)] Server doesn't support zcr_alpha_compositing_v1.), but I think these are not supposed to be fatal... )

EDIT: Interestingly, if I find an instance of libglvnd-1.6.0 in my nix store, and just do

LD_LIBRARY_PATH=/nix/store/h20rb25nyc4jgcjnrs00mql7bx6glhlc-libglvnd-1.6.0/lib code --verbose | less

the error does not appear...

Might this be an issue with the libGLES bundled with electron (haven't checked how/whether electron is pulled in for vscode through nixpkgs or bundled upstream?)

GrabbenD commented 1 year ago

@ppenguin I switched to AMD, everything just works now.. Wish I did it sooner.

Anyway, this issue might be related https://github.com/NixOS/nixpkgs/issues/224332

joaojacome commented 1 year ago

Recently vscode has been pretty unstable on wayland for me, often crashing on startup with the same error (but not always?!). (Later there are also some related warnings (e.g. wayland_surface.cc(149)] Server doesn't support zcr_alpha_compositing_v1.), but I think these are not supposed to be fatal... )

Same happening here. I've no idea why vscode sometimes fails to find that lib.

--- UPDATE on vscode, it doesn't look like not finding that lib is causing it to crash. When I run code --verbose the error is still there, but it doesn't crash.

m-bdf commented 1 year ago

A workaround (tested for vscode) is to avoid using the GPU, by either enabling SwiftShader with --use-gl=angle --use-angle=swiftshader, or disabling hardware acceleration with --disable-gpu.

SuperSandro2000 commented 9 months ago

This was fixed on master, even if it wasn't probably the original issue anymore.