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

No GUI on Wayland #24

Closed
trinukso opened this issue Jun 9, 2023 · 21 comments
Closed

No GUI on Wayland #24

trinukso opened this issue Jun 9, 2023 · 21 comments

Comments

@trinukso
Copy link

trinukso commented Jun 9, 2023

No GUI on Wayland. On X11 works.

@mtkennerly
Copy link
Collaborator

Please run this command in a console:

flatpak run --env=RUST_BACKTRACE=1 --env=RUST_LOG=debug com.github.mtkennerly.ludusavi

Then copy/paste the full output here, and attach a copy of your ~/.var/app/com.github.mtkennerly.ludusavi/config/ludusavi/ludusavi_rCURRENT.log log file.

@trinukso
Copy link
Author

@mtkennerly
Copy link
Collaborator

Hmm, I don't see any errors in there. Some questions for you:

  • Was there any console output?
  • Does the flatpak command fail, and if so, what's the exit code? Or does it keep running and just sit there in the console?
  • Does Ludusavi show up in the taskbar?
    • If so, what happens if you select it and then use a keyboard shortcut to maximize the window? Depending on your system, it might be logo + up arrow, alt + F10, or maybe another shortcut.

@trinukso
Copy link
Author

Was there any console output?

Anything. Attached a screenshot

Does Ludusavi show up in the taskbar?

No window visible... On X11 works.

Captura desde 2023-06-10 13-03-50

@mtkennerly
Copy link
Collaborator

That's strange. My guess is that this is either a problem in the Winit library or an issue with your graphics drivers.

To narrow it down, would you be willing to try the Winit examples? You would just need to install Rust and then run the following (this tests both the latest version and the version used by Ludusavi):

git clone https://github.com/rust-windowing/winit.git
cd winit
cargo run --example resizable

git checkout v0.27.5
cargo run --example resizable

Output should look like this:

image

@trinukso
Copy link
Author

None of them work in Wayland.

1
2

@mtkennerly
Copy link
Collaborator

Thanks. I took a look through some Winit tickets, and apparently that's normal since their examples don't draw anything inside of the window, and Wayland doesn't show the window until something inside is drawn. But there aren't any errors in your console output, so that's good at least.

The next question would be if there's an issue in Iced. One thing to note is that currently Ludusavi uses Iced with OpenGL, but Iced's next release is dropping OpenGL in favor of WebGPU (plus a software renderer fallback). If we're lucky, maybe those will end up helping here. To test it:

git clone https://github.com/iced-rs/iced.git
cd iced
cargo run --package counter

git checkout 0.9.0
cargo run --package counter
cargo run --package counter --features "iced/default_system_font iced/glow iced/tokio"

This is how it should look:

image

@trinukso
Copy link
Author

Thanks!

1
2
3

@mtkennerly
Copy link
Collaborator

Nice! So there's something going wrong with OpenGL specifically, but it'll be fixed by switching to WebGPU before too long. As soon as the next Iced release comes out, I'll update Ludusavi to use it. I'll leave this ticket open in the meantime.

I found some threads talking about the NoAvailablePixelFormat error:

One comment said that it's fixed in Mesa 18.x drivers, but that doesn't seem to be the case for everyone, and some comments suggested that there may be limitations around older hardware and virtual machines.

@trinukso
Copy link
Author

I don't know, my computer is not old.... Thanks for your attention and work.

Captura desde 2023-06-11 15-01-18
Captura desde 2023-06-11 15-01-29

@trinukso
Copy link
Author

Cetere... ĉu vi parolas Esperanton? Mi demandas al vi pri tio, pro la nomo de via aplikaĵo. 😅

@mtkennerly
Copy link
Collaborator

I don't speak it (unfortunately), but I do have an interest in linguistics :) The name comes from Latin ludus + Esperanto savi. 大学で日本語を勉強したし、at saka sumusubok akong matuto ng Tagalog.

@trinukso
Copy link
Author

Ha, bone! The Esperanto language has many roots in Latin. That's why I thought about it. Ĝis, kara!

@trinukso
Copy link
Author

The name comes from Latin ludus + Esperanto savi.

Do, mi proponas al vi esperantigi la nomon de via aplikaĵo: lud-sav-il-o xD

@BLACK4585
Copy link

Hey, sorry for writing here again, but seems like I have the same issue.
The window appears, but stays completely black. When I hover over the window, I can see there are some buttons using the changing mouse icon. I'm on Nobara Linux with NVIDIA.
I guess Iced 0.10.0 was already implemented a while ago, so this shouldn't be the error here. Using your command from above doesn't show anything in the console. Is there a way to debug this further, or if this is an error with the NVIDIA driver?

@mtkennerly
Copy link
Collaborator

@BLACK4585 I think it's normal that there's no console output, since that would be if it crashed outright. Could you send me a copy of ~/.var/app/com.github.mtkennerly.ludusavi/config/ludusavi/ludusavi_rCURRENT.log after running the command?

If you're willing to install Rust, you could try running the examples from Iced to verify how it behaves in isolation and whether the latest development version behaves better:

# latest development version
git clone https://github.com/iced-rs/iced.git
cd iced
cargo run --package counter

# version used by Ludusavi 0.24.3
git checkout 0.12.1
cargo run --package counter

@BLACK4585
Copy link

I just tested the iced examples and they also stay black. I got this error in another app, but sadly I don't remember anymore which app it was.
Here is my log:
ludusavi_rCURRENT.log

@mtkennerly
Copy link
Collaborator

Hmm, it could be an issue either in your drivers or in Winit, but it's hard to say. You could try opening a ticket in the Winit repo and see if they have some idea. That's beyond my area of expertise 😅

As a workaround, you could try forcing X11 for Ludusavi:

flatpak override --nosocket=wayland --socket=x11 com.github.mtkennerly.ludusavi

@BLACK4585
Copy link

Mhh also the workaround doesn't work.
Got some other people testing it and it worked but they are using an AMD card. Maybe the NVIDIA driver is messing up something.

@mtkennerly
Copy link
Collaborator

Looks like Winit checks some environment variables to determine if it should use Wayland. Could you try this?

flatpak run --unset-env=WAYLAND_DISPLAY --unset-env=WAYLAND_SOCKET com.github.mtkennerly.ludusavi

(It also needs the DISPLAY env var to be non-empty in order to use X11, so you may need to add --env=DISPLAY=:0 or similar.)

@BLACK4585
Copy link

Also doesn't help, I will ask the Nobara Community once more, I really think this is because of NVIDIA somehow..
Thank you for your help so far!
When I succeed in any way, I will let you know.

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