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 Battlefield V #45

Closed
gardotd426 opened this issue Oct 2, 2021 · 14 comments
Closed

Enabling nvapi breaks Battlefield V #45

gardotd426 opened this issue Oct 2, 2021 · 14 comments

Comments

@gardotd426
Copy link

gardotd426 commented Oct 2, 2021

Since the new DLSS support was enabled for DX12 games, I've gone about testing the DX12 DLSS games in my library. Control and Cyberpunk 2077 both work perfectly with DLSS. Watch Dogs 2 doesn't but that's because it doesn't work with vkd3d-proton at all yet. My next DX12 DLSS title to text was Battlefield V, which unlike the other games uses DLSS 1 and not 2. When trying to run the game w/ dxvk-nvapi, the Frostbite window pops up but is all white, and a few seconds later it crashes. I tried several times with the same result. Disabling dxvk-nvapi and just using vkd3d-proton by itself causes the game to work again.

System Information

Distribution: Arch Linux
Kernel: 5.14.7-tkg-cfs
GPU: Nvidia RTX 3090
CPU: AMD Ryzen 9 5900X
Nvidia Drivers: 470.74

bfv_dxgi.log and dxvk-nvapi.log:
logs.tar.gz

@jp7677
Copy link
Owner

jp7677 commented Oct 2, 2021

Looking at the dxvk-nvapi logs, this could be a reason why Frostbite don't want to continue:
NvAPI_QueryInterface NvAPI_D3D12_CreateGraphicsPipelineState: Not implemented method
I guess the engine wants to use one of those extensions: https://docs.nvidia.com/gameworks/content/gameworkslibrary/coresdk/nvapi/group__dx.html#ga113a0cfdc621df184258da51fcb2caba which aren't supported.

@gardotd426
Copy link
Author

gardotd426 commented Oct 2, 2021

Ah, yeah I saw that but other games that work have several Not implemented method messages in their logs too, so I didn't think it would be the cause. Like Control and Cyberpunk 2077 both have:

NvAPI_QueryInterface NvAPI_DRS_FindApplicationByName: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_DestroySession: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_CreateSession: Not implemented method

I just figured it was similar to a fixme in wine.

Should I open an issue w/ vkd3d-proton?

@jp7677
Copy link
Owner

jp7677 commented Oct 2, 2021

Please wait with opening an issue at VKD3D-Proton. We should at least know what the engine exactly wants to do and have an idea if supporting is even possible.

Are you able to compile DXVK-NVAPI yourself?

@jp7677
Copy link
Owner

jp7677 commented Oct 2, 2021

May be you get some more meaningful logging with #46

@gardotd426
Copy link
Author

Are you able to compile DXVK-NVAPI yourself?

That's what I've been doing, yeah

May be you get some more meaningful logging with #46

Alright sure thing I'll give it a shot

@gardotd426
Copy link
Author

Okay, that fixes it. Well obviously DLSS still isn't available in the game, it's grayed out but I'm assuming that's expected since as you said the extension isn't supported in vkd3d-proton yet. But the game launches fine. Here's the dxvk-nvapi log. I deleted a bunch of the NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK lines just so it wasn't so much spam but yeah:

---------- 2021-10-02 18:07:18 ----------
DXVK-NVAPI v0.4-40-g8a2ddd2 (bfv.exe)
NVML loaded and initialized successfully
NvAPI Output: \\.\DISPLAY1
NvAPI Output: \\.\DISPLAY2
NvAPI Device: NVIDIA GeForce RTX 3090 (470.74.0)
DXVK_NVAPI_DRIVER_VERSION is set to '47141', reporting driver version 471.41
NvAPI_Initialize: OK
NvAPI_QueryInterface 0x33c7358c: Unknown function ID
NvAPI_QueryInterface 0x593e8644: Unknown function ID
NvAPI_QueryInterface NvAPI_DRS_CreateSession: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_LoadSettings: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_FindApplicationByName: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_DestroySession: Not implemented method
NvAPI_GetInterfaceVersionString: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_EnumLogicalGPUs: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_QueryInterface NvAPI_GPU_GetPstates20: Not implemented method
NvAPI_Initialize: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_QueryInterface 0xf1ea1980: Unknown function ID
NvAPI_D3D12_IsNvShaderExtnOpCodeSupported 1 (NV_EXTN_OP_SHFL): OK
NvAPI_D3D12_IsNvShaderExtnOpCodeSupported 9 (UNKNOWN_EXTN_OP): OK
NvAPI_QueryInterface 0x32650af: Unknown function ID
NvAPI_D3D12_IsNvShaderExtnOpCodeSupported 1 (NV_EXTN_OP_SHFL): OK
NvAPI_DISP_GetGDIPrimaryDisplayId: OK
NvAPI_Mosaic_GetDisplayViewportsByResolution: Mosaic not active
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_EnumNvidiaDisplayHandle 0: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_QueryInterface 0xb7fbdbfa: Unknown function ID
NvAPI_QueryInterface NvAPI_GPU_GetConnectedDisplayIds: Not implemented method
NvAPI_GetErrorMessage -3 (NVAPI_NO_IMPLEMENTATION): OK
NvAPI_DISP_GetGDIPrimaryDisplayId: OK
NvAPI_Mosaic_GetDisplayViewportsByResolution: Mosaic not active
NvAPI_DISP_GetGDIPrimaryDisplayId: OK
NvAPI_Mosaic_GetDisplayViewportsByResolution: Mosaic not active
NvAPI_DISP_GetGDIPrimaryDisplayId: OK
NvAPI_Mosaic_GetDisplayViewportsByResolution: Mosaic not active
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_QueryInterface NvAPI_D3D12_SetDepthBoundsTestValues: Not implemented method
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK

@jp7677
Copy link
Owner

jp7677 commented Oct 2, 2021

Oh, wow, I didn't expected that ;). So the game wants SetDepthBoundsTest for D3D12. DXVK supports an extension for that for D3D11, we might indeed ask if this is doable for D3D12/VKD3D-Proton.
About DLSS, the engine wanting SetDepthBoundsTest should not be related to DLSS, strange that the option is still disabled. Probably something else.

I've improved the branch, there should be no more log spam and NvAPI_D3D12_SetDepthBoundsTestValues returns OK now (although it does nothing).

@gardotd426
Copy link
Author

Okay I'll pull and build

@jp7677 jp7677 changed the title Enabling nvapi Breaks Battlefield V Enabling nvapi breaks Battlefield V Oct 3, 2021
@jp7677
Copy link
Owner

jp7677 commented Oct 4, 2021

@gardotd426 I have update that branch and actually implemented SetDepthBounds (after some hints from the VKD3D-Proton side), could you please try again?

@gardotd426
Copy link
Author

Sure can

@gardotd426
Copy link
Author

Still same situation. Game launches, DLSS is grayed out.

---------- 2021-10-03 22:21:19 ----------
DXVK-NVAPI v0.4-43-gd670643 (bfv.exe)
NVML loaded and initialized successfully
NvAPI Output: \\.\DISPLAY1
NvAPI Output: \\.\DISPLAY2
NvAPI Device: NVIDIA GeForce RTX 3090 (470.74.0)
DXVK_NVAPI_DRIVER_VERSION is set to '47141', reporting driver version 471.41
NvAPI_Initialize: OK
NvAPI_QueryInterface 0x33c7358c: Unknown function ID
NvAPI_QueryInterface 0x593e8644: Unknown function ID
NvAPI_QueryInterface NvAPI_DRS_CreateSession: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_LoadSettings: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_FindApplicationByName: Not implemented method
NvAPI_QueryInterface NvAPI_DRS_DestroySession: Not implemented method
NvAPI_GetInterfaceVersionString: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_EnumLogicalGPUs: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_QueryInterface NvAPI_GPU_GetPstates20: Not implemented method
NvAPI_Initialize: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_QueryInterface 0xf1ea1980: Unknown function ID
NvAPI_D3D12_IsNvShaderExtnOpCodeSupported 1 (NV_EXTN_OP_SHFL): OK
NvAPI_D3D12_IsNvShaderExtnOpCodeSupported 9 (UNKNOWN_EXTN_OP): OK
NvAPI_QueryInterface 0x32650af: Unknown function ID
NvAPI_D3D12_IsNvShaderExtnOpCodeSupported 1 (NV_EXTN_OP_SHFL): OK
NvAPI_DISP_GetGDIPrimaryDisplayId: OK
NvAPI_Mosaic_GetDisplayViewportsByResolution: Mosaic not active
NvAPI_D3D12_CreateGraphicsPipelineState 3 (NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION): OK
NvAPI_DISP_GetDisplayIdByDisplayName \\.\DISPLAY1: OK
NvAPI_EnumNvidiaDisplayHandle 0: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_QueryInterface 0xb7fbdbfa: Unknown function ID
NvAPI_QueryInterface NvAPI_GPU_GetConnectedDisplayIds: Not implemented method
NvAPI_GetErrorMessage -3 (NVAPI_NO_IMPLEMENTATION): OK
NvAPI_DISP_GetGDIPrimaryDisplayId: OK
NvAPI_Mosaic_GetDisplayViewportsByResolution: Mosaic not active
NvAPI_DISP_GetGDIPrimaryDisplayId: OK
NvAPI_Mosaic_GetDisplayViewportsByResolution: Mosaic not active
NvAPI_DISP_GetGDIPrimaryDisplayId: OK
NvAPI_Mosaic_GetDisplayViewportsByResolution: Mosaic not active
NvAPI_D3D12_SetDepthBoundsTestValues: OK

@jp7677
Copy link
Owner

jp7677 commented Oct 4, 2021

About DLSS not being available, this is indeed due to DLSS version 1 being used. According to Discord conversation, only DLSS version 2.x+ is supported by Proton.

@jp7677
Copy link
Owner

jp7677 commented Oct 4, 2021

The BF5 crash should be fixed with a3e0ecc
Please let me know if I screwed things up..

@jp7677 jp7677 closed this as completed Oct 4, 2021
@gardotd426
Copy link
Author

Yeah it still works as it did, so you're good.

Battlefield V always freezes within 5 minutes of launching with DX12, but that's not dxvk-nvapi's fault, it happens with dxvk-nvapi disabled too. I'm gonna try and bisect and report it to the vkd3d-proton guys later.

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

2 participants