ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
24.17k stars 1.06k forks source link

Multiple games crash with Ryzen 3xxx #2927

Closed kisak-valve closed 3 years ago

kisak-valve commented 5 years ago

There's some reports of users upgrading their hardware to Ryzen 3xxx processors and games that were previously working for them are now failing with SGDT instruction cannot be used by applications. in dmesg and large Proton logs that are mostly full of access violations.

This issue report is to track the general umip compatibility of that processor generation.

References: https://github.com/ValveSoftware/Proton/issues/1417#issuecomment-516725375 https://github.com/ValveSoftware/Proton/issues/2386#issuecomment-516802877 https://github.com/ValveSoftware/Proton/issues/2909#issuecomment-515681003 https://github.com/ValveSoftware/Proton/issues/2909#issuecomment-516275599

2997

Workaround: Add clearcpuid=514 as a kernel boot option to disable UMIP support.

grigorig commented 5 years ago

The workaround (emulation of instructions) is probably not broken. The UMIP implementation simply elects to not emulate these instructions in 64-bit mode, though. See my post above which links to the source code. Since all affected games appear to be 64-bit, it works exactly as advertised.

I guess the idea behind this is that the emulation should only be needed for legacy 32-bit applications and that more recent 64-bit applications then have a more strict UMIP policy and should be fixed instead.

shmerl commented 5 years ago

more recent 64-bit applications then have a more strict UMIP policy and should be fixed instead.

Is that a problem with Wine that's using those instructions, or actual 64-bit games are doing it? There is no way to fix them if the later is the case.

stalkerg commented 5 years ago

the main question is it 32bit games or 64bit? If it happens for 32bit wine it means kernel bug if it still happens for 64bit wine it means Wine bug.

ashmonger commented 5 years ago

Same than @poke86, Wolfenstein:Youngblood works fine with the tweak.

jarrard commented 5 years ago

I'm using my 3600 now on kernel 5.0.0-21 (popOS) and haven't had any crashes yet. Is this only affecting certain kernel builds?

Vash63 commented 5 years ago

I'm using my 3600 now on kernel 5.0.0-21 (popOS) and haven't had any crashes yet. Is this only affecting certain kernel builds?

Have you launched any of the games listed in this thread? I have a 3900X and can duplicate it unless I enable the workaround. It's also possible popos has the workaround already but that seems somewhat unlikely given how recent this is.

jarrard commented 5 years ago

Sadly I don't have ANY of the games mentioned in this thread :(

Was keen on monster hunter world, next time it goes on special.

I might have GTA5 but thats on rockstars store app or something, been very long time since I even checked..

joeknock90 commented 5 years ago

@jarrard some games still worked fine for me. For instance: Sekiro was entirely playable without the workaround. Examples not working for me were Shadow of the Tomb Raider, Metro Exodus, and I THINK that Far Cry: New Dawn was also affected.

MuchiMuchiPink commented 5 years ago

Yeah, it's only a few games. The ones affected on my library are mainly all Capcom games. Doom 2016, Sekiro etc. all worked w/o the workaround.

poligarpi commented 5 years ago

After 1 week of troubleshooting I found this haha I was desperate to found a workaround for SOTTR, it is strange that all the other the proton games worked fine without this.

poligarpi commented 5 years ago

I'm using my 3600 now on kernel 5.0.0-21 (popOS) and haven't had any crashes yet. Is this only affecting certain kernel builds? no, it is certain proton games, lucky you

jarrard commented 5 years ago

Shadow of the Tomb Raider

I have Rise of the Tomb Raider, do you think that might be borked?

jarrard commented 5 years ago

Just had a system freeze on my 3600 with warthunder, think my system freezed yesterday also.,

No explanation for freeze.

Seji64 commented 5 years ago

Can anyone try it with Resident Evil 2 Remake, I have to wait for 26 hours to test it.

The workarounf fixes the problem for me also playing RE:2 Remake. Using manjaro @ 5.2 Kernel with systemd boot.

tybautf commented 5 years ago

Also same problem with F1 2019, I have this log in dmesg : umip: F1_2019.exe[29557] ip:158538f14 sp:2276e8: SGDT instruction cannot be used by applications.

zeitt commented 5 years ago

I just thought that I would confirm that with clearcpuid=514 I no longer encounter crash with SoTR or AC:Odyssey.

shmerl commented 5 years ago

Did anyone figure out a proper fix for it?

jarrard commented 5 years ago

Probably something for Linux 5.4

shmerl commented 5 years ago

@jarrard: did you see patches for it?

jarrard commented 5 years ago

Not yet, but it looks like Linux kernel 5.3 is pretty much wrapped up.

shmerl commented 5 years ago

I'm asking if anyone actually found a solution.

jarrard commented 5 years ago

I would like to know also, a proper solution not a workaround that is.

shmerl commented 5 years ago

Also, why are games even using this instruction to begin with?

logan001 commented 5 years ago

you are sure that kernel is at fault? it looks more like a wine bug. does it happens with native games on linux?

laichiaheng commented 5 years ago

@logan001 https://bugs.winehq.org/show_bug.cgi?id=47571 The WINE developers don't care. Native games are fine.

Termuellinator commented 5 years ago

Well, the Kernel does what it should - prevent instructions from userland (as the name UMIP implies ^^) I'm not sure why some windowsgames use these instructions (or is it wine that is mapping it wrong?), but i think wine is the area where this has to be fixed?

logan001 commented 5 years ago

well if native games works without problem that i guess wine should fix their software. but first they will blame everybody else as they seems to do and probably they will probably wait for some1 else to fix their software. after all there are so many patches to wine.....

Vash63 commented 5 years ago

@logan001 https://bugs.winehq.org/show_bug.cgi?id=47571 The WINE developers don't care. Native games are fine.

well if native games works without problem that i guess wine should fix their software. but first they will blame everybody else as they seems to do and probably they will probably wait for some1 else to fix their software. after all there are so many patches to wine.....

Can we please keep off topic chatter and insults to a minimum? This is a bug report thread, not a discussion forum. Many people are subscribed to the issue to track actual updates and solutions.

On top of that, this is Valve's official bug tracker, the bug was posted by someone affiliated with Valve, and Valve employs multiple Codeweavers employees with commit rights to wine. The idea that 'wine devs don't care' is frankly absurd and insulting.

laichiaheng commented 5 years ago

@Vash63 How is that bug report still UNCONFIRMED?

laichiaheng commented 5 years ago

Does anyone know any progress on this?

joeknock90 commented 5 years ago

Is it possible my initial Wine bug report does not accurately reflect the problem? I don't mean to be impatient. I simply don't want to muddle things by not accurately describing the problem on the wine bug tracker.

thorsten-passfeld commented 5 years ago

I would also be interested in more recent progress on this issue. This is really bad for Ryzen 3000 owners like me as well. A kernel boot parameter is not a sufficient solution I'd choose to put up with, but it may point us in the right direction to fix this issue, right?

shmerl commented 5 years ago

The kernel boot parameter simply disables support for that instruction. It doesn't really help fixing the issue the right way.

thorsten-passfeld commented 5 years ago

Yes, but can't the WINE devs implement something to detect the use of this instruction and provide a solution? e.g. ignore the instruction or run a different instruction that fits as a workaround? Not sure about that one at all, but for me it seems like it's in the hands of WINE devs.

mrpippy commented 5 years ago

I have reproduced the problem with multiple games, and am testing out a kernel patch which I'll send upstream shortly. For now, the clearcpuid=514 kernel argument should be used as a workaround.

thorsten-passfeld commented 5 years ago

I have reproduced the problem with multiple games, and am testing out a kernel patch which I'll send upstream shortly. For now, the clearcpuid=514 kernel argument should be used as a workaround.

Hey, is everything going fine so far? Any more information would be warmly appreciated!

mrpippy commented 5 years ago

Last week I sent a kernel patch upstream that adds SGDT/SIDT/SMSW emulation for 64-bit processes, it was merged and should be in v5.4.

Since then, 32-bit apps have been found which use the SLDT instruction (not emulated by the kernel in any mode): steamwebhelper.exe (from Steam for Windows), and GTA IV (launched from Proton).

I'm working on a patch for Wine itself that emulates all instructions for both 32- and 64-bit, so there won't be any need to patch kernels or wait for distributions to backport the kernel patch.

thorsten-passfeld commented 5 years ago

This is absolutely fantastic to hear! Great work! Very clean code as well. I like it!

laichiaheng commented 5 years ago

@mrpippy Is there any chance to see it in 5.3?

mrpippy commented 5 years ago

@mrpippy Is there any chance to see it in 5.3?

No, 5.3 is almost released.

skinnyraf commented 5 years ago

Train Sim World 2020 is also affected. It started crashing after a recent update and applying the clearcpuid=514 workaround allows it to run.

JAicewizard commented 5 years ago

After using clearcpuid=514 I am still getting system crashes when playing World of Tanks, although it is not running in proton but in wine 4.15. I also got this issue after upgrading to Ryzen 3xxx. https://bugs.winehq.org/show_bug.cgi?id=47768

laichiaheng commented 5 years ago

Last week I sent a kernel patch upstream that adds SGDT/SIDT/SMSW emulation for 64-bit processes, it was merged and should be in v5.4.

Since then, 32-bit apps have been found which use the SLDT instruction (not emulated by the kernel in any mode): steamwebhelper.exe (from Steam for Windows), and GTA IV (launched from Proton).

I'm working on a patch for Wine itself that emulates all instructions for both 32- and 64-bit, so there won't be any need to patch kernels or wait for distributions to backport the kernel patch.

It works with the 5.4rc kernel, thanks.

seansplayin commented 4 years ago

AMD Ryzen 3800x, Asus C8H, Ubuntu 19.04. Installed Kernal 5.4.0-050400rc6 using UKUU and Devil May Cry 5 is working again. **mrpippy you are amazing****

momumi commented 4 years ago

The workaround for games that need Media Foundation doesn't seem to work on the 3900x. I searched protondb, and I couldn't find anyone who got it to work using 3900x, however it seems to work for the other 3xxx parts with lower core counts.

I tried using kernel 5.4.0-rc8 and the clearcpuid=514 parameter, and it still didn't solve the issue for me.

jarrard commented 4 years ago

Can you manually disable 4 cores or so and test? I think there is a way to do this.

momumi commented 4 years ago

No sure how to disable cores specifically, but I disabled SMT and that fixed it!

kisak-valve commented 4 years ago

Hello @momumi, linux 5.4-rc1+ contains x86/umip: Add emulation (spoofing) for UMIP covered instructions in 64-bit processes as well which means that you are not affected by the issue tracked here and the workaround is not necessary.

momumi commented 4 years ago

Should I open a separate issue for my case then? This issue said This issue report is to track the general compatibility of that processor generation., but I'll open a separate one if that's better.

kisak-valve commented 4 years ago

That's a fair point, when this issue was opened the root cause was unknown and that comment is out of date. I've adjusted it to better reflect the issue tracked here.

A hyperthreading issue is distinctly different from the issue tracked here. You may have some luck tinkering with taskset. Maybe something like taskset -c 0-11 %command% in your game's launch options could have an effect?