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

Enabling NVAPI breaks Monster Hunter World #47

Closed
Saancreed opened this issue Oct 3, 2021 · 15 comments · Fixed by #101
Closed

Enabling NVAPI breaks Monster Hunter World #47

Saancreed opened this issue Oct 3, 2021 · 15 comments · Fixed by #101

Comments

@Saancreed
Copy link
Collaborator

MHW (which is a DLSS 1.1.13 title) crashes shortly after launch with DXVK-NVAPI enabled. Setting WINEDLLOVERRIDES='nvngx=' allows it to run again.

Proton log file (created with env DXVK_NVAPI_LOG_LEVEL=info PROTON_LOG=1 PROTON_ENABLE_NVAPI=1 prime-run %command%): steam-582010.log

One line of interest is probably this:

011c:err:d3d12_device_vkd3d_ext_CreateCubinComputeShaderWithName: Failed to create cubin function module, vr -3.

Tested on GTX 1660 Ti Mobile (driver version 470.62.02), using Arch Linux, current Proton Experimental (but with Soldier runtime disabled) and DXVK-NVAPI from ca1d79c because I wasn't sure if the issue is related.

@jp7677
Copy link
Owner

jp7677 commented Oct 3, 2021

@rochaudhari Do you have an idea what might cause this?

@liam-middlebrook
Copy link
Contributor

Can you grab a log with #49 merged in please?

@rochaudhari
Copy link
Contributor

Sorry, I was on vacation and back today.
@Saancreed please provide the log mentioned by Liam.

@Saancreed
Copy link
Collaborator Author

@jp7677
Copy link
Owner

jp7677 commented Oct 6, 2021

Hi @Saancreed, may I ask you to try something?
The game asks for driver version, GPU architecture and adapter Luid before trying to start DLSS.

Could you try to override the driver version to something older (can be set with DXVK_NVAPI_DRIVER_VERSION)? May be that convinces the game to not initialize DLSS? If not, what happens if you modify the source of dxvk-nvapi to return an architecture older than Turing (https://github.com/jp7677/dxvk-nvapi/blob/master/src/nvapi_gpu.cpp#L145) or by return Error when it requests the Luid (https://github.com/jp7677/dxvk-nvapi/blob/master/src/nvapi_gpu.cpp#L118)?

If some of the above lets the game start, we might consider an exception for that specific process name. I don’t really like this, but it’s better than crashing. DLSS won’t work anyway since only DLSS 2 works with the current implementation.

@Saancreed
Copy link
Collaborator Author

NVNGX logs claim that the snippet expects driver version at least 418.81, so I tried setting DXVK_NVAPI_DRIVER_VERSION=41880 and yeah, it launches, but it also causes the game to display an annoying popup:

MHW-NVAPI

I can try claiming to have some older GPU architecture later.

@jp7677
Copy link
Owner

jp7677 commented Oct 6, 2021

I had implemented the driver version override to get rid of such a pop-up. Well, how thing turn out in reality … :)

@Saancreed
Copy link
Collaborator Author

Hacking NvapiAdapter::GetArchitectureId() to never return Turing or newer also allows the game to launch, this time without the popup message. NVNGX log in this case look like this:

[NGXCheckHardwareSupportUsingINF:172] Driver does not support NvAPI_GPU_GetValuesFromInstalledINF. Fallback to using GPU architecture and chip info of checking hardware support
[NGXCheckIfSupportedOnHW:267] error: unsupported hw detected

If some of the above lets the game start, we might consider an exception for that specific process name. I don’t really like this, but it’s better than crashing. DLSS won’t work anyway since only DLSS 2 works with the current implementation.

Well, in any case DXVK-NVAPI is not enabled by default for MHW; there's little reason to do so (other than to see the message about unsupported driver maybe, like me trying out random stuff to see if anything breaks 🙃).

But even then, I don't think this is the best place to include hacks like that. The best outcome would be to have NVNGX claim that DLSS < 2.0 is not supported, or have Proton set nvngx as disabled for MHW, like it already does in another similar case where a presence of some library can break the game.

@jp7677
Copy link
Owner

jp7677 commented Oct 6, 2021

Thanks for testing. Ah yeah, forgot about nvngx. Just using WINEDLLOVERRIDES=nvngx=d should indeed mitigate this too. And yes I agree, having Proton setting this when eventually (may be never) the DXVK nvapi hack is disabled, is probably more elegant than adding profiles in code. This with the assumption that monster hunter world is really an exception.

@jp7677
Copy link
Owner

jp7677 commented Oct 7, 2021

@Saancreed
Copy link
Collaborator Author

Yup, it's correct, but I have a small suggestion: prefer using nvngx= over nvngx=d to disable a DLL in Wine as the former is what the manpage recommends (and the latter only works because Wine interprets anything that isn't native, builtin, n or b as disabled).

@jp7677
Copy link
Owner

jp7677 commented Oct 7, 2021

Thanks, adjusted and learned something new :), I really thought d was the shortcut for “disabled”.

@Xephobia
Copy link

Xephobia commented Mar 9, 2022

any progress on this? The popup is still here

@jp7677
Copy link
Owner

jp7677 commented Mar 9, 2022

any progress on this? The popup is still here

What progress do you mean? The game still wants DLSS 1.x to my knowledge which is not supported via Proton. The work-around described here https://github.com/jp7677/dxvk-nvapi/wiki/Tips-and-tricks-for-usage-with-DXVK-NVAPI#monster-hunter-world-monsterhunterworldexe should let you start the game with NVAPI enabled but of course also without DLSS. There shouldn't be a popup.
Only way to change this, would be a game update.

jp7677 added a commit that referenced this issue Nov 26, 2022
See #47
This game wants to use DLSS 1.x but crashed during launch
when DLSS initialization fails. Spoof Pascal when we detect the
executable to prevent DLSS initialization.
@jp7677 jp7677 linked a pull request Nov 26, 2022 that will close this issue
@jp7677
Copy link
Owner

jp7677 commented Nov 29, 2022

A work-around has been implemented that prevents the game from seeing a DLSS capable GPU, thus DLSS cannot be enabled anymore and thus the game should no longer crash on launch.

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

Successfully merging a pull request may close this issue.

5 participants