HansKristian-Work / vkd3d-proton

Fork of VKD3D. Development branches for Proton's Direct3D 12 implementation.
GNU Lesser General Public License v2.1
1.83k stars 191 forks source link

Marvel's Guardians of the Galaxy (1088850) - NVIDIA issues - DLSS #1216

Open SveSop opened 2 years ago

SveSop commented 2 years ago

Adapter: NVIDIA RTX2070 Driver: 515.49.15 OS: Ubuntu 20.04 Proton version: GE-Proton-7.31 Run settings: PROTON_LOG=1 PROTON_ENABLE_NVAPI=1 %command%

Enable DLSS + set options in the "launcher" window. Steam log attached: steam_default.zip Error: err:d3d12_command_signature_init_state_template: Root parameter 26 is not a raw VA. Cannot implement command signature which updates root descriptor.

Possible cause: When using PROTON_ENABLE_NVAPI=1 the option DXVK_ENABLE_NVAPI=1 is automagically set by the proton script, and maybe vkd3d runs a slightly different codepath when not being fooled into AMD mode?

Simple quick-fix to that: Add this

        #if PROTON_ENABLE_NVAPI is set for NVIDIA adapter using vkd3d for Guardians of the Galaxy it will fail.
        if "SteamAppId" in os.environ:
            appid = os.environ["SteamAppId"]
            if os.environ["SteamAppId"] == "1088850":
                self.env["DXVK_ENABLE_NVAPI"] = "0"

below the lines that read

        if "enablenvapi" in self.compat_config:
            self.env["DXVK_ENABLE_NVAPI"] = "1"

in the proton script. This lets you start GotG without using DXVK_ENABLE_NVAPI=1 and it goes further. PS. You can no longer select DLSS in the launcher settings when doing that tho, but settings are saved from previous run.

Steam log attached: steam_no-dxvk-nvapi.zip

01f4:err:vkd3d_allocate_device_memory: Failed to allocate device memory (size 81920, type_flags 0x6, type_mask 0x3).
01f4:err:d3d12_resource_create_placed: Failed to create fallback committed resource.

Hmpf.. memory allocation error of sorts.

Reverted this PR https://github.com/HansKristian-Work/vkd3d-proton/pull/1147 , and yay.. a success! Steam log attached: steam_OK.zip

Any chance this could be looked at?

steam_default.zip steam_no-dxvk-nvapi.zip steam_OK.zip

doitsujin commented 2 years ago

VKD3D_CONFIG=force_raw_va_cbv should fix the first error message you quoted, however this will likely come at a significant performance cost. There's nothing we can do about that though, it is not possible to support the Nvidia fast path and complex ExecuteIndirect at the same time.

I'm having a hard time following the rest of your report (why exactly are we messing around with the Proton launch script?), not entirely sure what you're trying to tell us there.

As for the memory error, we're aware that linear memory allocations are currently broken and it is planned to rewrite this at some point, but I don't know why it would outright fail on your system. It really shouldn't, and it doesn't on my system.

SveSop commented 2 years ago

VKD3D_CONFIG=force_raw_va_cbv should fix the first error message you quoted, however this will likely come at a significant performance cost. There's nothing we can do about that though, it is not possible to support the Nvidia fast path and complex ExecuteIndirect at the same time.

Sorry, i forgot to mention i already tried that, and the image is distorted (black flickering triangles even tho the menus work) as i mention here: https://github.com/HansKristian-Work/vkd3d-proton/issues/1169#issuecomment-1207385218

_The game started if i use VKD3D_CONFIG=force_raw_va_cbv with DXVK_ENABLENVAPI=1, but image was distorted and flickering (although menu could be used).

I'm having a hard time following the rest of your report (why exactly are we messing around with the Proton launch script?), not entirely sure what you're trying to tell us there.

The reason for messing with the proton script is because if i do not do that, i have to use VKD3D_CONFIG=force_raw_va_cbv and the image is distorted and useless. "messing" with the proton script bypasses this by NOT setting DXVK_ENABLE_NVAPI=1 and thus bypassing this issue it seems. (Different codepath used for vkd3d?)

Sorry that i forgot to mention the earlier post in the closed thread, and that this hopefully explain the reasoning why force_raw_va_cbv did not work (for me).

As for the memory error, we're aware that linear memory allocations are currently broken and it is planned to rewrite this at some point, but I don't know why it would outright fail on your system. It really shouldn't, and it doesn't on my system.

I do not know what would be broken on my system. Perhaps some distro differences? Kernel? System settings? (Not using any particular settings that i am aware of that would change default steam proton settings, but i might need some perhaps?)

jp7677 commented 1 year ago

Short update on Guardians of the Galaxy on NVIDIA (Ampere, 530.41.03) with vkd3d-proton https://github.com/HansKristian-Work/vkd3d-proton/commit/f52e6482bc63d907054025c5eaf8c0d71a7a9f28:

This is essentially still the same status as described above.

jp7677 commented 1 year ago

The easiest work around for still having DLSS in this game is the following:

Note, this requires https://github.com/jp7677/dxvk-nvapi/commit/a2235c8c7510a6a53938be053482b32b6658b210

@SveSop no need to hack the proton script ;)

PS: Unfortunately the launcher is the same executable as the game itself, so we cannot create an application profile to implement this work around more elegantly.

jp7677 commented 1 year ago

About the ray tracing features, those can be enabled and do work when using the NVIDIA 535 driver and Proton Experimental Bleeding Edge i.c.w. exposing VKD3D dxr option. Proton Bleeding Edge is (currently) needed because it ships an update winevulkan that reports VK_EXT_pipeline_library_group_handles when the driver knows this extension.

The RT features are available when spoofing AMD and also when exposing NVIDIA (needs dxr,force_raw_va_cbv), but the explosions/flickering is obviously still there with the NVIDIA path. Note though that the DLSS trick from the former posting prevents RT from being enabled, so when spoofing AMD it is either enjoying DLSS (by enabling NVAPI) or enjoying RT (by not enabling NVAPI), but not both.

HansKristian-Work commented 8 months ago

@runar-work Can you test this game with VKD3D_CONFIG=force_raw_va_cbv and DXVK_ENABLE_NVAPI=1 on recent NV drivers?

runar-work commented 8 months ago

Tested with RTX 4070 and 545.29.6, and any attempts I made to skip AMD spoofing lead to massive vertex explosions, so seems there's still no way to get both DLSS and RT.

shelterx commented 6 months ago

Still does the same thing on 550.40.55, lot's of vertex explosions. So NVAPI needs to be disabled. which it is by default in Proton 9 for GOTG.