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 when running on linux #91

Closed
FireMasterK opened this issue Jun 9, 2023 · 15 comments
Closed

Error when running on linux #91

FireMasterK opened this issue Jun 9, 2023 · 15 comments

Comments

@FireMasterK
Copy link

FireMasterK commented Jun 9, 2023

I just cloned the repository, and ran cargo build --release and ./target/release/rio.

Here's the error I got:

xkbcommon: ERROR: couldn't find a Compose file for locale "UTF-8" (mapped to "UTF-8")
thread 'main' panicked at 'Error in Surface::configure: Validation Error

Caused by:
    Parent device is lost
', /home/kavin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.16.1/src/backend/direct.rs:734:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: queue 0x56164ca13890 destroyed while proxies still attached:
  wl_buffer@42 still attached
  wl_buffer@41 still attached
  wl_buffer@40 still attached
  wl_buffer@38 still attached
  wl_buffer@39 still attached
  wl_subsurface@33 still attached
  wl_surface@32 still attached
  wl_subsurface@31 still attached
  wl_surface@30 still attached
  wl_subsurface@29 still attached
  wl_surface@28 still attached
  wl_subsurface@27 still attached
  wl_surface@26 still attached
  wl_subsurface@25 still attached
  wl_surface@24 still attached
  xdg_wm_base@22 still attached
  xdg_activation_v1@14 still attached
  zwp_text_input_manager_v3@13 still attached
  zwp_pointer_constraints_v1@12 still attached
  zwp_relative_pointer_manager_v1@11 still attached
  wl_seat@10 still attached
  wp_fractional_scale_manager_v1@9 still attached
  wp_viewporter@8 still attached
  wl_subcompositor@7 still attached
  wl_output@6 still attached
  wl_shm@5 still attached
  wl_compositor@4 still attached
  wl_registry@2 still attached

I'm using Wayland on Gnome 44.1 using a Radeon GPU.
The same error happens on the aur package.

I'm quite excited to try this project!

@raphamorim
Copy link
Owner

Hey there @FireMasterK , thanks for the issue.

Could try build with:

cargo build --release --no-default-features --features=wayland
WINIT_UNIX_BACKEND=wayland target/release/rio

@FireMasterK
Copy link
Author

Could try build with:

cargo build --release --no-default-features --features=wayland
WINIT_UNIX_BACKEND=wayland target/release/rio

Just tried this, but the error still persists, unfortunately.

@raphamorim
Copy link
Owner

hmm, i believe is the same problem as here:

The error message is from xkbcommon, but the crash is in directx mod from wpgu. Comming directly from wpgu /home/kavin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.16.1/src/backend/direct.rs:734:18 so isn't even reaching Rio code yet (breaks in surface creation).

Could be that one of the environment variables LC_ALL, LC_CTYPE, LANG is set to the empty string. Would you mind checking that?

@FireMasterK
Copy link
Author

image

This seems to be my environment variables, two variables are empty.

@raphamorim
Copy link
Owner

can you try with LC_CTYPE=UTF-8 and LANG=en_US.utf-8 (or empty LANG, as LANG=)?

@FireMasterK
Copy link
Author

Looks like the first xkbcommon error no longer occurs!

The second error still occurs like usual.

thread 'main' panicked at 'Error in Surface::configure: Validation Error

Caused by:
    Parent device is lost
', /home/kavin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.16.1/src/backend/direct.rs:734:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: queue 0x56469a752890 destroyed while proxies still attached:
  wl_buffer@42 still attached
  wl_buffer@41 still attached
  wl_buffer@40 still attached
  wl_buffer@38 still attached
  wl_buffer@39 still attached
  wl_subsurface@33 still attached
  wl_surface@32 still attached
  wl_subsurface@31 still attached
  wl_surface@30 still attached
  wl_subsurface@29 still attached
  wl_surface@28 still attached
  wl_subsurface@27 still attached
  wl_surface@26 still attached
  wl_subsurface@25 still attached
  wl_surface@24 still attached
  xdg_wm_base@22 still attached
  xdg_activation_v1@14 still attached
  zwp_text_input_manager_v3@13 still attached
  zwp_pointer_constraints_v1@12 still attached
  zwp_relative_pointer_manager_v1@11 still attached
  wl_seat@10 still attached
  wp_fractional_scale_manager_v1@9 still attached
  wp_viewporter@8 still attached
  wl_subcompositor@7 still attached
  wl_output@6 still attached
  wl_shm@5 still attached
  wl_compositor@4 still attached
  wl_registry@2 still attached

@raphamorim
Copy link
Owner

Great, could try same command with WAYLAND_DISPLAY=wayland-1? looks same issue as here gfx-rs/wgpu#2519

@FireMasterK
Copy link
Author

Thanks!

We now get a new error:

thread 'main' panicked at 'Failed to initialize any backend! Wayland status: NoCompositorListening X11 status: "backend disabled"', /home/kavin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.6/src/platform_impl/linux/mod.rs:757:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@raphamorim
Copy link
Owner

Maybe you could try with the DISPLAY env var set to :0 or :1?

like export DISPLAY=:0 or export DISPLAY=:1. Similar issue to bevyengine/bevy#4921

@bbx0
Copy link
Contributor

bbx0 commented Jun 9, 2023

In regards to the first issue. LC_CTYPE=UTF-8 is not valid on Linux (but on macOS I assume). The patch below resolves this by making it conditional. If an override is needed for Linux as well it would probably be LC_CTYPE=C.UTF-8. I can make a PR if that helps.

diff --git a/rio/src/main.rs b/rio/src/main.rs
index 0f4dac1..5c2c1e8 100644
--- a/rio/src/main.rs
+++ b/rio/src/main.rs
@@ -34,6 +34,7 @@ pub fn setup_environment_variables(config: &config::Config) {
     #[cfg(target_os = "macos")]
     platform::macos::set_locale_environment();
 
+    #[cfg(target_os = "macos")]
     std::env::set_var("LC_CTYPE", "UTF-8");
 
     #[cfg(target_os = "macos")]

Glad you found the AUR package. :) I use a similar setup with Gnome on Wayland (but with Nvidia). Can you share what your env is configured for? Mine looks as follows

$env |grep -i -e display -e xdg_session_type
XDG_SESSION_TYPE=wayland
GNOME_SETUP_DISPLAY=:1
WAYLAND_DISPLAY=wayland-0
DISPLAY=:0

@raphamorim
Copy link
Owner

oh yes I forgot to remove that in main.rs file. Don't need to add #[cfg(target_os = "macos")], you can actually remove since rio have already in https://github.com/raphamorim/rio/blob/main/rio/src/platform/macos/mod.rs#L13

@FireMasterK
Copy link
Author

Glad you found the AUR package. :) I use a similar setup with Gnome on Wayland (but with Nvidia). Can you share what your env is configured for? Mine looks as follows

$env |grep -i -e display -e xdg_session_type
XDG_SESSION_TYPE=wayland
GNOME_SETUP_DISPLAY=:1
WAYLAND_DISPLAY=wayland-0
DISPLAY=:0

I seem to have the same environment variables too! :p

@raphamorim
Copy link
Owner

Did you try with a different display @FireMasterK ? export DISPLAY=:1

@FireMasterK
Copy link
Author

Did you try with a different display @FireMasterK ? export DISPLAY=:1

Hi, apologies I forgot about this. I pulled the recent changes and ran it with this. A window does appear, and the terminal works!

It also appears to work without setting the DISPLAY variable too.

It doesn't seem to respect my system theme, and the cursor is a bit buggy, but it does work!
image

@raphamorim
Copy link
Owner

That's great!

@FireMasterK latest main has changes in the way theme are configured (compared to old versions) I believe might be that, check in https://raphamorim.io/rio/docs/

Thanks for the update 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants