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

[Wayland + NVIDIA + WGPU] Error in Surface::configure: parent device is lost #3225

Closed
uncomfyhalomacro opened this issue Mar 9, 2023 · 14 comments
Labels
bug Something isn't working Wayland

Comments

@uncomfyhalomacro
Copy link
Contributor

uncomfyhalomacro commented Mar 9, 2023

What Operating System(s) are you seeing this problem on?

Linux Wayland

Which Wayland compositor or X11 Window manager(s) are you using?

WM: Wayland compositor RiverWM (Wlroots-based like SwayWM)
OS: openSUSE TumbleWeed

Also tested on Plasma Wayland. Same issue.

WezTerm version

20221119.145034.49b9839f+g221

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

No, and I'll explain why below.

No relevant commit that can fix it

Describe the bug

Crashes on Wayland. No Wezterm running.

To Reproduce

  1. Open a Wayland session -> In my instance, riverwm.
  2. Segfaults

Configuration

no config

Expected Behavior

Runs normally.

Logs

23:18:27.081  ERROR  wezterm_gui > running message loop: error during event_q.read_events protocol_error=Some(ProtocolError { code: 7, object_id: 0, object_interface: "<unknown>", message: "" }): Protocol error (os error 71); terminating

Anything else?

Going to test this on Plasma Wayland. I will update later

@uncomfyhalomacro uncomfyhalomacro added the bug Something isn't working label Mar 9, 2023
@uncomfyhalomacro uncomfyhalomacro changed the title [Wayland] Wezterm crashes on Wlroots 0.16.2 [Wayland] Wezterm crashes on latest Wlroots and latest KDE Plasma Wayland Mar 9, 2023
@uncomfyhalomacro
Copy link
Contributor Author

Updated. It crashes as well. It seems to have a problem with latest Wayland. Not just the wlroots implementation.

@uncomfyhalomacro
Copy link
Contributor Author

Tried latest git master. Same issue.

@smokeythemonkey
Copy link

Happens for me on Pop os / Gnome with wayland enabled

@pdanpdan
Copy link

Set the __EGL_VENDOR_LIBRARY_FILENAMES env variable to /usr/share/glvnd/egl_vendor.d/50_mesa.json (at least for PopOS)

@uncomfyhalomacro
Copy link
Contributor Author

/usr/share/glvnd/egl_vendor.d/50_mesa.json

That works. This might mean this is an NVIDIA Wayland issue?

@wez
Copy link
Owner

wez commented Mar 14, 2023

I'd suggest trying webgpu to see if that behaves any better:
https://wezfurlong.org/wezterm/config/lua/config/front_end.html#webgpu

@carschandler
Copy link

I'd suggest trying webgpu to see if that behaves any better:

https://wezfurlong.org/wezterm/config/lua/config/front_end.html#webgpu

Hi wez. We discovered that my issue #3244 is a duplicate of this and I've tried running with WebGpu on which allowed it to boot up but with extremely degraded performance and weird graphics errors. I've got some additional info over on that post.

@supermarin
Copy link

I'm observing this on wayland/sway but only when >1 instance is running. i.e. I can normally use 1 instance of WezTerm, but launching the second one crashes both.

@wez wez added the Wayland label Mar 28, 2023
@almereyda
Copy link

almereyda commented Apr 23, 2023

This is also being seen with the Flatpak on Ubuntu 23.04 in OpenGL mode. A window can still open, but doesn't hold for long, e.g. until a few keys are pressed. Opening a second instance instantly kills both.

Enabling WebGpu throws the error immediately here:

$ flatpak run org.wezfurlong.wezterm 
[destroyed object]: error 2: Buffer size (12x613) must be an integer multiple of the buffer_scale (2).
01:30:24.924  ERROR  wezterm_gui > running message loop: error during event_q.dispatch protocol_error=Some(ProtocolError { code: 2, object_id: 0, object_interface: "<unknown>", message: "" }): Protocol error (os error 71); terminating
$

Do we know of versions that are unaffected, and if, is there a way to downgrade the Flatpak?

@swsnr
Copy link
Contributor

swsnr commented May 8, 2023

I also see this issue on Gnome 44 on Arch Linux. No Nvidia or AMD card, just an Intel iGPU.

@uncomfyhalomacro
Copy link
Contributor Author

uncomfyhalomacro commented May 31, 2023

@wez I found out that this is not a wezterm issue, but a crate issue wgpu, Wayland library issue, specifically, wlroots and also NVIDIA issue.

It's an old issue as mentioned here gfx-rs/wgpu#2519

And I am seeing the same errors as well:

thread 'main' panicked at 'Error in Surface::configure: parent device is lost', /home/abuild/rpmbuild/BUILD/wezterm-20230408.112425.69ae8472/vendor/wgpu/src/backend/direct.rs:316:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: queue 0x5567ea017160 destroyed while proxies still attached:
  wl_display@1 still attached
dhat: Total:     89,537,428 bytes in 239,026 blocks
dhat: At t-gmax: 10,375,395 bytes in 2,933 blocks
dhat: At t-end:  7,293,968 bytes in 3,810 blocks
dhat: The data has been saved to dhat-heap.json, and is viewable with dhat/dh_view.html

Similar issues are referenced as well:

I will keep this open until their side gets resolved.

@uncomfyhalomacro uncomfyhalomacro changed the title [Wayland] Wezterm crashes on latest Wlroots and latest KDE Plasma Wayland [Wayland + NVIDIA + WGPU] Error in Surface::configure: parent device is lost May 31, 2023
@ymatsiuk
Copy link

ymatsiuk commented Jul 14, 2023

while on intel TGL GT2 + older wlroots/sway, the following fixed the crash

wlroots: f4eaab12a056e339b1b7548f211bb463ad064392
sway: 92244c87dbb85080c99eee10db9fed906117e169

~ ❯ grep wezterm ~/.config/sway/config
bindsym Mod4+Return exec wezterm start --always-new-process
exec wezterm start --always-new-process

NOTE: This is no longer working on the latest wlroots/sway revisions and seems to be related to #3996

@uncomfyhalomacro
Copy link
Contributor Author

Fixed on latest wezterm. Only issue now is to report for performance

@github-actions
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Wayland
Projects
None yet
Development

No branches or pull requests

9 participants