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

Error: lacking either libGL or libEGL so could not fallback to other #380

Closed
ClementNerma opened this issue May 12, 2021 · 11 comments
Closed
Labels
bug Something is broken native-glium Relates to running egui_glium on native

Comments

@ClementNerma
Copy link

ClementNerma commented May 12, 2021

Describe the bug
Getting the following error message when cloning the starter template (https://github.com/emilk/egui_template/) and compiling it with cargo run:

    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/egui_template`
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: GlutinCreationError(CreationErrors([NotSupported("lacking either libGL or libEGL so could not fallback to other"), NoAvailablePixelFormat]))', /home/XXXXXX/.cargo/registry/src/github.com-1ecc6299db9ec823/egui_glium-0.11.0/src/backend.rs:88:85
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'm running it on WSL 2 on Windows 10.

I followed the installation instructions and run apt install for all the required packages.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the https://github.com/emilk/egui_template/ repository
  2. Run cargo run (same result with cargo run --release)

Expected behavior
The example should work fine.

Desktop (please complete the following information):

  • OS: Debian 10 on WSL 2 on Windows 10 20H2
@ClementNerma ClementNerma added the bug Something is broken label May 12, 2021
@emilk
Copy link
Owner

emilk commented May 12, 2021

Does the examples at https://github.com/rust-windowing/glutin run?

@emilk emilk added the native-glium Relates to running egui_glium on native label May 12, 2021
@ClementNerma
Copy link
Author

ClementNerma commented May 12, 2021

Does the examples at https://github.com/rust-windowing/glutin run?

No, I get the exact same error message.

EDIT: I also tried to install libgl1-mesa-glx just to see and that doesn't change anything

@parasyte
Copy link
Contributor

I haven't tried this myself, but it seems you will need to install a WSLg driver for your GPU: https://devblogs.microsoft.com/commandline/wslg-architecture/#hardware-accelerated-opengl

@ClementNerma
Copy link
Author

I haven't tried this myself, but it seems you will need to install a WSLg driver for your GPU: https://devblogs.microsoft.com/commandline/wslg-architecture/#hardware-accelerated-opengl

Unfortunately WSLg isn't available in the stable channel for now. Besides, I think this should work correctly without it as many heavy GUI-based applications work fine with as long as there is an X server running.

@parasyte
Copy link
Contributor

Are you sure it's supposed to work on WSL2 stable? The GUI tutorial says this can only work on Windows 10 Insider Preview build 21362+ as of 2021-04-27.

@ClementNerma
Copy link
Author

Are you sure it's supposed to work on WSL2 stable? The GUI tutorial says this can only work on Windows 10 Insider Preview build 21362+ as of 2021-04-27.

As I said, it isn't available as stable for now.

But it's been possible to run GUI applications for a very long time already, by using a third-party X server like Xming.

WSLg is the next step in that direction, allowing to run applications natively on WSL with first-class support without using a third-party server, but it's not available in stable yet.

@parasyte
Copy link
Contributor

parasyte commented May 21, 2021

There might be some confusion.

An X server on Windows (like Xming or VcXsrv) is a remote X server. This works for the X11 protocol, but not for OpenGL. You will need either a hardware or software rasterizer for OpenGL support in WSL. If you cannot use WSLg (especially its hardware rasterizer), then you might be able to use a software rasterizer like libgl1-mesa-swx11 or gallium llvmpipe.

@ClementNerma
Copy link
Author

I see, so in that case it will probably require to wait for WSLg in order for egui to be compatible with WSL at all.

@parasyte
Copy link
Contributor

It depends on the backend you want to use. If you are required to use the egui-glium backend, then yes, you will need OpenGL support. But hypothetically even a TUI backend could be written that will render egui into the terminal. 😉 Or a backend that uses X11; your remote X11 server should work with that.

The trouble is, to my knowledge, none of these backends currently exist.

@ClementNerma
Copy link
Author

It depends on the backend you want to use. If you are required to use the egui-glium backend, then yes, you will need OpenGL support. But hypothetically even a TUI backend could be written that will render egui into the terminal. 😉 Or a backend that uses X11; your remote X11 server should work with that.

The trouble is, to my knowledge, none of these backends currently exist.

Ok I understand, so it's more like we'll need WSLg to use the OpenGL backend provided in the examples.

@emilk
Copy link
Owner

emilk commented Dec 29, 2023

The egui_glium backend has been moved out to a separate repo (https://github.com/fayalalebrun/egui_glium), so I'm gonna close this issue

@emilk emilk closed this as completed Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken native-glium Relates to running egui_glium on native
Projects
None yet
Development

No branches or pull requests

3 participants