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

DLSS Can't Be Enabled in Watch Dogs: Legion #55

Closed
gardotd426 opened this issue Nov 14, 2021 · 47 comments
Closed

DLSS Can't Be Enabled in Watch Dogs: Legion #55

gardotd426 opened this issue Nov 14, 2021 · 47 comments

Comments

@gardotd426
Copy link

Watch Dogs Legion has never worked with vkd3d-proton until very recently after some dxil fixes. However, the option for DLSS is grayed out, even though the option for ray tracing is not. Any time I've seen this on a DLSS 2.X game it's been because DXVK-NVAPI wasn't loaded for one reason or another. However, I'm getting a dxvk-nvapi.log, so it is in fact being loaded.

Log:

---------- 2021-11-14 07:21:26 ----------
NvAPI_QueryInterface 0xad298d3f: Unknown function ID
DXVK-NVAPI v0.4-54-g16d36c7 (WatchDogsLegion.exe)
NVML loaded and initialized successfully
NvAPI Output: \\.\DISPLAY1
NvAPI Output: \\.\DISPLAY2
NvAPI Device: NVIDIA GeForce RTX 3090 (495.44.0)
DXVK_NVAPI_DRIVER_VERSION is set to '49649', reporting driver version 496.49
NvAPI_Initialize: OK
NvAPI_QueryInterface 0x33c7358c: Unknown function ID
NvAPI_QueryInterface 0x593e8644: Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetPCIIdentifiers: OK
NvAPI_QueryInterface NvAPI_Mosaic_EnumDisplayGrids: Not implemented method
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_Initialize: OK
NvAPI_QueryInterface NvAPI_DRS_CreateSession: Not implemented method
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetAdapterIdFromPhysicalGpu: OK
NvAPI_QueryInterface 0xf2400ab: Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetArchInfo: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_QueryInterface 0xa782ea46: Unknown function ID
NvAPI_QueryInterface NvAPI_DRS_FindApplicationByName: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_DestroySession: Not implemented method
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK

Weirdly enough, I'm not getting a dxgi.log.

Distribution: Arch
GPU: Nvidia RTX 3090 (EVGA XC3 Ultra)
Nvidia Driver: 495.44
Wine Version: lutris-ge-6.21
DXVK-NVAPI version: latest master
VKD3D-Proton version: latest master

@jp7677
Copy link
Owner

jp7677 commented Nov 14, 2021

Thanks for the report. Unfortunately there is not really something that looks unusual in the dxvk-nvapi logs. Regarding dxgi.log, are you sure that you are using DXVK's dxgi and not Wine's dxgi by chance?

Edit: Scratch that question about dxgi, I forgot that dxvk-nvapi does not work without DXVK's dxgi ;). Anyway, logs are looking pretty normal. You could try to run the nvapi64-tests.exe in that prefix to check if the nvapi sysinfo methods return sensible data (esp. the adapter LUID). But I'm pretty sure that all is good there.

@gardotd426
Copy link
Author

Edit: Scratch that question about dxgi, I forgot that dxvk-nvapi does not work without DXVK's dxgi ;).

Lol yeah I was gonna say, I replaced lutris-ge-6.21 (the wine version I'm using)'s dxgi.dlls with DXVKs manually and everything before I saw this.

Damn I just realized I'd changed the path of my DXVK log file for that prefix. Lol oops. Anyway it looks normal, but here it is:

WatchDogsLegion_dxgi.log

You could try to run the nvapi64-tests.exe in that prefix to check if the nvapi sysinfo methods return sensible data (esp. the adapter LUID). But I'm pretty sure that all is good there.

WINEPREFIX=~/nvme2/watchdogs2 ~/.local/share/lutris/runners/wine/lutris-ge-6.21-1-x86_64/bin/wine ~/dev/dxvk-nvapi/build/dxvk-nvapi-master/x64/nvapi64-tests.exe
wineserver: using server-side synchronization.
002c:fixme:winediag:LdrInitializeThunk wine-staging 6.21 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
002c:err:wineboot:process_run_key Error running cmd L"C:\\windows\\system32\\winemenubuilder.exe -a -r" (126).
006c:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\wineusb": c0000142
003c:fixme:service:scmdatabase_autostart_services Auto-start service L"wineusb" failed to start: 1114
info:  Game: nvapi64-tests.exe
info:  DXVK: v1.9.2-43-g12249fd3+
info:  Found config file: /home/matt/Documents/dxvk.conf
info:  Effective configuration:
info:    dxgi.nvapiHack = False
info:    dxgi.customVendorId = 10DE
info:    dxgi.customDeviceId = 2204
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
info:    OpenXR
info:  OpenVR: could not open registry key, status 2
info:  OpenVR: Failed to locate module
info:  Enabled instance extensions:
info:    VK_KHR_get_surface_capabilities2
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
info:  NVIDIA GeForce RTX 3090:
info:    Driver: 495.44.0
info:    Vulkan: 1.2.186
info:    Memory Heap[0]:
info:      Size: 24576 MiB
info:      Flags: 0x1
info:      Memory Type[7]: Property Flags = 0x1
info:    Memory Heap[1]:
info:      Size: 24019 MiB
info:      Flags: 0x0
info:      Memory Type[0]: Property Flags = 0x0
info:      Memory Type[1]: Property Flags = 0x0
info:      Memory Type[2]: Property Flags = 0x0
info:      Memory Type[3]: Property Flags = 0x0
info:      Memory Type[4]: Property Flags = 0x0
info:      Memory Type[5]: Property Flags = 0x0
info:      Memory Type[6]: Property Flags = 0x0
info:      Memory Type[8]: Property Flags = 0x6
info:      Memory Type[9]: Property Flags = 0xe
info:    Memory Heap[2]:
info:      Size: 246 MiB
info:      Flags: 0x1
info:      Memory Type[10]: Property Flags = 0x7
--------------------------------
Interface version:              R470
Driver version:                 495.44
Driver branch:                  v0.5+
    ----------------------------
    GPU 0
    GPU type:                   2 (Discrete)
    Device ID:                  0x220410de
    Subsystem ID:               0x39753842
    Full name:                  NVIDIA GeForce RTX 3090
    Bus ID:                     PCI:15
    Physical framebuffer size:  24822MB
    LUID high part:             0x00000000
    LUID low part:              0x000003f5
    Architecture ID:            0x00000170 (Ampere)
    Implementation ID:          0x00000002
    VBIOS version:              94.02.42.C0.10
    Current GPU utilization:    19%
    Current memory utilization: 3%
    Current GPU temperature:    43C
    Current performance state:  P0
    Current graphics clock:     1620MHz
    Current memory clock:       10441MHz
    Current video clock:        1515MHz
===============================================================================
All tests passed (28 assertions in 1 test case)

Looks like it's supposed to, right?

That's rough that there are seemingly so many instances where dxvk-nvapi just doesn't work without any indication as to why. Can Nvidia not help you out with this or would you need to talk to the Legion devs?

@jp7677
Copy link
Owner

jp7677 commented Nov 14, 2021

Thanks, looks good. So yeah, dunno what the game wants to allow DLSS...
What are the preconditions for the game engine to allow switching DLSS on would indeed be a good question to the game developer. Since this is also Ubisoft, may be this is somehow related to the mystery with AC Odyssey (#50) where the game somehow doesn't recognize the given driver version.

@SveSop
Copy link
Contributor

SveSop commented Nov 16, 2021

I dunno if lutris has any default options for "enabling DLSS", but if you are running from a regular wineprefix you created yourself and not by using steam/proton, you need to manually copy the nVidia dlss files into the prefix, and create dll overrides.

/usr/lib/x86_64-linux-gnu/nvidia/wine/_nvngx.dll
/usr/lib/x86_64-linux-gnu/nvidia/wine/nvngx.dll

Depending on distro i guess.. But both these files need to be in /yourwineprefix/drive_c/windows/system32 with a "native" dlloverride.
WINEDLLOVERRIDE="nvngx=n" (or other means like setting it with winecfg)

@gardotd426
Copy link
Author

gardotd426 commented Nov 16, 2021

Lutris has a toggle, but when 0.5.9 was in -git and not released as stable yet, the toggle didn't work so I had to install everything manually, so I already know. And it's not nvngx, it's nvapi64 per the instructions on this repo's README.

nvngx doesn't enter into it as the Nvidia driver's included nvngx is loaded automatically.

Running file /path/to/wineprefix/drive_c/windows/system32/nvngx.dll on a prefix where DLSS has been enabled shows that it is already a symbolic link with /usr/lib/nvidia/wine/nvngx.dll

@SveSop
Copy link
Contributor

SveSop commented Nov 16, 2021

Running file /path/to/wineprefix/drive_c/windows/system32/nvngx.dll on a prefix where DLSS has been enabled shows that it is already a symbolic link with /usr/lib/nvidia/wine/nvngx.dll

I don't use Lutris, so i did not know it did something similar to what steam/proton does.
Worth checking in case you missed it 😄

nvngx doesn't enter into it as the Nvidia driver's included nvngx is loaded automatically.

Does that not kinda contradict what you said above? Or do you mean it does not need an override? (Eg. if using wine-tkg/wine-lutris with https://github.com/lutris/wine/blob/lutris-fshack-6.21/lutris-patches/ngx_dll_regkey.mypatch )

@gardotd426
Copy link
Author

gardotd426 commented Nov 16, 2021

Yeah sorry the wording wasn't great, I meant nvngx doesn't enter into the process of getting a game working with DLSS, not that it doesn't get used at all. 

That patch seems to just make sure that the search path is set to drive_c/windows/system32, it doesn't do any dll overrides. And none of my DLSS-game wineprefixes have a dll override set for nvngx.dll (and they all work with DLSS except WD:L). Though that patch is indeed required I assume (my wine builds also have it anyway)

I just did a sanity check to make sure and used a script to manually launch Control Ultimate Edition (GOG version) from the command line with no nv-related dll overrides, and obviously DLSS didn't work, I added a DLL override for nvapi64.dll and nvapi.dll and nothing else, and sure enough DLSS works, so yeah no override is needed for nvngx or _nvngx anything (EDIT: Just tested Ghostrunner GOG version in a separate prefix, same result).

If nvngx.dll needed to be copied to the game directory and a dll override set for DLSS to work you'd think jens would add that to the README here.

Though I guess it wouldn't hurt to try going ahead and manually adding a dll override for nvngx for this game specifically even though no other game needs it, this wouldn't be the first time one game needed somethng like this when other games worked without it.

@jp7677
Copy link
Owner

jp7677 commented Nov 16, 2021

From my understanding dll overrides are only needed to control the behavior when there is both a native version and a wine version of a certain dll. Or if you want to disable loading a dll altogether.
Since there is no wine version of nvngx/_nvgnx, the native version will always be loaded unless not explicitly disabled with dll overrides.

So yes, no dll override should be needed.

@SveSop
Copy link
Contributor

SveSop commented Nov 16, 2021

Ah oki. As long as you either copy or symlink the system nvngx.dll/_nvngx.dll to your WINEPREFIX you dont need a WINEDLLOVERRIDE. (Or use Lutris/Steam that does it for you).

Other than that, i cant say anything in particular is standing out from that log.. Guess you need to check wine logs to see if it is actually being loaded? WINEDEBUG=+loaddll maybe?

cat winelog.log |grep -i nvng
010c:trace:loaddll:build_module Loaded L"C:\\Windows\\System32\\nvngx.dll" at 00000000358B0000: native
0268:trace:loaddll:build_module Loaded L"C:\\Windows\\System32\\_nvngx.dll" at 00000000365A0000: native
010c:trace:loaddll:build_module Loaded L"C:\\Program Files\\RTX Technology Showcase\\Engine\\Plugins\\Runtime\\Nvidia\\DLSS\\Binaries\\ThirdParty\\Win64\\nvngx_dlss.dll" at 0000000046110000: native

Or for all we know

NvAPI_QueryInterface 0xf2400ab: Unknown function ID
NvAPI_QueryInterface 0xa782ea46: Unknown function ID

could be required....

@jp7677
Copy link
Owner

jp7677 commented Nov 16, 2021

@gardotd426 Could you try #56 ? I really hope this makes no difference, but may be the games expects a certain driver setting. Actually only difference should be some more log statements.

@gardotd426
Copy link
Author

gardotd426 commented Nov 16, 2021 via email

@SveSop
Copy link
Contributor

SveSop commented Nov 17, 2021

@gardotd426 Could you try #56 ? I really hope this makes no difference, but may be the games expects a certain driver setting. Actually only difference should be some more log statements.

Even if it does not solve this particular issue, it does make the log look at bit cleaner and potentially has the benefit of maybe seeing if a app tries to check for a spesific setting if i understand this line correctly
return Ok(str::format(__func__, " (", settingId, ")"));

@gardotd426
Copy link
Author

No change with that branch

@jp7677
Copy link
Owner

jp7677 commented Nov 17, 2021

No change with that branch

Could you please add the logs? Just curious which settings that game wants to know about.
(Those ID's shoud match to https://github.com/jp7677/dxvk-nvapi/blob/master/inc/NvApiDriverSettings.h#L127)

@gardotd426
Copy link
Author

---------- 2021-11-17 08:26:59 ----------
NvAPI_QueryInterface 0xad298d3f: Unknown function ID
DXVK-NVAPI v0.5+ (WatchDogsLegion.exe)
NVML loaded and initialized successfully
NvAPI Output: \\.\DISPLAY1
NvAPI Output: \\.\DISPLAY2
NvAPI Device: NVIDIA GeForce RTX 3090 (495.44.0)
DXVK_NVAPI_DRIVER_VERSION is set to '49649', reporting driver version 496.49
NvAPI_Initialize: OK
NvAPI_QueryInterface 0x33c7358c: Unknown function ID
NvAPI_QueryInterface 0x593e8644: Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetPCIIdentifiers: OK
NvAPI_QueryInterface NvAPI_Mosaic_EnumDisplayGrids: Not implemented method
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_Initialize: OK
NvAPI_QueryInterface NvAPI_DRS_CreateSession: Not implemented method
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetAdapterIdFromPhysicalGpu: OK
NvAPI_QueryInterface 0xf2400ab: Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetArchInfo: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_QueryInterface 0xa782ea46: Unknown function ID
NvAPI_QueryInterface NvAPI_DRS_FindApplicationByName: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_DestroySession: Not implemented method
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
info:  Game: WatchDogsLegion.exe
info:  DXVK: v1.9.2-43-g12249fd3+
info:  Found config file: /home/matt/Documents/dxvk.conf
info:  Effective configuration:
info:    dxgi.nvapiHack = False
info:    dxgi.customVendorId = 10DE
info:    dxgi.customDeviceId = 2204
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
info:    OpenXR
info:  OpenVR: could not open registry key, status 2
info:  OpenVR: Failed to locate module
info:  Enabled instance extensions:
info:    VK_KHR_get_surface_capabilities2
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
info:  NVIDIA GeForce RTX 3090:
info:    Driver: 495.44.0
info:    Vulkan: 1.2.186
info:    Memory Heap[0]: 
info:      Size: 24576 MiB
info:      Flags: 0x1
info:      Memory Type[7]: Property Flags = 0x1
info:    Memory Heap[1]: 
info:      Size: 24019 MiB
info:      Flags: 0x0
info:      Memory Type[0]: Property Flags = 0x0
info:      Memory Type[1]: Property Flags = 0x0
info:      Memory Type[2]: Property Flags = 0x0
info:      Memory Type[3]: Property Flags = 0x0
info:      Memory Type[4]: Property Flags = 0x0
info:      Memory Type[5]: Property Flags = 0x0
info:      Memory Type[6]: Property Flags = 0x0
info:      Memory Type[8]: Property Flags = 0x6
info:      Memory Type[9]: Property Flags = 0xe
info:    Memory Heap[2]: 
info:      Size: 246 MiB
info:      Flags: 0x1
info:      Memory Type[10]: Property Flags = 0x7
info:  Game: WatchDogsLegion.exe
info:  DXVK: v1.9.2-43-g12249fd3+
info:  Found config file: /home/matt/Documents/dxvk.conf
info:  Effective configuration:
info:    dxgi.nvapiHack = False
info:    dxgi.customVendorId = 10DE
info:    dxgi.customDeviceId = 2204
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
info:    OpenXR
info:  OpenVR: could not open registry key, status 2
info:  OpenVR: Failed to locate module
info:  Enabled instance extensions:
info:    VK_KHR_get_surface_capabilities2
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
info:  NVIDIA GeForce RTX 3090:
info:    Driver: 495.44.0
info:    Vulkan: 1.2.186
info:    Memory Heap[0]: 
info:      Size: 24576 MiB
info:      Flags: 0x1
info:      Memory Type[7]: Property Flags = 0x1
info:    Memory Heap[1]: 
info:      Size: 24019 MiB
info:      Flags: 0x0
info:      Memory Type[0]: Property Flags = 0x0
info:      Memory Type[1]: Property Flags = 0x0
info:      Memory Type[2]: Property Flags = 0x0
info:      Memory Type[3]: Property Flags = 0x0
info:      Memory Type[4]: Property Flags = 0x0
info:      Memory Type[5]: Property Flags = 0x0
info:      Memory Type[6]: Property Flags = 0x0
info:      Memory Type[8]: Property Flags = 0x6
info:      Memory Type[9]: Property Flags = 0xe
info:    Memory Heap[2]: 
info:      Size: 246 MiB
info:      Flags: 0x1
info:      Memory Type[10]: Property Flags = 0x7

@jp7677
Copy link
Owner

jp7677 commented Nov 17, 2021

NvAPI_QueryInterface NvAPI_DRS_FindApplicationByName: Not implemented method

These are the old logs ;)
(just nvapi logs is sufficient)

@gardotd426
Copy link
Author

---------- 2021-11-17 08:26:59 ----------

It's from this morning built from the DRS branch.

@gardotd426
Copy link
Author

Here, I've built it in a fresh git clone checking out that branch directly (instead of just cd-ing into my dxvk-nvapi directory and running git checkout -b nvidia-drs, which apparently doesn't work).

---------- 2021-11-17 09:39:14 ----------
NvAPI_QueryInterface 0xad298d3f: Unknown function ID
DXVK-NVAPI v0.5-1-gf2ac737 (WatchDogsLegion.exe)
NVML loaded and initialized successfully
NvAPI Output: \\.\DISPLAY1
NvAPI Output: \\.\DISPLAY2
NvAPI Device: NVIDIA GeForce RTX 3090 (495.44.0)
DXVK_NVAPI_DRIVER_VERSION is set to '49649', reporting driver version 496.49
NvAPI_Initialize: OK
NvAPI_QueryInterface 0x33c7358c: Unknown function ID
NvAPI_QueryInterface 0x593e8644: Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetPCIIdentifiers: OK
NvAPI_QueryInterface NvAPI_Mosaic_EnumDisplayGrids: Not implemented method
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_Initialize: OK
NvAPI_DRS_CreateSession: OK
NvAPI_DRS_LoadSettings: OK
NvAPI_DRS_GetBaseProfile: OK
NvAPI_DRS_DestroySession: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetAdapterIdFromPhysicalGpu: OK
NvAPI_QueryInterface 0xf2400ab: Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetArchInfo: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DRS_CreateSession: OK
NvAPI_DRS_LoadSettings: OK
NvAPI_DRS_GetBaseProfile: OK
NvAPI_DRS_DestroySession: OK
NvAPI_DRS_CreateSession: OK
NvAPI_QueryInterface 0xa782ea46: Unknown function ID
NvAPI_DRS_FindApplicationByName (C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\games\Watch Dogs Legion\bin\WatchDogsLegion.exe): Executable not found
NvAPI_DRS_DestroySession: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK

WatchDogsLegion_dxgi.log

@SveSop
Copy link
Contributor

SveSop commented Nov 17, 2021

Is it a needed reason for
DXVK_NVAPI_DRIVER_VERSION is set to '49649', reporting driver version 496.49
Does it get an error if the driver is older than 496.49?

@gardotd426
Copy link
Author

I get that stupid "you're trying to run on an old/unsupported graphics driver" and it annoys me. Let me try without it.

@gardotd426
Copy link
Author

Yeah no change.

---------- 2021-11-17 09:52:37 ----------
NvAPI_QueryInterface 0xad298d3f: Unknown function ID
DXVK-NVAPI v0.5-1-gf2ac737 (WatchDogsLegion.exe)
NVML loaded and initialized successfully
NvAPI Output: \\.\DISPLAY1
NvAPI Output: \\.\DISPLAY2
NvAPI Device: NVIDIA GeForce RTX 3090 (495.44.0)
NvAPI_Initialize: OK
NvAPI_QueryInterface 0x33c7358c: Unknown function ID
NvAPI_QueryInterface 0x593e8644: Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetPCIIdentifiers: OK
NvAPI_QueryInterface NvAPI_Mosaic_EnumDisplayGrids: Not implemented method
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_Initialize: OK
NvAPI_DRS_CreateSession: OK
NvAPI_DRS_LoadSettings: OK
NvAPI_DRS_GetBaseProfile: OK
NvAPI_DRS_DestroySession: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetAdapterIdFromPhysicalGpu: OK
NvAPI_QueryInterface 0xf2400ab: Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetArchInfo: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DRS_CreateSession: OK
NvAPI_DRS_LoadSettings: OK
NvAPI_DRS_GetBaseProfile: OK
NvAPI_DRS_DestroySession: OK
NvAPI_DRS_CreateSession: OK
NvAPI_QueryInterface 0xa782ea46: Unknown function ID
NvAPI_DRS_FindApplicationByName (C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\games\Watch Dogs Legion\bin\WatchDogsLegion.exe): Executable not found
NvAPI_DRS_DestroySession: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY2: OK

I'm guessing that NVAPI_DRS_FindApplicationByName error doesn't mean anything? It's weird though because that's exactly where the game EXE is (well, from within that wine prefix at least)

@SveSop
Copy link
Contributor

SveSop commented Nov 17, 2021

Yeah no change.

NvAPI_DRS_FindApplicationByName (C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\games\Watch Dogs Legion\bin\WatchDogsLegion.exe): Executable not found

I'm guessing that NVAPI_DRS_FindApplicationByName error doesn't mean anything? It's weird though because that's exactly where the game EXE is (well, from within that wine prefix at least)

The result from the function is ExecutableNotFound and thus telling the caller (the game) that the .exe "cannot be found", and then just output what would be the result in the log if one day it could actually be used for something 👍

@SveSop
Copy link
Contributor

SveSop commented Nov 17, 2021

Other than that, i do not have any immediate ideas, since the log kinda does not indicate DLSS being polled or attempted enabled, so if WINEDEBUG=+loaddll showing that nvngx.dll being loaded, it seems strange that the game would just gray out the option.

If there was something like NvAPI_D3D12_CreateCubinComputeShaderWithName: Error atleast it would be something to work with...

@jp7677
Copy link
Owner

jp7677 commented Nov 17, 2021

I'm guessing that NVAPI_DRS_FindApplicationByName error doesn't mean anything? It's weird though because that's exactly where the game EXE is (well, from within that wine prefix at least)

Thanks for the updated logs.
That is not an error. The game wants to know if the driver has an application profile and there isn't (the path is kind of the profile name in the nvidia settings). Some games try load the base profile after that to fetch some settings from it. I was curious if that games want to check some driver settings, but it doesn't.

So unfortunately no idea which precondition is missing for this game. May be indeed the currently unknown methods, but to verify that we need to wait for updated headers. Anyway. thanks for your patience!

@SveSop
Copy link
Contributor

SveSop commented Nov 17, 2021

The nVidia demo - RTX Showcase (The Attic) can be downloaded from here: https://www.geeks3d.com/20210419/nvidia-rtx-tech-demo-the-attic-ray-tracing-unreal-engine/

This has both raytracing and dlss as various toggle options. It seems to not run raytracing with vkd3d and 495.44 driver, but works on 470.xx branch drivers (pref. beta). Raytracing is not a prerequisit of DLSS tho, so it would not really matter. The demo runs fine without RT if you do not use VKD3D_CONFIG=dxr11 with the 495.44 driver, and you can see the fps difference when enabling/disabling DLSS.
Just if you want a easy way to triple-check that DLSS actually works and do something 😄
For me it is almost double the fps when enabling DLSS with RTX2070 1440p fullscreen.

@gardotd426
Copy link
Author

Just if you want a easy way to triple-check that DLSS actually works

I have DLSS working in Control, Cyberpunk 2077, and Ghostrunner (all of which are non-Steam versions so I'm using wine+dxvk+vkd3d-proton+dxvk-nvapi same as with WD:L). Also in Doom Eternal and Wolfenstein Youngblood on Steam but that's a bit different as it's native Vulkan and not DX12

But yeah I know RT has nothing to do with DLSS but if both options are greyed out then it might point to something else being wrong but RT isn't grayed out, I can enable it in WD:L (it causes the game to crash but that's a vkd3d-proton thing obvs)

I will check out that demo though as I've been meaning to do that anyway, thanks for the link. I'll throw another install on my secondary / partition that I keep for testing out new releases of Ubuntu/Pop/etc and for debugging and put 470 on it so I don't have to keep installing 495 -> 470 back and forth.

@SveSop
Copy link
Contributor

SveSop commented Nov 17, 2021

Been toying around with NvAPI_QueryInterface 0xf2400ab: Unknown function ID a bit, and that seems to contain a rather large'ish struct possibly pointing to a physical gpu.. so it COULD be needed somehow, but without any clue to what that struct is supposed to look like, it is more or less like finding a needle in a haystack.. of haystacks 😞

Will fiddle with the other "unknown" there to see if it is easier to get something out of that.

@Tilde88
Copy link

Tilde88 commented Jan 13, 2022

Hello. I actually have DLSS working in WD:L. I did not know this was an issue until I made a reddit reply commenting how I have DLSS, just not RayTracing. How can I contribute? Should I compress my prefix and upload, and share my settings? Using WD:L v1.5.6 with all DLCs unlocked. I am only able to run DX12 if any testing needs to be done on my end.

It is worth noting!!! DLSS works fine up until the point that an overlay comes up (like for hacking and finding electronics etc). At this point, the game goes full black, minus a few directional arrows, or so. You can go through the menu, disable DLSS, complete what you need with the overlay, and then re-enable DLSS. All DLSS qualities do the same behavior.

Using all latest DXVK - v1.9.2L-3e64e1b (v1.9.3 breaks DLSS for me), VKD3D - v2.5L-db89d40, D3D Extras - v2, DXVK-NVAPI - v0.5.1-e23d450, Wine 7.0RC3-1-x86_x64-Glorious Eggroll, Esync, Fsync on. NVIDIA driver 495.46, RTX 3080 FTW3 Ultra, i7-6700k, using X server, no wayland. I did do d3d9-d3d12 dll overrides to native, as well as nvapi, nvapi64, nvcuda. and then a few winetricks deps.

Shouldn't matter, but Pop OS 21.10 , 5.15.14-xanmod1 (please no hate for custom kernel, it helps my specific use-case for multipurpose system and I/O RAID stability on MDADM).

Proof https://streamable.com/52mg4t

@gardotd426
Copy link
Author

This makes zero sense. As I said, I actually have Ray Tracing as an option (though it obviously doesn't work, it instantly hangs the GPU, but it's able to be enabled) but DLSS is grayed out. Even though I have DLSS working in literally every single DLSS 2.X game I own. It works in Control (EGS), Control Ultimate Edition (GOG), Cyberpunk 2077 (GOG), Ghostrunner (GOG), and several other games that are Vulkan rather than DX12 (like Doom Eternal and Wolfenstein: Youngblood).

and then a few winetricks deps.

Which ones?

v1.9.2L-3e64e1b (v1.9.3 breaks DLSS for me)

That's interesting. Are you saying it breaks DLSS in everything or just in Watch Dogs: Legion?

@Tilde88
Copy link

Tilde88 commented Jan 13, 2022

Which ones?

nothing fancy. dotnet40, dotnet48, and vcrun2019.
in the Uninstaller, i have .net framework (from winetricks), vc++ 2012 x64 and x86, and ofc vc++ 2015-2019 x64 and x86 (from winetricks).

i honestly do not know why mine works. this is nothing special.

That's interesting. Are you saying it breaks DLSS in everything or just in Watch Dogs: Legion?

tbh, i have not tested it in others. i was only commenting on this particular game.

@Tilde88
Copy link

Tilde88 commented Jan 14, 2022

If anyone wants, I have compressed my entire setup (no game files included). this has working DLSS. remember, any tim an overlay comes up, it will blackscreen. you can still use menu and disable DLSS during overlay black screen. hoping this helps the developer. if i can do anything at all, any logs, anything, let me know.

prefix, lutris config, all dlls for dxvk, nvapi, etc.

https://mega.nz/file/XJskgLQD#wwwmoiaUv1LBYcJJscWl2x7aJKjRwTM6mzQAiUg3xVk

this is everything i use for mine. keep in mind, i use a drm-free, standalone, no launcher version.

@jp7677
Copy link
Owner

jp7677 commented Jan 14, 2022

@Tilde88 Thanks a lot for commenting, good to read that at least some circumstances seem to convince the game to allow DLSS. Would be cool to get to know what exactly made this. Do you have the time to setup your prefix step by step and test DLSS availability between all steps?

That's interesting. Are you saying it breaks DLSS in everything or just in Watch Dogs: Legion?

tbh, i have not tested it in others. i was only commenting on this particular game.

I don't see any issues with DXVK 1.9.3 with DLSS in other games. D3D12, which above game seems to be, only uses dxgi.dll from DXVK. There weren't much changes in dxgi between both versions. What did exactly break?

@Tilde88
Copy link

Tilde88 commented Jan 14, 2022 via email

@Tilde88
Copy link

Tilde88 commented Jan 14, 2022 via email

@Tilde88
Copy link

Tilde88 commented Jan 14, 2022

@Tilde88 Thanks a lot for commenting, good to read that at least some circumstances seem to convince the game to allow DLSS. Would be cool to get to know what exactly made this. Do you have the time to setup your prefix step by step and test DLSS availability between all steps?

just a small update. i went ahead and started a fresh prefix, did everything i remembered. it does not work. if i tell that same game container to run from the original prefix, it works. im going through directories now and DIFF'ing. only thing different in sys32 was a few .sys files, i copied them in, but no change.

the WDL prefix i am using is based off of a template prefix that I used for some other games it seems. i found traces of Resident Evil 5, or 0. but those didnt need anything special other than Windows Media Player. i suspect something in the registry is tripping a flag and allowing it to enable. ill keep DIFF'ing until i find it. worry not!

at least it has been narrowed down to the prefix. it does not appear to be anything in /windows. i was thinking maybe something in system32/drivers but nope

CONFIRMED! Its something in the registry! In my brand new prefix, i removed the 3 .reg files, and copied the 3 .reg files from my working prefix. this allowed DLSS to be enabled. i will upload 2 sets of files. one set will be the "clean" .reg files from the brand new prefix. the other set will include the 3 .reg files from my working WDL! hype! if anyone wants to find what it is exactly, they can do so. ill take a look too to see if its something i can Identify quickly. ill also include the step-by-step i wrote to make the prefix that ended up not working. it is useless but meh... i typed it so.

@Tilde88
Copy link

Tilde88 commented Jan 14, 2022

Ok. Hello everyone. Please excuse the comment spam. As promised, here are the .reg files. https://mega.nz/file/fc1AmapL#uYvcR_tUeCHcrQhNk2uWl5WqT4bQx_P2kjCa8uYqvc8

here is the step-by-step for the non-working prefix. again, these instructions are not useful, as the prefix was unable to enable DLSS, until i replaced the .reg files. https://pastebin.com/a4RAjx3Z

warning, i do not recommend replacing your .reg files like i did, as my 2 prefixes were nearly identical, and i do not use things like Ubisoft launcher and the like. i use a standalone copy of the game.

a little background info on the prefix i have for the working DLSS and where it came from. (remember DLSS makes trhe screen game go black during overlays like hacking and finding electronics). this prefix was from a template prefix that i made for getting Resident Evil 0 HD and/or 5 to work on. RE5 needed WMP and i started the prefix as a WinXP 64 and started adding and installing things. until it worked. i then backed up the prefix, and created a script to clean userdata, and used that to then create a new prefix for RE0, install whatever runtimes, install game, copy the prefix, clean it out, remove userdata, etc. ... i then evetually installed probably more things, and finally my repack copy of this WD:Legion. this is why the registry is so much larger than a clean brand new prefix (by ~3megs), because I had previously been adding and installing things on previous games for the template. i use my template for each new game as a new prefix, but at the time, i had been updating the template without tracking it. nowadays i just create new prefix from clean template, install game, and go. i do test stability of each prefix before moving on. i also try to uninstall things not useful to the prefix, but windows' amazing registry just kinda, keeps traces of everything, always, for bill-gates-knows-why-reasons. it has proven to be quite useful, as apparently this was the key to getting DLSS on WD:L somwhere in those registry edits! hope someone finds what it is, i probably wont have time to play around with it any more tonight. but rest assured, the registry was the answer!

@Tilde88
Copy link

Tilde88 commented Jan 15, 2022

One more update on the reg files. dont waste your time looking through system.reg. it isnt there. it is defitely in user.reg, which is great, since thats only 380kilobytes, not 10megs

@Tilde88
Copy link

Tilde88 commented Jan 15, 2022

Ok everyone... final update. Answer is super simple lol.

change DLL override for nvcuda. you can use "built-in", or "built-in then native"... thats it, that was the triggering factor. so much time for me to find that lmao. oh well.

if you still have issues, follow my pastebin in the comment above, except change nvcuda to builtin. happy gaming! remember, DLSS makes the game go black when there is an in-game overlay

@jp7677
Copy link
Owner

jp7677 commented Jan 15, 2022

Thanks a lot for the detailed investigation! The game wanting nvcuda to be present might indeed be a good explanation. “Built-in then native” should be the default in wine, was there something in your procedure that sets nvcuda to “native”, assuming that nvcuda was already present in your wine installation?

@Tilde88
Copy link

Tilde88 commented Jan 15, 2022 via email

@SveSop
Copy link
Contributor

SveSop commented Jan 15, 2022

I have seen that happen from time to time for some unknown reason (to me).
Default behavior is "not be set" and thus do the built-in then native resolve of the dll. So, if you have not used a custom nvcuda lib, AND are using wine-staging, it should not be there in the list at all.

@jp7677
Copy link
Owner

jp7677 commented Jan 15, 2022

If it is indeed nvcuda that is missing, the reason why it is needed could be this: ValveSoftware/wine#119 (comment)

@sigzegv
Copy link

sigzegv commented Jan 20, 2022

Just to add some information about the previous nvngx discussion, I also needed to add nvngx.dll and _nvngx.dll (+ the native override) to my concerned wineprefix to make DLSS be activable in games (I don't use proton or lutris for various gog games), the nvapi dlls overrides alone were not suficient.

@gardotd426
Copy link
Author

Just to add some information about the previous nvngx discussion, I also needed to add nvngx.dll and _nvngx.dll (+ the native override) to my concerned wineprefix to make DLSS be activable in games

This was never the issue. It was indeed nvcuda, which was set to ??? just as @Tilde88 mentioned.

Wine+the Nvidia driver is supposed to symlink nvngx.dll and _nvngx.dll into the wineprefix of any prefix where dxvk-nvapi is attempted to be used. I have about 10 games that use DLSS, and that symlink was created automatically on every single one of them.

Obviously, the symlinks are required, so if anyone is ever having issues with enabling DLSS, checking path/to/wineprefix/drive_c/windows/system32 and making sure nvngx.dll an _nvngx.dll are there is one of the first things you should do, but that was never the issue here, this was already discussed much earlier in the thread.

Anyway, @jp7677 it was indeed the nvcuda thing. Setting it to builtin allowed DLSS to be enabled. It makes pretty much zero difference, because for some reason this game refuses to use all of my 3090 (and it's not my CPU, for 1 I have a 5900X the 5900X is only at like 6 or 7% usage). Using DLSS Performance gets me about a 7% increase in framerate while seeing my GPU usage drop to avoid any larger performance gain (same with Balanced and Quality, just with slightly less of a performance "gain").

That's obviously not a dxvk-nvapi issue. With DLSS enabled, my GPU will max out at 70% usage, and this is at 1440p. Anyway I'll move that discussion over to the vkd3d-proton guys, this issue is closed.

The solution is to check winecfg for nvcuda in the libraries overrides list and double-click it and change it to builtin or builtin, then native (or use WINEDLLOVERRIDES, etc).

As liam said in the issue thread @jp7677 linked, this is apparently only an issue in a very narrow range of DLSS versions, so this probably won't be something that comes up very often, but yeah, this one's solved, closing.

@SveSop
Copy link
Contributor

SveSop commented Jan 20, 2022

@gardotd426

Wine+the Nvidia driver is supposed to symlink nvngx.dll and _nvngx.dll into the wineprefix of any prefix where dxvk-nvapi is attempted to be used. I have about 10 games that use DLSS, and that symlink was created automatically on every single one of them.

Obviously, the symlinks are required, so if anyone is ever having issues with enabling DLSS, checking path/to/wineprefix/drive_c/windows/system32 and making sure nvngx.dll an _nvngx.dll are there is one of the first things you should do, but that was never the issue here, this was already discussed much earlier in the thread.

Bare-bones wine-staging-7.0 does not create symlinks to nvngx.dll or _nvngx.dll by itself automatically. You still have to add the symlinks manually in that case. There is no internal mechanic in dxvk-nvapi or the driver to do this.

Wine may also need the patch that adds NVIDIANGX to the registry (UE4 i think require this):
ValveSoftware/wine@f15f480
https://github.com/lutris/wine/blob/lutris-fshack-6.21-4/lutris-patches/ngx_dll_regkey.mypatch

In other words: If you want to use DLSS in a game/app, you can't just use default wine/wine-staging and think this works "out-of-the-box". Lutris and Steam Proton takes does all this for the user. Lutris provided wine versions also have these patches.

Good you got the issue sorted tho 👍

@sigzegv
Copy link

sigzegv commented Jan 20, 2022

with wine-ge 7.0 it didn't created the symlinks either for me

@jp7677
Copy link
Owner

jp7677 commented Jan 20, 2022

@Tilde88 @gardotd426 Thanks a lot for the investigation and confirmation, I've added a note to https://github.com/jp7677/dxvk-nvapi/wiki/Quirks-for-usage-with-DXVK-NVAPI#dlss-2138-through-2140

@sigzegv yeah, nvgx.dll and _nvgx.dll needs to be present as well. I should indeed add a note to the Readme about this for usage with stand-alone Wine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants