Open jcbritobr opened 1 year ago
I had a similar error in my hello world application on ubuntu using rust 1.75 and egui 0.24. Upgrading to egui 0.25 fixed it .
Can anyone guide me that how should i fix this error. I am using WSL to run the rust.
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),
..Default::default()
};
eframe::run_simple_native("Rust Maven egui App", options, move |ctx, _frame| {
egui::CentralPanel::default().show(ctx, |_ui| {});
})
}
/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.5/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoCompositor)) }))
Is this using the glow
or wgpu
backend? (run with RUST_LOG=debug
and it will be printed)
Is this using the
glow
orwgpu
backend? (run withRUST_LOG=debug
and it will be printed)
it is solved bro. it was actually problem with the ubuntu updates as i updated to latest ubuntu in WSL2 windows but some issues was still there( i just update things accordingly).
MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
it is a warning, because the program has been execute successfully. Thanks for quick response.
@AvinashPrajapati can you tell me how to solve WaylandError(Connection(NoCompositor))?
@AvinashPrajapati can you tell me how to solve WaylandError(Connection(NoCompositor))?
If you are using WSL2 on Windows then this Wayland Error is because the WSL2 linux system can not display the render window the Egui trying to show. There is two solution
it will solve the problem.
For option 1:
I am currently using ubuntu24
❰ls❙/mnt/d/code❱✔≻ lsb_release -a
No LSB modules are available.
Distributor ID: Free
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble
The current WSL2 is already the latest version
PS D:\code> wsl --update
Checking for updates.
The latest version of Windows Subsystem for Linux is installed.
PS D:\code> wsl -v
WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.2314
For option 1:
I am currently using ubuntu24
❰ls❙/mnt/d/code❱✔≻ lsb_release -a No LSB modules are available. Distributor ID: Free Description: Ubuntu 24.04.1 LTS Release: 24.04 Codename: noble
The current WSL2 is already the latest version
PS D:\code> wsl --update Checking for updates. The latest version of Windows Subsystem for Linux is installed. PS D:\code> wsl -v WSL version: 2.3.26.0 Kernel version: 5.15.167.4-1 WSLg version: 1.0.65 MSRDC version: 1.2.5620 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.26100.2314
Ok just write down the very basic EGUI app that create a simple window that has label 'Hello WOrld' and reply me with the main.rs code.
sure. use vscode and WSL2 extension
Do I need to install Wayland?
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),
..Default::default()
};
eframe::run_simple_native("Rust Maven egui App", options, move |ctx, _frame| {
egui::CentralPanel::default().show(ctx, |_ui| {});
})
}
❰ls❙~/code/rust/wsl2egui(git≠master)❱✔≻ cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.16s
Running `target/debug/wsl2egui`
Error: WinitEventLoop(Os(OsError { line: 81, file: "/home/ls/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.5/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoCompositor)) }))
fatal: bad revision 'HEAD'
sure. use vscode and WSL2 extension
Do I need to install Wayland?
use eframe::egui; fn main() -> Result<(), eframe::Error> { let options = eframe::NativeOptions { viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]), ..Default::default() }; eframe::run_simple_native("Rust Maven egui App", options, move |ctx, _frame| { egui::CentralPanel::default().show(ctx, |_ui| {}); }) }
❰ls❙~/code/rust/wsl2egui(git≠master)❱✔≻ cargo run Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.16s Running `target/debug/wsl2egui` Error: WinitEventLoop(Os(OsError { line: 81, file: "/home/ls/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.5/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoCompositor)) })) fatal: bad revision 'HEAD'
Husss... your code is correct Man. The problem is same as from the above two. I want to know that why are you using the WSL2 even though the rust can be installed in windows system.
In fact, it’s just because I’m not used to using PowerShell. But there is still no problem in working normally under Windows.
Thanks for your reply, I plan to uninstall WSL2
Hello, good afternoon, I'm getting this warning after closing a eframe application on desktop
fedora 38 x64, 6.4.15-200.fc38.x86_64 linux rust 1.72.1 egui 0.23.0