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

Test case for VK_NV_device_generated_commands #1169

Closed
canadacow opened this issue Jul 15, 2022 · 8 comments
Closed

Test case for VK_NV_device_generated_commands #1169

canadacow opened this issue Jul 15, 2022 · 8 comments

Comments

@canadacow
Copy link

I saw master recently activated the use of the VK_NV_device_generated_commands.

In the case of Marvel's Guardians of the Galaxy (GOTG), if the GPU reported to the exe is an Nvidia GPU, these sets of indirect commands run and the result is a crash (using latest Nvidia drivers on Windows.) On the other hand, if the GPU reported is an AMD GPU (this is default behavior from dxvk) this path is never exercised since it appears GOTG to never call DX12's CreateCommandSignature. There are two distinct code paths in GOTG and only the AMD path is exercised by default in dxvk/vkd3d.

What is the current test case for VK_NV_device_generated_commands extension?

When taking the Nvidia path in GOTG, would you expect the current CreateCommandSignature DX12 calls to succeed and not crash?

Without the VK_NV_device_generated_commands extension available, if the Nvidia vendor id is reported to GOTG, the following is the output of the main menu on nvidia hardware, due to CreateCommandSignature calls failing due to missing support.

image

@canadacow
Copy link
Author

canadacow commented Jul 15, 2022

Expected output: (Minus Juice logo, of course)
image

@oscarbg
Copy link

oscarbg commented Jul 16, 2022

interesting issue.. hope also someone tests with radv (now with dgc in mesa master also) reporting as NV device.. finally what HUD is that reporting cache and compression.. built in from GOTG? no idea, no MangoHUD? thanks..

@canadacow
Copy link
Author

finally what HUD is that reporting cache and compression

That's the Juice virtual GPU running through vkd3d. It's applied to any content run through the virtual GPU. https://www.juicelabs.co/

Not relevant to this task except that a Juice GPU vendor ID also sends GOTG down the use of the VK_NV_device_generated_commands extension by default.

@HansKristian-Work
Copy link
Owner

HansKristian-Work commented Jul 18, 2022

GotG does not work on NV to begin with due to lack of linear image support for 3D images. What is the problem here? Running with NV vendor ID on AMD GPU? If it's NV GPU you likely need VKD3D_CONFIG=force_raw_va_cbv.

@canadacow
Copy link
Author

What is the problem here?

Not to let the GotG issues bury the lead, but what exactly is the test case used for NV_device_generated_commands? I was hoping to adopt it into the Juice testing as well if I'm to add support for the extension within Juice.

I thumbed through the related diffs and I can't seem to figure out which software exactly would be using the NV_device_generated_commands.

NV to begin with due to lack of linear image support for 3D images.

FWIW, on latest Windows nvidia drivers on a 2080 Ti, I am able to run GotG without an issue so long as the AMD vendor ID is returned from dxvk/dxgi. I mean, the log is full of spam confirming the inability of 3D images in linear layout, but it appears to work and appears identical to the real game.

Testing the 3D linear image support on my GPU shows that while the get format properties call used returns format not supported, the memory allocation works and binding a 3D image to linear memory works in the sense that it doesn't crash/fail/render incorrectly. I don't know what to make of it.

@HansKristian-Work
Copy link
Owner

HansKristian-Work commented Jul 21, 2022

but what exactly is the test case used for NV_device_generated_commands

Halo Infinite

but it appears to work and appears identical to the real game.

That is surprising. Does global illumination work at all in that case? Guess I'll test this again ...

@canadacow
Copy link
Author

Halo Infinite

Aha! Thank you @HansKristian-Work!

Does global illumination work at all in that case?

So far screenshots appear identical. I'll take a closer look. My specific configuration that I found worked as a 2080 Ti with 516.59 drivers. Closing the task.

@SveSop
Copy link
Contributor

SveSop commented Aug 7, 2022

@canadacow @HansKristian-Work
I see this is closed, but GotG actually dont work too bad on NV hardware (RTX2070 w/vulkan beta - 515.49.10) save for somewhat distorted image when using starlords "goggles".

For newer proton/vkd3d (> GE-proton7-18) i reverted #1147 and to run with DLSS you need to edit the proton script file and edit the DXVK part of nvapi like this:

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

and then run it with "PROTON_ENABLE_NVAPI": "1" This way you can enable DLSS ingame.

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

PS. For a slightly more elegant solution to the proton script i did this so i dont have edit if i play something else.. but it is somewhat outside the scope of vkd3d - its just for testing/verifying in the hopes of a fix, so i have not PR'ed this to GE.

--- a/proton	2022-08-06 22:07:59.543518146 +0200
+++ b/proton	2022-08-06 22:10:31.905652843 +0200
@@ -1511,6 +1511,12 @@
             if os.environ["SteamAppId"] == "1172470":
                 self.env["WINE_FULLSCREEN_FSR"] = "1"
 
+        #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"
+
         s = ""
         for dll in self.dlloverrides:
             setting = self.dlloverrides[dll]

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

4 participants