ValveSoftware / Proton

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

Compatibility with Reshade [dx9, dx11] #2908

Open jarrard opened 5 years ago

jarrard commented 5 years ago

Feature Request

Make reshade work with steamplay and proton.

UPDATE: Reshade can be made to work with most instances but often requires special environmental settings.

I confirm:

Description

Reshade.me works in wine dxvk but not proton and steamplay.

Justification

Everyone uses/needs it

Risks

None

References

None, first time on proton github

Tested Games (results)

Kingdom Come Deliverance:  dxgi.dll,64bit - (reshade works in 4.11 but ctd at menu problem)
War Thunder:               dxgi.dll,64bit - (reshade works with PROTON_NO_ESYNC=1) NOTE: Fails to exit correctly, requires manual closing of process (issue not present with lutris)
Risen 3 Titan Lords:       d3d9.dll,64bit - (works with D9VK)
jarrard commented 5 years ago

I'll keep testing and see how things go, but it should be noted that Wine and DXVK alone have no issues with reshade, it is steamplay itself that is causing a problem (maybe esync?).

I have got the reshade interface to work once or twice but strange things occur (missing/broken graphics, etc).

Let me know if you have had success with reshade and steamplay (within steam, not lutrix dxvk proton independant launchers).

HonkingGoose commented 5 years ago

For reference, here are links to the games mentioned in the original post by @jarrard.

692

2515

1283

aeikum commented 5 years ago

Interesting that it works in Wine+DXVK but not in Proton. We don't do much different from the other configuration. Can you describe what you did to test this? And attach a log of one of the crashes? Maybe it's some library incompatibility.

jarrard commented 5 years ago

I did manage to get KCD working with reshade in the end, tho that game experiences crashes etc which I'm trying to nail down.

Also got reshade working with D9VK enabled with Risen 3,

jarrard commented 5 years ago

I updated the main post, basically you can get it working with these games but needs special attention to do so. Note: Proton 4.11-1 seems to have a few issues atm, you may need to roll back to 4.2-9 for some games.

For example: Empyrion does not launch with 4.11 (works with 4.2) KCD will ctd at menu 90% of the time with 4.11

telans commented 5 years ago

I've been using Reshade v4.1.1.496 for quite a while with Borderlands GOTY Enanced (64-bit, DX11). Worked with Proton 4.2-9 and it does now with Proton 4.11-1

The only config option that crashes my game 100% of the time is Depth3D, but everything else is fine.

My launch options from within steam: WINEDLLOVERRIDES="dxgi=n,b;d3dcompiler_47=n" (dxgi.dll being the one from Reshade v4.1.1)

I have recently tested fsync and can confirm it works with that plus esync too. I always use DXVK built from master

jarrard commented 5 years ago

I've found I only need the n,b override on dxgi.

jarrard commented 2 years ago

From what I can tell reshade no longer works with proton/wine. Yes you can enable it but it causes freezing upon keyboard usage in all games I've tested so far, including different OS installs.

I don't see why my case would be special so will assume its no longer compatible!

For testing recently I used Kenshi and Stalker Anomaly with DX11 Reshade4 presets via DXGI.dll method (and d3d11.dll) Reshade loads fine, get into game and spend 1minute walking around WITH KEYBOARD, freeze happens. If gamepad or mouse is used then there is no freezing.

This issue has persisted across multiple OS installs, all recent proton versions also.

I have not tested much older proton versions which I'll be doing next.

Issue happens within gamescope also so likely isn't a plasma/kwin related bug but Wine/Proton/DXVK itself. Obviously linked to input method.

jarrard commented 2 years ago

Installed a new OS; Using Gnome; still keyboard input freezes up game.

Given this has only started happening since using a AMD GPU 6800xt I suspect its a MESA bug. Also would explain why almost nobody reports on it (most gamers use NVIDIA cards).

I may go for a 4070-80 next time around.

HereInPlainSight commented 2 years ago

NVIDIA user here! \o

I've noticed, if not the exact same issue, a very similar issue, but it's very... touch and go, I guess? It doesn't affect some games, like FFXIV, but it definitely affects others, like Skyrim SE.

I've been doing some testing, mostly with GShade as that's my shader provider of choice. So far, my tests have shown that I can move the keyboard or mouse, and everything's fine. I can plug in a controller and do whatever I want, no problem.

As soon as I try to use keyboard and mouse, at the same time, that's when it stutters. If I was just lightly moving the mouse, it may be a very short stutter. If I was really winging the mouse around, it'll be a long one. I've watched it with a PROTON_LOG=1, but the log doesn't even seem to register that anything happened at all while the freeze is happening. I'm not sure at all how to diagnose exactly where the issue's coming from at this point. I've rolled back proton versions and it happens in any version of Proton that can even get Skyrim SE to run for me in the first place.

That said, I do have mesa installed. It's required by a lot of other packages on my system, so it's not impossible that that's where the issue's coming from -- but I still wouldn't know how to diagnose it further since the Proton log's not showing anything when the freezes happen.

MagicD3VIL commented 2 years ago

Greetings, I can confirm this still being an issue on AMD Radeon RX 580.

System information

Kernel 5.15.28, KDE Plasma 5.20.4, Amdgpu drivers, X.org 1.20.14, Mesa 21.3.6, Option "TearFree" "true" Full System Information

I have installed these libraries using winetricks/protontricks: d3dx9 d3dx11 d3dcompiler_43 d3dcompiler_47 I have installed gshade by using this Linux install script.

Tested games

I've tested these games:

Detected Problems

In both games, just having reshade/gshade installed and running even without effects causes this issue: When you saturate the input stream enough (mashing keyboard keys + fast mouse movement) it seems the DirectX input handler overflows and freezes up the game.

The game fully freezes for about 30 seconds up to 1 minute and the audio cuts off, after that the game unfreezes and continues to operate normally until we saturate the input again. I can confirm this is happening on these tested Wine/Proton versions: Proton 5.21-GE, Lutris 6.14-4, Proton 6.21-GE-2, Lutris fshack 7.2. Changing DXVK versions from 1.7.1 through out up to 1.10L has not shown any change in the behavior. There is nothing regarding the freeze to be found in Wine/Proton log, DXVK log nor in reshade/gshade log.

I've tried using different input methods:

There is clearly some bug/regression that makes the hooked post-processor freeze the GPU rendering of the running process on receiving saturated input from the user.

jarrard commented 2 years ago

Yeah I've known about this and talked about it for some time now but until ALLOT more people report it, not much gets done.

Nobodies like me get very little attention when it comes to reporting such obscure use case bugs. If I still had my NVIDIA card I could do some testing as I'm 99% certain this is a mesa bug.

I used reshade extensively with my 1080Ti without issue, via wine/proton but that was a long time ago. (pre-RDNA2 launch)

MagicD3VIL commented 2 years ago

We have tested it together with @HereInPlainSight. Since I am on AMD and he is on Nvidia we have compared our results and after extensive testing, we came to the same conclusion that it is the bug you have reported.

nulldisk commented 2 years ago

I'm trying to setup Anomaly 1.5.1 and ran into this exact issue. I'm running GTX970 with Nvidia driver 510.54 on archlinux 5.16.11-arch1-1 with bare bones i3wm setup.

I am experiencing the exact behavior described above. I can move my mouse, I can press keys on my keyboard, but as soon as I press a key while moving my mouse at the same time the game freezes for few seconds.

I've been testing all possible permutations of Wine configs and libraries, trying to find one yielding different behavior and I've noticed that version 5.0-staging keeps freezing with any mouse input – I couldn't move the cursor at all without causing the game to freeze, even without touching the keyboard. I could still navigate the menu with the keyboard just fine though.

I've decided to test 5.0 next and to my surprise it actually worked. It is not perfect, there is still an issue with input handling in ReShade, but this time it is a bearable one. Now there are no more freezes in any case, however the input blocking in ReShade must be set to Pass on all input, otherwise the camera in game is having a seizure – it feels like 1px of movement is amplified by ReShade by million times and passed to the game and not blocked at all. I also observed that once I enable input blocking for a second and go back to Pass on all input the seizure stops, however my mouse range is now confined. Basically what happens is that now the game doesn't lock its hidden cursor in the middle and as soon as it reaches the edge of the screen it stops, therefore I can't rotate my camera any further. Or in other words: the camera control in game is now limited by the ReShade cursor, even if the overlay is hidden. The limitation only happens on the horizontal axis for some reason, the vertical movement has still full range of motion available, even if the cursor hits the edge of the screen. The only way to fix this is by completely restarting the game and making sure ReShade starts in Pass on all input mode. As long as I don't touch this setting everything seems to be working fine.

With that finding, I limited my config and started testing all Wine versions. I've skipped all 5.x-staging, because it seems they all share the same issue I've described before. I was running AnomalyDX11AVX.exe with ReShade 5.0.2 installed in Lutris 0.5.9.1 with DXVK v1.10L enabled. I was using Wine builds from this repo

Here are the results:

It seems the bug was introduced somewhere in version 5.15 of Wine

MagicD3VIL commented 2 years ago

@nulldisk regarding some of the Wine 5.x (staging) versions having issues with moving the mouse you mentioned can be directly related to this bug report https://bugs.winehq.org/show_bug.cgi?id=48726 originally mentioned here https://github.com/ValveSoftware/Proton/issues/580#issuecomment-416003323. The bug report, however, doesn't state when exactly was the bug fixed so might have to check the Wine changelog for that.

If you cannot open winecfg window on some Wine versions, try creating a fresh wineprefix using winetricks aka winetricks winecfg with that Wine version. If that works, feel free to update your list.

Cheers

HereInPlainSight commented 2 years ago

regarding some of the Wine 5.x (staging) versions having issues with moving the mouse you mentioned can be directly related to this bug report https://bugs.winehq.org/show_bug.cgi?id=48726 originally mentioned here #580 (comment). The bug report, however, doesn't state when exactly was the bug fixed so might have to check the Wine changelog for that.

Incidentally -- that's my wine ticket, and I do have more info on it, if you'd like.

That bug was fixed by this commit in wine-staging, which was first visible in staging 5.15. It was first introduced by this commit in an RC of staging 5.0.

As much as I wouldn't mind trying to run a bisect -- I can't find a version of proton where Skyrim works and the shader works, too. I don't have any of the other games mentioned in the thread. Can anyone run a bisect against Anomaly, using nulldisk's data on wine versions? (I'm assuming 6.x and 7.x branch are all broken, and this is simply a long-standing edge case that's gone unaddressed due to lack of notice / data.)

jarrard commented 2 years ago

Anomaly is a free game...

HereInPlainSight commented 2 years ago

Ah. I just did a search on Steam and didn't see it, and didn't really look further into it.

Heading to bed, but depending on how busy work is I'll see what I can find out about it tomorrow, unless anyone posts some links so I can just go straight for testing.


~9 AM update. Test prefix created after downloading the game from moddb. Thanks to MagicD3VIL, have Anomaly working in a prefix for testing after winetricking in d3dx11_43, d3dx9, and d3dcompiler_43.

nulldisk commented 2 years ago

If you cannot open winecfg window on some Wine versions, try creating a fresh wineprefix using winetricks aka winetricks winecfg with that Wine version. If that works, feel free to update your list.

I've tried that but it didn't help. I've figured this was related to an issue in some PlayOnLinux's Wine builds looking for libraries in wrong places for some reason. Anyway it's nothing related to this topic.

I've tested it again with different builds and updated my comment above. It seems the latest working version is 5.14 now.

I've also tried few staging builds in the same environment:

By "worse bug" I mean freezing on any mouse input mentioned before.

kisak-valve commented 2 years ago

Hello @nulldisk, while generally not enforced, please keep in mind that this issue tracker is focused on Proton, not upstream wine or wine staging builds provided by third parties. Your feedback appears to be out of scope for this project. There should be a more appropriate medium to discuss your particular flavor of wine.

nulldisk commented 2 years ago

Your feedback appears to be out of scope for this project. There should be a more appropriate medium to discuss your particular flavor of wine.

This discussion is about bringing compatibility with ReShade to Proton and it seems Wine is the reason why this problem exists in the first place, so I've figured that finding out where exactly this behavior started to happen would be a valuable information to potentially find out what change introduced the issue and helping to develop a potential patch. Determining that this bug is out of scope of Proton and should be addressed on Wine level is also a possible outcome after all.

That being said I am not exactly familiar with the relation of Proton and Wine, so I apologize for the incompetence.

jarrard commented 2 years ago

Proton is its own thing and applies fixes beyond wine/wine-staging backend. So its possible for Proton to get this fixed before wine itself does. AND may be faster and more helpful that way.

By "worse bug" I mean freezing on any mouse input mentioned before.

For me the bug occurs when keyboard and mouse are used. If I just don't touch keyboard, I can look around just fine. I think I could even click around in Kenshi also until touching keyboard which would trigger the problem.

At one point I thought it was a keyboard or mouse POLLING rate issue which has been a problem in the past (for wine) but couldn't seem to get any solution by fiddling with those up or down. I think my keyboard is at 250 or 500hz while mouse is at 1000hz. I tried lowering them at one point without avail...

nulldisk commented 2 years ago

For me the bug occurs when keyboard and mouse are used. If I just don't touch keyboard, I can look around just fine. I think I could even click around in Kenshi also until touching keyboard which would trigger the problem.

That's what I am referring to as "the bug" and what is happening to me as well with any recent build of Wine/Proton. I can use either the mouse or the keyboard but as soon as inputs start coming from 2 devices at the same time it starts freezing the game. I'm having troubles finding any game in my Steam library that would launch with older versions of Proton. The lowest I got was 5.0-10 and the issue was still there.

Older staging builds of Wine had this issue amplified where the freeze happened on any mouse input and I referred to it as "the worse bug" but it seems to have been fixed along the way.

HereInPlainSight commented 2 years ago

Ran a regression test and while typing up a bug report -- I found out it's already got a report, here, against the same commit that my bisect identified as the culprit. The wine dev who was looking into it a year ago wasn't able to reproduce it, so it wouldn't hurt to have more eyes on the thread (well, eyes and comments, really) to answer any questions they might have about hardware or what have you.

Given the similarities of the symptoms, I highly suspect that what I'm seeing in Skyrim via Proton is coming from this same bug.

jarrard commented 2 years ago

Just been using Kenshi and the problem still exists. I can confirm the issue of the freeze for ~10seconds happens when using keyboard AND mouse together, if you just use one or the other it seems to not occur!

Really wish a solution can be found for this reshade bug.

PS. I commented on that wine bug report.

Juppstein commented 2 years ago

For what it's worth, this problem occured when I tried reShade (latest version) two days ago in Dungeon and Dragons Online (either DX9 or DX11) using latest official Proton (not experimental). As long as you just stand there you can pan and zoom around without issues. But once you use keyboard input to run around you'll get freezes for several seconds when you look around with the mouse at the same time. The problem goes away when you disable reShade entirely, only disabling effects won't do it. You have to close the game, then for example rename dxgi.dll and start the game again.

tbechs commented 1 year ago

Just wanted to bump this issue, as it still exists. Tested STALKER: Anomaly with ReShade 5.7 and Wine 8.4, Proton experimental (March 2023), Proton 7.0-6 and Proton-GE 49,51,52, & 53

jarrard commented 1 year ago

Yeah I tested it recently with Stalker Anomaly Gamma and it did have the issue.
I think some old version of wine don't have the issue but I haven't got around to doing a test to find out which ones, and a bisect to maybe find the issue if I do find working wine versions.

You can also test with WineD3D instead of DXVK. Again, have not had the chance yet.

To be clear, the freeze up (lasts up to a minute sometimes) only occurs for me if I use keyboard and mouse at same time, if I pan around with JUST the keyboard or mouse alone it usually is fine. I have not tested controller yet.

HereInPlainSight commented 1 year ago

I think some old version of wine don't have the issue but I haven't got around to doing a test to find out which ones, and a bisect to maybe find the issue if I do find working wine versions.

Wine bug report shows the regression commit as 81d1c79dcda0eea8fd35b2dcc6dfa3c3a17e2393, which first showed up in wine-5.15. Wine-5.14 and earlier should not have this issue, though getting traction on the upstream issue would be great. Not that I have any idea how to get anyone's attention -- it seems to have stagnated and just fallen by the wayside before we even showed up.

jarrard commented 1 year ago

Hmm, could we just use some older dinput8 files and whatever else from 5.14? it seems like there may be a easy temp solution.

tbechs commented 1 year ago

I tested running Stalker Anomaly GAMMA using PortProton with Wine-8.4-Staging-TKG-AMD64 and the problem does not exist. I'm not sure why, but this configuration fixed the mouse+keyboard issue for me. Yes, sorry I know this is for Proton, but I feel it is relevant to point out that it works on another build.

I tested with wined3d a while back and it didn't fix the issue.

Update: Re-tested with Proton and Proton-GE and the issue came back. It seems something about the Wine TKG build fixes the issue.

Pop!_OS 22.04 LTS x86_64 Kernel: 6.2.6-76060206-generic CPU: Intel i7-6700K (8) @ 4.200GHz GPU: Nvidia 2080ti Driver 525.89.02

PortProton Settings:

jarrard commented 1 year ago

I just got a 4090 so I'll need to retest. Still have the AMD 7700x.

What is PortProton? is that a special build or do you just mean Portable Proton as in running it outside the Steam client?

tbechs commented 1 year ago

Yes you're correct, it's a utility to run Proton outside of Steam, but it can use various builds of wine. PortProton Github

Wine Builds The issue also seems to be fixed with Wine 8.4-Staging. So the Issue was fixed somewhere in the staging build of Wine... The staging build does implement some fixes that aren't in the main Wine branch. Maybe we can narrow down which one could be fixing the issue. That is a positive sign though, as staging patches usually make it into main branch eventually.

I don't think PortProton itself is part of the fix, as using Proton with PortProton still encounters the bug. It is just a convenient tool. This would also probably work with Steam Tinker Launch as you can install various wine builds using it. You use it by putting it in your steam compatibility tools folder and forcing the game to use it in steam.

tbechs commented 1 year ago

Wine 8.5 (dropped today) seems to have implemented the fix. I am not getting the input lag using main line Wine 8.5. Hopefully Proton will as well.

jarrard commented 1 year ago

That's good to hear. I have a 4090 now so not sure if it had the issue but probably. Will be testing under Linux soon.

HereInPlainSight commented 1 year ago

I could get 8.2 vanilla working without the issue in Stalker: Anomaly. However, my game kept failing to launch when I tried 8.1 and 8.0, so it's possible that the fix is in even earlier than that. (As it stands, I didn't start poking at the latter part of the 7.x series.) Long story short, it looks like this issue is doomed to die whenever Proton rolls past wine-8.2.

tbechs commented 1 year ago

That's strange, because Wine 8.4 did not work for me, unless I used the staging branch. Do you mean 8.2 staging?

tbechs commented 1 year ago

Ah, sorry. yes, staging worked at the time, I thought you meant main branch. Main branch 8.5 now works as well, so the fix seems to have made it into main.

HereInPlainSight commented 1 year ago

Apologies, I missed your last reply.

No, I tested against vanilla, without staging. 8.2 - 8.4 tags, built from source, tested against Stalker: Anomaly, via Lutris, just changing the wine build.

This issue was always finicky, though. We've seen people have the issue and not have the issue, and never found the common cause.

tbechs commented 1 year ago

Apologies, I missed your last reply.

No, I tested against vanilla, without staging. 8.2 - 8.4 tags, built from source, tested against Stalker: Anomaly, via Lutris, just changing the wine build.

This issue was always finicky, though. We've seen people have the issue and not have the issue, and never found the common cause.

Interesting... At least it seems there is a fix out there, hopefully it will make it's way to Proton!

Grimslade commented 1 year ago

I've been following this post for a little while now, and I'd like to report that Wine 8 (specifically 8.5) also fixes this issue for me. All of that ritual sacrifice I did "not" engage in seems to have paid off.

As was mentioned, this issue with Reshade (and Gshade) on Linux hasn't been discussed much elsewhere (thanks for posting this) and a common cause doesn't seem to have been identified, so I'll include some specs and info, just in case it might be useful to anyone looking into to this.

The system that was having this issue was a Clevo third-party derivative Laptop; in discrete GPU mode (so Optimus isn't installed, nor similar software). Arch (btw), linux-clear 6.2 kernel, KDE, KWin, Intel i7-6700HQ CPU, Nvidia GTX-980M. Not all games experienced this; the ones I came across were Fallout NV, and Stalker Anomaly (seems to be a running theme... who'd have guessed that the greatest engines ever conceived by human hands, Creation and X-Ray would be involved?) :'^( Also, the recent Proton 8.0 (uses Wine 8) didn't fix it, so with that and gathering from the above comments, it appears to resolve as of Wine 8.2.

I hope that info helps. Regardless, looks like the problem will be resolved in later versions of Proton soon anyway. Cheers.

kellerman commented 1 year ago

I had this problem with Assassins Creed, I could't launch it using Wine, but tested with Proton Experimental yesterday and it was now working fine.

jarrard commented 1 year ago

Tested out Kenshi with ProtonGE7-55 and it was freezing up, then I tried Proton Exp and the problem appears to be resolved. Finally! Lets hope a regression doesn't happen down the line. ;-|

MagicD3VIL commented 1 year ago

Has anyone tested if the issue is fixed with the latest GE-Proton8-4? Thanks