doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
12.71k stars 811 forks source link

Batman Arkham Knight: crash when enabling Gameworks features #788

Closed fazo96 closed 5 years ago

fazo96 commented 5 years ago

Software information

Batman Arkham Knight Highest settings, 2540x1440 resolution, vsync on, motion blur off

System information

Apitrace file(s)

Don't have it, the problem happens by turning on Gameworks features and restarting.

Now the game does not work anymore unless the configuration file is deleted or edited to disable Gameworks fetaures.

Everything else works fine, just wondering if it is possible to use the Gameworks features. Also curious about why the game lets me enable them if my card is supposed to be spoofed as AMD?

d3d11.log

info:  D3D11CoreCreateDevice: Probing D3D_FEATURE_LEVEL_11_0
info:  D3D11CoreCreateDevice: Using feature level D3D_FEATURE_LEVEL_11_0

dxgi.log

info:  Game: BatmanAK.exe
info:  DXVK: v0.93
warn:  OpenVR: Failed to locate module
info:  Enabled instance extensions:
info:    VK_KHR_get_physical_device_properties2
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
info:  GeForce GTX 1080:
info:    Driver: 396.54.9
info:    Vulkan: 1.1.85
info:    Memory Heap[0]: 
info:      Size: 8192 MiB
info:      Flags: 0x1
info:      Memory Type[7]: Property Flags = 0x1
info:      Memory Type[8]: Property Flags = 0x1
info:    Memory Heap[1]: 
info:      Size: 12011 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[9]: Property Flags = 0x6
info:      Memory Type[10]: Property Flags = 0xe
info:  Intel(R) Haswell Desktop:
info:    Driver: 18.2.5
info:    Vulkan: 1.1.80
info:    Memory Heap[0]: 
info:      Size: 1536 MiB
info:      Flags: 0x1
info:      Memory Type[0]: Property Flags = 0xf
info:  DXGI: NvAPI workaround enabled, reporting AMD GPU
warn:  DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT
info:  DXGI: NvAPI workaround enabled, reporting AMD GPU
info:  Game: BatmanAK.exe
info:  DXVK: v0.93
warn:  OpenVR: Failed to locate module
info:  Enabled instance extensions:
info:    VK_KHR_get_physical_device_properties2
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
info:  GeForce GTX 1080:
info:    Driver: 396.54.9
info:    Vulkan: 1.1.85
info:    Memory Heap[0]: 
info:      Size: 8192 MiB
info:      Flags: 0x1
info:      Memory Type[7]: Property Flags = 0x1
info:      Memory Type[8]: Property Flags = 0x1
info:    Memory Heap[1]: 
info:      Size: 12011 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[9]: Property Flags = 0x6
info:      Memory Type[10]: Property Flags = 0xe
info:  Intel(R) Haswell Desktop:
info:    Driver: 18.2.5
info:    Vulkan: 1.1.80
info:    Memory Heap[0]: 
info:      Size: 1536 MiB
info:      Flags: 0x1
info:      Memory Type[0]: Property Flags = 0xf
info:  DXGI: NvAPI workaround enabled, reporting AMD GPU
warn:  DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT
info:  DXGI: NvAPI workaround enabled, reporting AMD GPU
info:  DXGI: NvAPI workaround enabled, reporting AMD GPU
warn:  DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT
info:  Enabled device extensions:
info:    VK_EXT_shader_viewport_index_layer
info:    VK_EXT_transform_feedback
info:    VK_EXT_vertex_attribute_divisor
info:    VK_KHR_dedicated_allocation
info:    VK_KHR_descriptor_update_template
info:    VK_KHR_get_memory_requirements2
info:    VK_KHR_image_format_list
info:    VK_KHR_maintenance1
info:    VK_KHR_maintenance2
info:    VK_KHR_sampler_mirror_clamp_to_edge
info:    VK_KHR_shader_draw_parameters
info:    VK_KHR_swapchain
info:  DXVK: Read 5260 valid state cache entries
info:  DXVK: Using 4 compiler threads
info:  DXGI: NvAPI workaround enabled, reporting AMD GPU
info:  DXGI: NvAPI workaround enabled, reporting AMD GPU
warn:  DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT
info:  DXGI: NvAPI workaround enabled, reporting AMD GPU
info:  DXGI: Setting display mode: 2560x1440@60
warn:  DXGI: MakeWindowAssociation: Ignoring flags
doitsujin commented 5 years ago

What kind of Gameworks features are we talking about? If those use nvapi - which is still part of wine-staging and not disabled just by spoofing an AMD GPU - then it is expected to crash.

Please disable nvapi and nvapi64 in your wine prefix.

fazo96 commented 5 years ago

The Gameworks options are:

I disabled nvapi and nvapi64 using winecfg. The first two gameworks options cannot be selected now, and everything about the other two works great.

I was hoping I could turn on the improved rain (looks great) so I am very happy with the result.

So proper NVAPI support is needed for the rest of the features, is there any way that can happen? (just curious)

doitsujin commented 5 years ago

So proper NVAPI support is needed for the rest of the features, is there any way that can happen?

I don't think it's viable, at least not with the sparse public documentation. The wine-staging implementation could in theory be modified to interact with DXVK, but even then there are issues and it's known to break some D3D9 games even (such as Skyrim).

pchome commented 5 years ago

@fazo96 Try to disable nvcuda, nvcuvid, nvencodeapi and nvencodeapi64 as well.

The game probably trying to use cuda directly(?), and very likely fails w/ an "Unimplemented function" error. Or simply failing to load nvapi. Check WINE output.

Example (Just Cause 2):

wine: Call from 0x7b43c6bd to unimplemented function nvcuda.dll.cuD3D10CtxCreate, aborting
wine: Unimplemented function nvcuda.dll.cuD3D10CtxCreate called at address 0x7b43c6bd (thread 002e), starting debugger...
Unhandled exception: unimplemented function nvcuda.dll.cuD3D10CtxCreate called in 32-bit code (0x7b43c6bd).
...

p.s. I tried to create missing functions manually, but stuck at DX<>CUDA interops due to lack of knowledge. https://github.com/wine-staging/wine-patched/tree/master/dlls/nvcuda

jp7677 commented 3 years ago

The missing pieces in wine-staging-nvcuda and dxvk-nvapi for the PhysX related features for Arkham Knight have been identified, see https://github.com/jp7677/dxvk-nvapi/issues/27#issuecomment-886257383