Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for installing and enabling DXVK-NVAPI #2567

Merged
merged 38 commits into from
Aug 24, 2023

Conversation

Etaash-mathamsetty
Copy link
Member

@Etaash-mathamsetty Etaash-mathamsetty commented Mar 25, 2023

Things that have been properly tested:

  1. I used nvapi-test to make sure that the dlls are installed in the prefix
  2. downloading to tools folder (fixed)
  3. it works with games :O

NOTE: This PR is not yet ready to be merged since we still need to copy nvngx.dll from the nvidia drivers on the host system, this relies on a separate helper binary that I have created in rust
https://github.com/Etaash-mathamsetty/nvngx-finder

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@flavioislima flavioislima requested review from a team, arielj, flavioislima, CommandMC, Nocccer, imLinguin and redromnon and removed request for a team March 31, 2023 20:08
@flavioislima flavioislima added the pr:ready-for-review Feature-complete, ready for the grind! :P label Mar 31, 2023
@YousofMersal
Copy link

YousofMersal commented Apr 1, 2023

I've installed this version and tried to test it out with control.
I can't seem to get it to work.

I've used the following env variables and a lot of combination of them:

PROTON_ENABLE_NVAPI=1
DXVK_ENABLE_NVAPI=1
PROTON_HIDE_NVIDIA_GPU=0
VKD3D_FEATURE_LEVEL=12_1
VKD3D_CONFIG=dxr11
PROTON_CONFIG=dxr12
WINEDLLOVERRIDES=dxgi,nvapi,nvapi64=n

nvpai64.dll seems to correctly be in system32 of the prefix and nvapi.dll in syswow64 folder

EDIT: Running the nvapi64-tests.exe prefix belonging to the game with i get 63 passes but 1 fail for the assertions being the following:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvapi64-tests.exe is a Catch2 v3.3.1 host application.
Run with -? for options

-------------------------------------------------------------------------------
Sysinfo methods succeed against local system
-------------------------------------------------------------------------------
../../../tests/nvapi_system.cpp:78
...............................................................................

../../../tests/nvapi_system.cpp:159: FAILED:
  REQUIRE( nvAPI_GetInterfaceVersionString(desc) == NVAPI_OK )
with expansion:
  -1 == 0

===============================================================================
test cases:  1 |  0 passed | 1 failed
assertions: 64 | 63 passed | 1 failed

@Etaash-mathamsetty
Copy link
Member Author

Etaash-mathamsetty commented Apr 1, 2023

I've installed this version and tried to test it out with control.
I can't seem to get it to work.

I've used the following env variables and a lot of combination of them:

PROTON_ENABLE_NVAPI=1
DXVK_ENABLE_NVAPI=1
PROTON_HIDE_NVIDIA_GPU=0
VKD3D_FEATURE_LEVEL=12_1
VKD3D_CONFIG=dxr11
PROTON_CONFIG=dxr12
WINEDLLOVERRIDES=dxgi,nvapi,nvapi64=n

nvpai64.dll seems to correctly be in system32 of the prefix and nvapi.dll in syswow64 folder

EDIT: Running the nvapi64-tests.exe prefix belonging to the game with i get 63 passes but 1 fail for the assertions being the following:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvapi64-tests.exe is a Catch2 v3.3.1 host application.
Run with -? for options

-------------------------------------------------------------------------------
Sysinfo methods succeed against local system
-------------------------------------------------------------------------------
../../../tests/nvapi_system.cpp:78
...............................................................................

../../../tests/nvapi_system.cpp:159: FAILED:
  REQUIRE( nvAPI_GetInterfaceVersionString(desc) == NVAPI_OK )
with expansion:
  -1 == 0

===============================================================================
test cases:  1 |  0 passed | 1 failed
assertions: 64 | 63 passed | 1 failed

Strange because it works for me with AMD
Remove all those other junk env variables, I think they are causing the issue
Heroic handles it now

If nvapi is actually working you should get at least above 500 passes

@YousofMersal
Copy link

I first tried it without the env variables. I only added then in an attempt to make it work.

@Etaash-mathamsetty
Copy link
Member Author

I first tried it without the env variables. I only added then in an attempt to make it work.

did you make sure DXVK is installed?
are you using proton or wine?

@YousofMersal
Copy link

did you make sure DXVK is installed? are you using proton or wine?

DXVK is installed and working.
Wine-GE-Proton7-41

@Etaash-mathamsetty
Copy link
Member Author

did you make sure DXVK is installed? are you using proton or wine?

DXVK is installed and working. Wine-GE-Proton7-41

run winecfg, does it show nvapi64 as native?

@YousofMersal
Copy link

YousofMersal commented Apr 2, 2023

run winecfg, does it show nvapi64 as native?

nvapi64 is not listed as an existing override for the default settings (for this prefix)

@Etaash-mathamsetty
Copy link
Member Author

run winecfg, does it show nvapi64 as native?

nvapi64 is not listed as an existing override for the default settings (for this prefix)

strange, that part works fine for me, could you see what happens if you set it to native yourself?

@YousofMersal
Copy link

YousofMersal commented Apr 2, 2023

run winecfg, does it show nvapi64 as native?

nvapi64 is not listed as an existing override for the default settings (for this prefix)

strange, that part works fine for me, could you see what happens if you set it to native yourself?

added nvapi64 as native to the overrides, nothing changes. Also tried to add nvapi as native afterwards still nothing.

And just double checked that dxgi is already set as native

EDIT: it did change nvapi-tests.exe output

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvapi64-tests.exe is a Catch2 v3.3.1 host application.
Run with -? for options

-------------------------------------------------------------------------------
Sysinfo methods succeed against local system
-------------------------------------------------------------------------------
../../../tests/nvapi_system.cpp:78
...............................................................................

../../../tests/nvapi_system.cpp:81: FAILED:
  REQUIRE( nvapiModule )
with expansion:
  nullptr

===============================================================================
test cases: 1 | 1 failed
assertions: 1 | 1 failed

@Etaash-mathamsetty
Copy link
Member Author

run winecfg, does it show nvapi64 as native?

nvapi64 is not listed as an existing override for the default settings (for this prefix)

strange, that part works fine for me, could you see what happens if you set it to native yourself?

added nvapi64 as native to the overrides, nothing changes. Also tried to add nvapi as native afterwards still nothing.

And just double checked that dxgi is already set as native

EDIT: it did change nvapi-tests.exe output

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvapi64-tests.exe is a Catch2 v3.3.1 host application.
Run with -? for options

-------------------------------------------------------------------------------
Sysinfo methods succeed against local system
-------------------------------------------------------------------------------
../../../tests/nvapi_system.cpp:78
...............................................................................

../../../tests/nvapi_system.cpp:81: FAILED:
  REQUIRE( nvapiModule )
with expansion:
  nullptr

===============================================================================
test cases: 1 | 1 failed
assertions: 1 | 1 failed

this means that nvapi64 didn't install correctly and it's still using the builtin one to whatever wine version you are using

@YousofMersal
Copy link

added nvapi64 as native to the overrides, nothing changes. Also tried to add nvapi as native afterwards still nothing.
And just double checked that dxgi is already set as native
EDIT: it did change nvapi-tests.exe output

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvapi64-tests.exe is a Catch2 v3.3.1 host application.
Run with -? for options

-------------------------------------------------------------------------------
Sysinfo methods succeed against local system
-------------------------------------------------------------------------------
../../../tests/nvapi_system.cpp:78
...............................................................................

../../../tests/nvapi_system.cpp:81: FAILED:
  REQUIRE( nvapiModule )
with expansion:
  nullptr

===============================================================================
test cases: 1 | 1 failed
assertions: 1 | 1 failed

this means that nvapi64 didn't install correctly and it's still using the builtin one to whatever wine version you are using

Yeah i realised the same thing, i then tried downloading dxvk-nvapi directly from the repo and replace the files in system32 and syswow64 manually and now the same tests all pass

@Etaash-mathamsetty
Copy link
Member Author

Etaash-mathamsetty commented Apr 2, 2023

what is inside /home/$USER/.config/heroic/tools/dxvk-nvapi/ for you?

@YousofMersal
Copy link

what is inside /home/$USER/.config/heroic/tools/dxvk-nvapi/ for you?

Seems to be the exact same thing i downloaded from the repo

@Etaash-mathamsetty
Copy link
Member Author

what is inside /home/$USER/.config/heroic/tools/dxvk-nvapi/ for you?

Seems to be the exact same thing i downloaded from the repo

just tell me the file/folder names inside

@YousofMersal
Copy link

what is inside /home/$USER/.config/heroic/tools/dxvk-nvapi/ for you?

Seems to be the exact same thing i downloaded from the repo

just tell me the file/folder names inside

4.0K   ┌── LICENSE
4.0K   ├── latest_dxvk-nvapi
 12K   ├── README.md
1.7M   │ ┌── nvapi.dll
1.7M   ├─┴ x32
1.4M   │ ┌── nvapi64.dll
4.7M   │ ├── nvapi64-tests.exe
6.1M   ├─┴ x64
7.8M ┌─┴ dxvk-nvapi

@Etaash-mathamsetty
Copy link
Member Author

Etaash-mathamsetty commented Apr 2, 2023

what is inside /home/$USER/.config/heroic/tools/dxvk-nvapi/ for you?

Seems to be the exact same thing i downloaded from the repo

just tell me the file/folder names inside

4.0K   ┌── LICENSE
4.0K   ├── latest_dxvk-nvapi
 12K   ├── README.md
1.7M   │ ┌── nvapi.dll
1.7M   ├─┴ x32
1.4M   │ ┌── nvapi64.dll
4.7M   │ ├── nvapi64-tests.exe
6.1M   ├─┴ x64
7.8M ┌─┴ dxvk-nvapi

yeah that's what I suspected, it's being extracted wrong, thanks
path should be dxvk-nvapi/dxvk-nvapi-v0.6.2/x64,x32,etc

@Etaash-mathamsetty
Copy link
Member Author

ok made some fixes could you send both the heroic log and the game log once you retest?

@AllyTheProtogen
Copy link

Alright, just tested both games again and DLSS still doesn't work for either. I deleted the prefixes for both of the games to make wine regenerate them with NVAPI, but this also did nothing, leading to Control still having it's DLSS option blocked. I did manage to get Horizon ZD working because I didn't have mfc140 installed on the prefix but DLSS didn't show up in there either.
1209025141-lastPlay.log
heroic-2023-08-07T20_13_28.668Z.log
2049187585-lastPlay.log

@Etaash-mathamsetty
Copy link
Member Author

Etaash-mathamsetty commented Aug 7, 2023

Alright, just tested both games again and DLSS still doesn't work for either. I deleted the prefixes for both of the games to make wine regenerate them with NVAPI, but this also did nothing, leading to Control still having it's DLSS option blocked. I did manage to get Horizon ZD working because I didn't have mfc140 installed on the prefix but DLSS didn't show up in there either. 1209025141-lastPlay.log heroic-2023-08-07T20_13_28.668Z.log 2049187585-lastPlay.log

do you have the nvidia drivers properly installed in flatpak? also could you retest the proper logging wasn't in place when nvngx.dll (the dll with dlss) is not found

it would also be nice if you could find the path of nvngx.dll in flatpak for me :)

@imLinguin
Copy link
Member

I tested with Horizon just now and I seem to be able to select DLSS in game settings just fine

@Etaash-mathamsetty
Copy link
Member Author

I tested with Horizon just now and I seem to be able to select DLSS in game settings just fine

with flatpak?

@imLinguin
Copy link
Member

no, AppImage

@Etaash-mathamsetty
Copy link
Member Author

I specifically wanted flatpak tested since paths would be different, and maybe LD_LIBRARY_PATH is not set properly in there

@Etaash-mathamsetty
Copy link
Member Author

I can't get it to show up in the flatpak filesystem since I am on AMD unfortunately

@AllyTheProtogen
Copy link

AllyTheProtogen commented Aug 8, 2023

do you have the nvidia drivers properly installed in flatpak? also could you retest the proper logging wasn't in place when nvngx.dll (the dll with dlss) is not found

it would also be nice if you could find the path of nvngx.dll in flatpak for me :)

afaik, I do have the drivers installed correctly because whenever I install flatpak for the first time on a new linux install, it says it's downloading Nvidia drivers.

I did manage to find nvngx.dll in (what I assume is) flatpaks global install. Here is the path: /var/lib/flatpak/runtime/org.freedesktop.Platform.GL.nvidia-535-86-05/x86_64/1.4/active/files/extra/nvidia/wine/nvngx.dll

I also retested with the new build that has Heroic reporting if it cannot find nvngx.dll (which it's sadly reporting) with both Control and HZD and the logs are provided.

Again, I hope this helps!
heroic-2023-08-08T04_13_10.730Z.log
1209025141-lastPlay.log
2049187585-lastPlay.log

@Etaash-mathamsetty
Copy link
Member Author

Etaash-mathamsetty commented Aug 8, 2023

/var/lib/flatpak/runtime/org.freedesktop.Platform.GL.nvidia-535-86-05/x86_64/1.4/active/files/extra/nvidia/wine/nvngx.dll

unfortnuately heroic cannot access that path (as far as I know) it would be nice if you could flatpak run --command=/bin/bash com.heroicgameslauncher.hgl and figure out where the .so file is in the flatpak's filesystem using the bash prompt this command returns (probably by using the find command)

it would also be helpful if you could find where libGLX_nvidia.so.0 is as well

@imLinguin
Copy link
Member

@Etaash-mathamsetty /usr/lib/x86_64-linux-gnu/GL/nvidia-535-86-05/extra/nvidia/wine/nvngx.dll
I feel like this is the place where proper nvngx finder would be helpful

@Etaash-mathamsetty
Copy link
Member Author

Etaash-mathamsetty commented Aug 8, 2023

@Etaash-mathamsetty /usr/lib/x86_64-linux-gnu/GL/nvidia-535-86-05/extra/nvidia/wine/nvngx.dll I feel like this is the place where proper nvngx finder would be helpful

yep, flatpak uses ld.so to set the paths and stuff, that's why lutris uses dlopen, but it's kinda overkill to have a binary for this one function, I will add this path in... wait it's going to change with driver versions...

is that the only path with nvidia-xxx-xx-xx

@imLinguin
Copy link
Member

Yes, the version is dynamic, that's why dlopen is a solution. We can add it into vulkan-helper cli I guess

@Etaash-mathamsetty
Copy link
Member Author

Etaash-mathamsetty commented Aug 8, 2023

Yes, the version is dynamic, that's why dlopen is a solution. We can add it into vulkan-helper cli I guess

lgtm to me

@Etaash-mathamsetty
Copy link
Member Author

new stuff is ready to be tested once more :)

@AllyTheProtogen
Copy link

I just tested the build and and DLSS works! It shows up in both games and improves performance like it's supposed to! I searched for libGLX_nvidia.so.0, and found it in multiple places. And turns out it's the same way for nvngx.dll. Since I don't know what directory you're specifically looking for, I'll send screenshots of Nautilus' search results. If you'd prefer to have the directories and not the screenshots, I'll type them out but for the time being, this just makes things a bit easier. Sorry if the screenshots make things take longer.
heroic-2023-08-08T19_04_08.258Z.log
2049187585-lastPlay.log
1209025141-lastPlay.log
Screenshot from 2023-08-08 18-10-45
Screenshot from 2023-08-08 18-09-47
Screenshot from 2023-08-08 17-57-09
Screenshot from 2023-08-08 17-56-08

Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Left some small questions and also need to test it and also test on macOS since there were some changes on the dxvk installation in general. But the code looks good 👍

.github/workflows/flatpak-build.yml Outdated Show resolved Hide resolved
src/backend/config.ts Show resolved Hide resolved
Copy link
Member

@imLinguin imLinguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, small translation thing

src/frontend/screens/Settings/components/AutoDXVKNVAPI.tsx Outdated Show resolved Hide resolved
@imLinguin imLinguin added pr:ready-to-merge This PR is fully ready for merge. and removed pr:wip WIP, don't merge. labels Aug 11, 2023
@imLinguin imLinguin merged commit 6fe831c into Heroic-Games-Launcher:main Aug 24, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:ready-to-merge This PR is fully ready for merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to enable DXVK NVAPI/DLSS
7 participants