ValveSoftware / Proton

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

dlssg-to-fsr3 mod with Proton #7361

Open Zenzi0 opened 11 months ago

Zenzi0 commented 11 months ago

Feature Request

I confirm:

Description

Is it possible to use this mod with Proton? It replaces Nvidia Frame Generation with FSR3 in games like Cyberpunk 2077, The Witcher 3 and others. https://github.com/Nukem9/dlssg-to-fsr3/releases

Justification [optional]

Risks [optional]

References [optional]

xdiban commented 11 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1872476276

How can I install 535.29.06 drivers in Arch? I couldn't find that nvidia version. Do you meant 545.29.06?

MichaelGoodale commented 11 months ago

Yes, you need to use 545.29.06

Obamium69 commented 10 months ago

I'm a little lost😅. I've built and used the fork from @MichaelGoodale (https://github.com/MichaelGoodale/wine-tkg-git). When I start the game, it has a red tint as described in the previous comments. However, I'm using driver version 545.29.06.

ammon-github commented 10 months ago

Thanks to @Saancreed and @MichaelGoodale's effort, I also have built successfully by using the fork from @MichaelGoodale! My environment is "Ubuntu22.04LTS" with Lutris and "Nvidia 545.29.06". At first, the same red tint issue as @MrDuartePT, and @Obamium69 happened. It was due to the wrong versions of DIVX, VKD3D, and NVAPI in Lutris. After using the DIVX, VKD3D, and NVAPI of this "WINE-TKG" build, everything looks fine now.

xdiban commented 10 months ago

@MichaelGoodale I'm unable to build your fork in Arch Linux. Am I missing any extra dependency?

Obamium69 commented 10 months ago

Thanks to @Saancreed and @MichaelGoodale's effort, I also have built successfully by using the fork from @MichaelGoodale! My environment is "Ubuntu22.04LTS" with Lutris and "Nvidia 545.29.06". At first, the same red tint issue as @MrDuartePT, and @Obamium69 happened. It was due to the wrong versions of DIVX, VKD3D, and NVAPI in Lutris. After using the DIVX, VKD3D, and NVAPI of this "WINE-TKG" build, everything looks fine now.

Thanks for the tip. I've forgot to change to DIVX, VKD3D, and NVAPI versions of this "WINE-TKG" build. Now its working.

Calculus8303 commented 10 months ago

@MichaelGoodale I'm unable to build your fork in Arch Linux. Am I missing any extra dependency?

I think something about a folder error when building dxvk, it struggles to change folder to dxvk-master, then the omm patch fails due to a bunch of dependant files missing in src (apparently, there should be other project sources or symlinks to them, but they are not created because something tripped over). I've spent an obscene of time on this so far and close to building each subproject manually at this point.

ryzendew commented 10 months ago

@MichaelGoodale I'm unable to build your fork in Arch Linux. Am I missing any extra dependency?

ya his build no longer works

ryzendew commented 10 months ago

could someone with a working build with hag patches of proton add me on discord and dm it please therealmattscreative thanks!

MrDuartePT commented 10 months ago

@Saancreed I gonna try to build wine-staging-9.0-rc4 but the patch seems to apply without problems

MrDuartePT commented 10 months ago

Well testing with wine-9.0-rc4 prove to be a suceess and seems to be more stable in game: image

Also in cybenpunk and wither if you edit the user config files you can force it to use Nvidia Reflex: on + boost with DLSS-G on

Note: After about 2h+ of gaming just crash once

gilvbp commented 10 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1889526454

Could you test with wine 9.0-rc5?

https://www.phoronix.com/news/Wine-9.0-rc5-Released

Thanks

MrDuartePT commented 10 months ago

Replying to #7361 (comment)

Could you test with wine 9.0-rc5?

https://www.phoronix.com/news/Wine-9.0-rc5-Released

Thanks

Seeing the changelog not seems to change much but I can try anyway I think was the mod that crash the games (but didn’t activate log at the time)

tuxrinku commented 10 months ago

Could someone share their wine build patched with hags ? Or is there some easy to follow guide to build wine with this patch ? Thank you !

gilvbp commented 10 months ago

Could someone share their wine build patched with hags ? Or is there some easy to follow guide to build wine with this patch ? Thank you !

I used the following steps:

https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1872476276

hotcapy commented 10 months ago

Works cool on 2070! For anyone having issues with commands/files/directories during build, don't forget to set your distro in proton-tkg.cfg, for script be able to install build-time dependencies (see Wiki).

I have two questions.

  1. Is there any way to compensate lack of VRR (Nvidia GPU + FreeSync monitor) due to turned off VSync? I have much more FPS in every DLSS mode, but moving picture is not as smooth :-(

For example, on Windows mod's author recommends to force VSync via Nvidia control panel. In theory, would externally-forced VSync break Reflex, Frame Generation, or both? And is it even possible for Vulkan app on Linux? I only know that compositor like Picom can VSync my web browser, but I believe it's totally different thing - Firefox isn't a Vulkan game.

  1. What is the correct way to force Reflex mode to "Enabled + Boost" through config file? Make UserSettings.json read-only?

With Frame Generation enabled, Reflex setting is greyed out at "On" position.

When config is writable, and if edited manually, game restores it to "Enabled" on launch. When read-only, changes made are not reflected in game settings. Is it fine? Works anyway?

hotcapy commented 10 months ago

Yes, I did - just like on your screenshot. And using same environment variables.

Didn't you forget to also import registry file, like described on Nexus mod page? You can do it with Wine's regedit. In case of Steam, you should be able to get there via Protontricks.

My setup is a bit different. I have GOG version, extracted from offline installers with innoextract. To make prefix management simpler, I run it with Lutris runtime. So, there is no Steam in my case. But all of it should not matter in any way, there is no difference whether it's Steam, Lutris or plain Wine.

I'll try to describe my steps in detail. Perhaps too much detail. I hope it can help :-)

1. Make proton-tkg.

$ git clone https://github.com/MichaelGoodale/wine-tkg-git.git $ cd wine-tkg-git/proton-tkg $ nano proton-tkg.cfg _nomakepkg_dep_resolution_distro="archlinux" $ ./proton-tkg.sh

If asked, agree to continue w/o Steam installed. Choose option "4" for Wine version. When asked, agree to apply userpatches.

2. Copy resulted build to required system directory.

Steam: $ cp -R /home/user/wine-tkg-git/proton-tkg/built/proton_tkg_9.0rc5.r4.gf445af0d /home/user/.steam/root/compatibilitytools.d/ Lutris: $ cp -R /home/user/wine-tkg-git/proton-tkg/built/proton_tkg_9.0rc5.r4.gf445af0d/files /home/user/.local/share/lutris/runners/wine/proton_tkg_9.0rc5.r4.gf445af0d

3. ONLY for Lutris.

Copy patched dxvk, dxvk-nvapi and vkd3d-proton from proton-tkg build to Lutris runtime folders.

Files from lib/wine and lib64/wine should go to x32 (dxvk, dxvk-nvapi) / x86 (vkd3d-proton) and x64 folders respectively. This way: /home/user/.local/share/lutris/runtime/{dxvk,dxvk-nvapi,vkd3d-proton}/version/{x32,x86,x64}

4. Prepare Wine prefix.

Select proton-tkg build in Steam/Lutris. Set DXVK_ENABLE_NVAPI=1 and WINEHAGS=1 environment variables.

ONLY for Lutris: select custom versions of dxvk, dxvk-nvapi, vkd3d-proton.

If required, backup your game/configuration file/saves/screenshots. Boot clean Wine prefix. Set Windows 11. If required, restore your backup. If using mods (red4ext, CET), install d3dcompiler_47 and vcrun2022 with Protontricks (Steam) or Winetricks (Lutris).

5. Install dlssg-to-fsr3 mod.

Copy dlssg_to_fsr3_amd_is_better.dll and nvngx.dll to bin/x64. Run Wine's regedit and import DisableNvidiaSignatureChecks.reg file.

Steam: Protonricks > Cyberpunk 2077 > Run regedit > Regisry > Import Registry File... > DisableNvidiaSignatureChecks.reg Lutris: Wine registry > Regisry > Import Registry File... > DisableNvidiaSignatureChecks.reg

6. Remove old cache files from game's directory.

vkd3d-proton.cache, vkd3d-proton.cache.write files and GLCache folder from bin/x64.

7. Test!

Run the game, go to Settings. Disable VSync in Video. Enable DLSS Frame Generation in Graphics. It will reset selected DLSS mode, revert it back if desired. Load your save. Play :-)

GPU: RTX 2070 Driver: 545.29.06 Wine: 1705215762 TKG-proton-9.0rc5.r4.gf445af0d Game: 57100052607579862 2.1 - Build_4984974Change_6525662_0 - 56123

gilvbp commented 10 months ago

git clone https://github.com/MichaelGoodale/wine-tkg-git.git

@hotcapy Thanks, I will check every single step! I was on 535.146 drivers (doesn't have vk2_latency extension), just upgraded to 545.29.06 (last branch)

gilvbp commented 10 months ago

git clone https://github.com/MichaelGoodale/wine-tkg-git.git

@hotcapy Thanks, I will check every single step! I was on 535.146 drivers (doesn't have vk2_latency extension), just upgraded to 545.29.06 (last branch)

All good:

Alan Wake 2 (Heroic) Captura de tela de 2024-01-14 19-08-49

CyberPunk 2077 (Steam):

Captura de tela de 2024-01-14 18-58-27

@hotcapy Thank you very much for your patience :)

@tuxrinku, check this comment: https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1891017248

xdiban commented 10 months ago

https://github.com/MichaelGoodale/wine-tkg-git.git

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1891017248

I followed your instructions and I always get the same error.

Hunk #13 FAILED at 4488.
1 out of 15 hunks FAILED -- saving rejects to file libs/vkd3d/vkd3d_private.h.rej
patching file libs/vkd3d/vulkan_procs.h
gilvbp commented 10 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1891094934

@xdiban @tuxrinku @RyzenDew @Calculus8303 I uploaded the last build for you guys:

https://www.dropbox.com/scl/fi/11sigwwubuttluru4jktg/proton_tkg_9.0rc5.r4.gf445af0d.tar.xz?rlkey=y5nbh18iblr76u0uf55902858&dl=0

Enjoy the extra fps 😉

tuxrinku commented 10 months ago

Thank you ! I'm trying to make it work with lutris but somehow the nvidia reflex and frame generation settings are still greyed out. I tried to set vkd3d to manual but then the game doesn't start. Anyone has a clue ?

EDIT : Okay I managed, I just had to create a custom folder in the runtimes lutris folder and put the dlls there. So now everythying works fine, except the input lag is pretty big and there's some stuttering despite the double fps, but I assume this is to be expected.

hotcapy commented 10 months ago

I followed your instructions and I always get the same error.

Does this error occur only when dlssg-to-fsr3 mod's dlls installed to bin/x64? Or generally, with clean CP77 as well? Game works with usual unpatched Wine build?

I just had to create a custom folder in the runtimes lutris folder and put the dlls there.

Yes, that's correct. For example, Lutris uses vX.Y.Z folders by default. So, when I make latest-git dxvk, dxvk-nvapi and vkd3d-proton versions, I simply add current commit number to it's name. But you can use absolutely whatever you like, just copy-paste it's name to version field in Lutris configuration window. v2.11.1_12f561c, v0.6.4_proton-tkg, reflex_patched, etc.

I also like to start games headless from terminal after they are configured, like that: LUTRIS_SKIP_INIT=1 lutris lutris:rungameid/X

there's some stuttering despite the double fps, but I assume this is to be expected.

Disabled VSync, especially if you had VRR configured (FreeSync or GSync monitor), costs lots of smoothness, unfortunately. But I'm happy, because now I able to play with DLAA and Ultra RT at ~60 FPS. And it works cool together with 8GB & Normal-RT-Full configs from "Ultra Plus" Nexus mod. Game shutters on camera movement for sure, but not too bad for my old 20 generation GPU.

Strangely, I really liked 2.1 update (unlike pretty all previous ones). Despite memory issues, there are much less lags with NPCs and cars behavior/physics, at least for me. And higher FPS helps even more.

I'm sorry for late reply. Glad you managed to fix everything :-)

Berny23 commented 10 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1891121978

Thank you so much, it finally works! I'm on an LTS release, so getting build dependencies wasn't really an option.

1091500_20240115204230_1

Stable ~100 FPS with Path Tracing and everything on max. :+1:

1091500_20240115204414_1

FakeMichau commented 10 months ago

It's possible to make that work on AMD GPUs if nvapi spoofs Ada and _nvngx.dll from the Nvidia driver is placed in system32. I also adjusted those HAGS patches to work on the official Proton, they are located in my fork if anyone is interested.

halfmexican commented 10 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1891121978

THIS IS AMAZING! THANK YOU!!

ryzendew commented 10 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1891017248

now add heroic and go into detail unlike with steam and lutris

tuxrinku commented 10 months ago

Replying to #7361 (comment)

I had just uploaded with Wine 9.0 final release. https://www.dropbox.com/scl/fi/mguih8fjtu5lj21oc2on7/proton_tkg_9.0.r0.gcab93f47.tar.xz?rlkey=k0gc1inxprjva1auohbc9j0iv&dl=0

Thank you for the update ! However it appears WINEHAGS=1 doesn't work while it was working fine with the rc5 build

MrDuartePT commented 10 months ago

@Gravechapa just to warn you about one thing. Your gpu detection patch breaks wine explorer.exe run from terminal at least on wayland on the igpu. I can only open wine default apps from explorer shell (virtual desktop), like winecfg and other. But funny games open just fine. But If I force the prefix to use only the dgpu wine explorer start working normal, winecfg and other start working normal no need for the explorer shell.

EDIT: Without the gpu detection patch DLSS Frame Gen stop working. I think I gonna use the ProtonGE custom builder I what to try it our just use @FakeMichau one, btw thanks for updating the hangs patches.

One time I was trying to do it as well but didn't what to bump proton beading edge to wine 9.0-rc5

EDIT2: Proton-GE dosent seems to have the bledingedge branch I gonna use LFX2

MrDuartePT commented 10 months ago

@FakeMichau this is a bit of topic but you know how to disable the creation of steamuser since using wine-proton make me the need of copy my saves since is stop using my documents folder

gilvbp commented 10 months ago

Replying to #7361 (comment)

I had just uploaded with Wine 9.0 final release. https://www.dropbox.com/scl/fi/mguih8fjtu5lj21oc2on7/proton_tkg_9.0.r0.gcab93f47.tar.xz?rlkey=k0gc1inxprjva1auohbc9j0iv&dl=0

Thank you for the update ! However it appears WINEHAGS=1 doesn't work while it was working fine with the rc5 build

That's strange, I will check that. Thanks for the info.

tuxrinku commented 10 months ago

Another thing that I found out in your build is that it doesn't work with gsync/freesync. When I use a different wine build (GE for exemple) I have the gsync indicator on. I don't when I use this build. It's not a big problem at all, I just felt like letting you know.

miramax001 commented 10 months ago

maybe others run into the same problem as me,

I didn't understand why it didn't work for me even though I had done everything indicated here: https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1891017248

The problem was the proton version

The proton_tkg_9.0rc5.r4.gf445af0d version works

The proton_tkg_9.0.r0.gcab93f47 version doesn't work for me

:)

Those are my launch options on Steam for CP2077

Thx :) WINEDLLOVERRIDES="winmm,version=n,b" WINEHAGS=1 DXVK_ENABLE_NVAPI=1 gamemoderun taskset -c 0-15 %command% -modded --launcher-skip

ShalokShalom commented 10 months ago

Is this supposed to work on the Steamdeck APU?

gilvbp commented 10 months ago

Is this supposed to work on the Steamdeck APU?

No.

halfmexican commented 10 months ago

I've also noticed my dualsense controller is treated like an xbox controller when using this. I'm not using steam-input and proton-experimental properly detects my controller and allows me to enable adaptive triggers

MrDuartePT commented 10 months ago

I've also noticed my dualsense controller is treated like an xbox controller when using this. I'm not using steam-input and proton-experimental properly detects my controller and allows me to enable adaptive triggers

I don’t know if cyberpunk support dualsense sometimes steam runtime can treat the controller as a Xbox one when using a custom wine. Try launch the game from big picture after Steam detect is a dualsense.

MrDuartePT commented 10 months ago

Is this supposed to work on the Steamdeck APU?

Try see Proton-LX2 allow to enable in amd apu since it have a section to spoff a nvidia card https://github.com/FakeMichau/Proton-LFX2

markussekhon commented 9 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1891017248

Hey.

I'm using Arch and followed what you laid out to build proton-tkg. For some reason I'm running into a merge conflict and I believe the file that is having the merge conflict is inaccessible because its a temporary file. (Brought in by the bash script? Sorry I am way out of my depth here!) I tried to use the non staging version and still ran into this same issue. I compiled proton from the master branch and it worked fine, but the one I need (MichaelGoodale's fork) wont work. Ill post my prepare.log in case you might be able to shed some light on what to do?

fatal: destination path 'wine-git' already exists and is not an empty directory.
fatal: destination path 'wine-staging-git' already exists and is not an empty directory.
HEAD is now at 9f8d8bb5 Rebase against 90103fa07e5c23c7500c7d33e538b0610bf3c27d.
HEAD is now at 90103fa07e5 where: Implement search with default options.

8f087c4dff65d79f545f575cae39ffa0da5056bd reverted (hotfix)
Auto-merging dlls/bcrypt/tests/bcrypt.c
CONFLICT (content): Merge conflict in dlls/bcrypt/tests/bcrypt.c
gilvbp commented 9 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1950239698

Use the master branch version of wine-tkg, copy the commits on proton-tkg.sh from MichaelGoodale's branch, and the proton patches (do not copy wine hags patches, get the one from the FakeMichau's repository) After that build proton.

markussekhon commented 9 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1950884145

Hey @gilvbp, thanks for the reply. I saw you posted a built version on dropbox but I really wanted to get it working myself so I appreciate the help.

I have cloned the master branch version and then copied in the changes from MichaelGoodale's branch. I made sure to leave out the winehags patches they had in ~/wine-tkg-userpatches/ . From FakeMichau's Proton-LFX2 repo, I found the wine-hags-spoof.patch ... is this the correct repo and patch I should be putting into /wine-tkg-userpatches/ before I build proton?

Im way out of my depth but eager to learn. Sorry if I made and wrong assumptions on what to do.

EDIT: I ended up compiling proton how I detailed above in my comment. It went much further into the process but failed applying the wine-hags-spoof.mypatch , going to try and figure out about why that is.

gilvbp commented 9 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7361#issuecomment-1950981702

check this commit: https://github.com/gilvbp/wine-tkg-git/commit/5d1b77d831f529489aed439257832eb7f468b75a. and this, https://github.com/gilvbp/wine-tkg-git/commit/d26d204c9baacc6f1802a20cf4465f64ff463031. With that, I was able to build proton_tkg_experimental.bleeding.edge.8.0.80590.20240215 without any patch problem.

PS: The MichaelGoodale's wine hags patches don't work anymore because they're for the 9.0rc version

gilvbp commented 9 months ago

Here is the proton (working) build tar if you need it.

proton_tkg_experimental.bleeding.edge.8.0.80590.20240215.tar.xz

https://www.dropbox.com/scl/fi/k1lwfgvuniiv6rzkykixj/proton_tkg_experimental.bleeding.edge.8.0.80590.20240215.tar.xz?rlkey=25nrvfe1oiitqn5sq5z3sgyjg&dl=0

Captura de tela de 2024-02-18 11-03-22

@FakeMichau thanks for the hags patch

markussekhon commented 9 months ago

Replying to #7361 (comment)

Those two commits where the changes I had done previously - I ran diff against the files to be sure. Turns out I was building the wrong version though. I was trying to build wine upstream from proton instead of proton experimental bleeding edge. Thanks for your help @gilvbp !

I couldn't locate the GLCache folder in ~/bin/x64, but I found these instead:

[sekhon@arch x64]$ find ~ -type d -name GLCache
/home/sekhon/.local/share/Steam/steamapps/shadercache/1091500/nvidiav1/GLCache
/home/sekhon/.local/share/Steam/steamapps/compatdata/0/pfx/GLCache
/home/sekhon/.cache/nvidia/GLCache
[sekhon@arch x64]$

I believe the first one is the shader cache for cyberpunk2077 and the last one is the global cache. I think the 2nd one might be to do with proton but I am unsure. Should I delete any or all of these instead?

EDIT: I got the dlssg-to-fsr3 mod working, and it increased the framerate quite a bit, but I would randomly stutter and having flashing frames so I just opted to keep frame gen off 😂

Zenzi0 commented 9 months ago

I just stumbled upon a thread announcing that Nvidia Reflex support got merged for DXVK-NVAPI and vk3d3-proton. https://github.com/jp7677/dxvk-nvapi/pull/147#event-11981286521 https://github.com/HansKristian-Work/vkd3d-proton/pull/1739#issuecomment-1973452343

Does this mean that soon we won't have to patch this in order to use this mod? Or are the hags-patches a show-stopper here for the foreseeable future?

gilvbp commented 8 months ago

I just stumbled upon a thread announcing that Nvidia Reflex support got merged for DXVK-NVAPI and vk3d3-proton. jp7677/dxvk-nvapi#147 (comment) HansKristian-Work/vkd3d-proton#1739 (comment)

Does this mean that soon we won't have to patch this in order to use this mod? Or are the hags-patches a show-stopper here for the foreseeable future?

You only need to keep the omm patches (despite dxvk, PR still pending). If you want, you can use/or check changes on my wine-tkg here: https://github.com/gilvbp/wine-tkg-git/tree/ll2_test.

I generated the last wine proton upstream version (proton_tkg_9.3.r7.g21b92f96): https://www.dropbox.com/scl/fi/8c5fhzvfu9uqjdrfkbfm7/proton_tkg_9.3.r7.g21b92f96.tar.xz?rlkey=bkc81cd0drtxajka5u60wsrji&dl=0

@Saancreed Thank you for the wine 9.3 updated patch :+1:

Saancreed commented 8 months ago

OMM patches aren't technically required; they are (quite) a niche feature that's used only by one game that I know about (Cyberpunk 2077) and their performance uplift is mostly limited to Nvidia Ada GPUs. Feel free to drop them (though I'll probably keep maintaining them in my dxvk-nvapi and vkd3d-proton branches).

One of my HAGS-related patches has been upstreamed (https://gitlab.winehq.org/wine/wine/-/merge_requests/4857) and is available in mainline Wine since release 9.3; if you're building patched Proton from Valve's 9.0 tree you should probably use the updated one from that MR), the other one that expands the implementation of D3DKMTQueryAdapterInfo is still required to be applied separately (that's the one I shared on LGD Discord which @gilvbp uploaded here: https://github.com/gilvbp/wine-tkg-git/blob/e9b4e2e19895492349f6b83b7852b9cf9ab4135c/wine-tkg-git/wine-tkg-userpatches/hags.mypatch). I don't intend to upstream this in its current form; checking the environment variable feels too hackish and faking this to be always enabled confuses DLSSG if you don't have this mod installed.

Thank you for the wine 9.3 updated patch 👍

You're welcome :frog::heart:

Calculus8303 commented 8 months ago

Thanks so much for the 9.3 version and in general moving this along. That version finally got my Hogwarts Legacy install into playable and sufficiently enjoyable to run territory.

Saancreed commented 8 months ago

This week's Wine commits moved some things around, here's a new diff that should be compatible with latest revisions: hags.diff

salihmarangoz commented 7 months ago

Is anyone able to build it for Ubuntu?