Frogging-Family / wine-tkg-git

The wine-tkg build systems, to create custom Wine and Proton builds
883 stars 159 forks source link

[winewayland.drv] "GameThread timed out waiting for RenderThread" (crash/freeze) in Sway #1147

Open GrabbenD opened 6 months ago

GrabbenD commented 6 months ago

This issue isn't specific to wine-tkg

My upstream bug report #56172 has been stale for weeks and I was hoping there's someone experienced here who can give advice on how to resolve this issue :)

Problem

Stacktrace

Detroit Become Human:

LowLevelFatalError [File:Unknown] [Line: 1209] GameThread timed out waiting for RenderThread after 120.00 secs

Question

Can I somehow disable the 120 seconds timeout / is there's any proper method to resolve this issue?

Tk-Glitch commented 5 months ago

That log output doesn't seem to come from wine and it seems to be the game timing out, which would point to Sway handling of the window being the issue here. I assume it works fine with xwayland/winex11.drv ?

GrabbenD commented 5 months ago

@Tk-Glitch

Yes that's correct, I can't reproduce this with XWayland driver in WINE.


My apologies for the confusion, the stacktrace is different or non existent depending on which game is tested (as you guessed). The one posted above was for Detroit Become A Human.

With Cyberpunk 2077 this dialog is displayed after leaving the game in a unfocused Sway Workspace for exactly 120 seconds:

Terminal:

wine: Unhandled exception 0x80000003 in thread 794 at address 000000014000634B (thread 0794), starting debugger...

Dialog:

The program REDEngineErrorReporter.exe has encountered a serious problem and needs to close. We are sorry for the inconvenience.

cyberpunk

More details button It's not possible to copy the content unfortunately: ![cyberpunk_2](https://github.com/Frogging-Family/wine-tkg-git/assets/45666572/c48425ce-4972-43bb-b901-36979e5b315e) ![cyberpunk_3](https://github.com/Frogging-Family/wine-tkg-git/assets/45666572/d64a69bf-9395-4bcb-b803-845602ef8592)
Arastais commented 5 months ago

Do you happen to be using an NVIDIA graphics card with the proprietary driver? This issue may not be specific to sway.

I'm not on sway (I'm on wayland GNOME), but had this issue on the native wayland driver (but not on the x11 driver) with a couple of games when I was on an NVIDIA GPU. It went away when I switched to an AMD GPU.

For me, games on the native wayland driver would basically semi-regularly but randomly freeze until I inputted something on the window (e.g. I clicked inside the game window or pressed a key). If it didn't input anything and just let it stay frozen, the game would time out after two minutes as you describe. I'd be as if the game would randomly unfocus (and thus stop rendering), even though I was playing it and wasn't alt-tabbed or anything.

Although, every now and then if I was "unlucky" it would hard freeze and no inputs would unfreeze the game - I'd have to kill the process through command line or something.

GrabbenD commented 5 months ago

Do you happen to be using an NVIDIA graphics card

I'm using 7900 XT and I've also been able to reproduce this with 6800 XT

@Tk-Glitch which would point to Sway handling of the window being the issue here @Arastais I'm not on sway (I'm on wayland GNOME)

There's some Reddit posts claiming to have the same issue with KDE too

Although I know that Sway doesn't render anything inside Workplaces which are unfocused. If you play a Youtube video in one workplace and switch to another, when you come back it will show you the last rendered frame before rendering a new one

v1993 commented 5 months ago

To repeat what I've commented on upstream bug: XWayland works this around by rendering frames once in a while even when rendering callback is not being invoked by Wayland compositor, exactly to prevent this kind of issues arising in X applications (which includes Wine under XWayland). Since Windows apps evidently also rely on rendering continuing to run at all times, Wine could fix this in its Wayland driver by also rendering frames once in a while (e.g. once per second) when app is invisible.