iXit / wine-nine-standalone

Build Gallium Nine support on top of an existing WINE installation
GNU Lesser General Public License v2.1
272 stars 23 forks source link

Make ninewinecfg disable CSMT by default #72

Closed unic0rn closed 4 years ago

unic0rn commented 4 years ago

I'm on Manjaro KDE. At least some distros have CSMT enabled by default. I've noticed it, because I'm using wine-staging, so I've found it in winecfg.

With CSMT enabled, nine has plenty of problems: serious rendering glitches, game hangs, possibly crashes (needs further testing). For example, on my A8-7600 nine couldn't even render the menu in Bayonetta properly and the game was hanging when trying to load a checkpoint. With CSMT disabled, everything works perfectly and performance is way above D9VK.

Winecfg in wine-staging even says that CSMT is deprecated. Why is it enabled by default is beyond me. That being said, I'm as far from being a Linux newbie as it gets, and it still took me a while to figure out that the cause of possibly all the problems I had with wine-nine (several games had glitches while they were all reported to be working properly by others) is CSMT. Disabling it by default and perhaps keeping the original value in some backup key seems like the best option.

axeldavy commented 4 years ago

There are two csmt, the nine internal one (which can be controlled manually with env var csmt_force=0 or 1), and the wine one. I guess you are talking of the latter.

Just to be sure of what you describe: You have csmt on, and then you turn on nine, you want csmt to be turned off.

The problem is that csmt affects other things than dx9. Dx11 for example. I'm sure other users would complain if we were disabling it.

The second thing is I thought that wine merged proper csmt support in their codebase, thus why the wine-staging version is deprecated. Does enabling CSMT in wine-staging leads to older CSMT code being used, or does it really turns off/on wine's current CSMT support. Anyone knows the answer ?

unic0rn commented 4 years ago

Then how about additional checkbox in ninewinecfg to disable the wine one, with short info that it may cause problems?

Because with nine it does cause problems, ton of them.

Or at the very least clear warning in readme on github. It's not a problem once a user knows, but I didn't see it mentioned anywhere at all, and random user is more likely to drop nine after seeing rendering glitches than to try switching every single wine setting via regedit, since if one uses regular wine, that's the only way to disable it.

As for CSMT in wine-staging, disabling it via winecfg flips the same registry key used by regular wine for CSMT. Also, looks like I misunderstood the deprecation info: https://forum.winehq.org/viewtopic.php?t=30706

Basically, it's one and the same, the only thing "deprecated" is the setting alone, since it's supposed to be enabled by default and stay enabled "because it works well enough". Yeah, for everything except nine.

Also, the fact it affects dx11 shouldn't matter, people are usually installing games in separate prefixes I think, or at least they should be. Still, checkbox instead of forced disabling should be fine.

axeldavy commented 4 years ago

We discussed about this among us, and the problem is that we don't understand how there could be the slightest interaction between wine csmt and nine. The problem is the checkbox workaround might help, but that's not a proper fix as it covers the real problem which wouldn't be fixed.

If there is other users complaining of the same issue I guess we can go for the checkbox until we figure out what is going on.

unic0rn commented 4 years ago

I have a bunch of updates waiting to be installed (kernel, mesa, usual rolling stuff), will test afterwards with Bayonetta and will report the result with exact package versions.

unic0rn commented 4 years ago

Long story short, it seems to be related to LAA, I didn't manage to replicate it exactly how it was, but allow me to explain.

Back then (older versions of all relevant packages, different kernel), I was trying to run Bayonetta with wine. I was getting garbled title screen, garbled menu screen, and hang when trying to load a checkpoint. I've disabled CSMT using winecfg, all those issues went away. Different one appeared (or rather, became visible) though, the game was crashing after few minutes of gameplay. Setting LAA flag on game's exe fixed that. I didn't test it back then with LAA set and CSMT enabled, it didn't cross my mind, I was just trying to get it to work.

Fast forward to now (Manjaro KDE, kernel 5.6.8, mesa 20.0.6, wine-staging 5.7, nine 0.5), enabling/disabling CSMT makes no visible difference (tested only launching the game and loading checkpoint), regardless of LAA flag being set or not. With LAA not set though, title screen looks fine, menu looks fine, checkpoint loads fine, but returning from the game to the title screen gives this:

image

And that's exactly what I was getting before few system updates right after game launch, only then menu was also garbled and then loading the checkpoint was hanging the game. All those things disappeared back then after disabling CSMT, all that with LAA not set.

Now, there's a slight possibility I was using different parameters back then (current tests done with WINEESYNC=1 thread_submit=true tearfree_discard=true vblank_mode=3 mesa_glthread=true GALLIUM_HUD=simple,fps wine Bayonetta.exe), but it doesn't change the fact it seems to be LAA-related. CSMT enabled made LAA-related problems more visible back then. Wether it was a coincidence, or if it may happen consistently with different games, I'm not sure. But if enabling CSMT in wine may trigger such problems, and - as I understand it - CSMT code in wine shouldn't even be in use when nine is active, checkbox-based workaround could help. As for fixing the main problem, wine needs an option for enforcing LAA, like proton has, to avoid tinkering with exe files using 3rd party utilities. Now, the question is wether setting LAA flag may cause other problems for any particular game, making it a no-go. If that's the case, and if the game may work fine with nine, but only with CSMT disabled, since enabling it will trigger LAA-related problems, there's no easy way around that other than disabling CSMT. A lot of "ifs", I know, but this whole thing is tricky enough to even reproduce.