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

Control (2019): launcher crashes with vkd3d-proton + DXVK 2.1 #1395

Closed SuperSamus closed 1 year ago

SuperSamus commented 1 year ago

(Note: the bug may be caused by DXVK, and not by vkd3d-proton)

With a Wine prefix containing DXVK 2.1 + vkd3d-proton (and no other combination) launching Control's launcher, the launcher crashes. (There is no problem launching Control_DX11.exe, Control_DX12.exe, or the launcher with -dx11 or -dx12)

backtrace.txt

With the following logs:

info:  Game: Control.exe
info:  DXVK: v2.1
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
info:    OpenXR
info:  OpenVR: could not open registry key, status 2
info:  OpenVR: Failed to locate module
info:  Vulkan: Found vkGetInstanceProcAddr in winevulkan.dll @ 0x2d4ad3f00
info:  Enabled instance extensions:
info:    VK_KHR_get_surface_capabilities2
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
info:  AMD Radeon RX 6700 XT (RADV NAVI22):
info:    Driver: 22.3.3
info:    Vulkan: 1.3.230
info:    Memory Heap[0]:
info:      Size: 7644 MiB
info:      Flags: 0x0
info:      Memory Type[2]: Property Flags = 0x6
info:      Memory Type[4]: Property Flags = 0xe
info:      Memory Type[6]: Property Flags = 0xc6
info:      Memory Type[8]: Property Flags = 0xce
info:    Memory Heap[1]:
info:      Size: 12272 MiB
info:      Flags: 0x1
info:      Memory Type[0]: Property Flags = 0x1
info:      Memory Type[1]: Property Flags = 0x1
info:      Memory Type[3]: Property Flags = 0x7
info:      Memory Type[5]: Property Flags = 0xc1
info:      Memory Type[7]: Property Flags = 0xc7
info:  AMD Radeon Graphics (RADV RENOIR):
info:    Driver: 22.3.3
info:    Vulkan: 1.3.230
info:    Memory Heap[0]:
info:      Size: 2718 MiB
info:      Flags: 0x0
info:      Memory Type[2]: Property Flags = 0x6
info:      Memory Type[4]: Property Flags = 0xe
info:      Memory Type[6]: Property Flags = 0xc6
info:      Memory Type[8]: Property Flags = 0xce
info:    Memory Heap[1]:
info:      Size: 5437 MiB
info:      Flags: 0x1
info:      Memory Type[0]: Property Flags = 0x1
info:      Memory Type[1]: Property Flags = 0x1
info:      Memory Type[3]: Property Flags = 0x7
info:      Memory Type[5]: Property Flags = 0xc1
info:      Memory Type[7]: Property Flags = 0xc7
info:  Adapter LUID 0: 0:3f6
010c:info:vkd3d_instance_apply_application_workarounds: Detected game Control.exe, adding config 0x10, removing masks 0x0.
010c:info:vkd3d_instance_deduce_config_flags_from_environment: shader_cache is used, global_pipeline_cache is enforced.
010c:info:vkd3d_config_flags_init_once: VKD3D_CONFIG=''.
010c:info:vkd3d_get_vk_version: vkd3d-proton - applicationVersion: 2.8.0.
010c:info:vkd3d_instance_init: vkd3d-proton - build: ac8760c00534b0c.
010c:info:vkd3d_memory_info_upload_hvv_memory_properties: Topology: No more than 1 device local heap, assuming ReBAR-style access. Using DEVICE_LOCAL | HOST
_COHERENT for UPLOAD.
010c:info:vkd3d_memory_info_init_budgets: Applying resizable BAR budget to memory types: 0x88.
010c:info:vkd3d_bindless_state_get_bindless_flags: Device supports VK_EXT_mutable_descriptor_type.
010c:info:vkd3d_bindless_state_add_binding: Device supports VK_VALVE_descriptor_set_host_mapping!
010c:info:vkd3d_bindless_state_add_binding: Device supports VK_VALVE_descriptor_set_host_mapping!
010c:info:vkd3d_bindless_state_add_binding: Device supports VK_VALVE_descriptor_set_host_mapping!
010c:info:d3d12_device_caps_init_shader_model: Enabling support for SM 6.6.
010c:fixme:d3d12_device_caps_init_feature_options1: TotalLaneCount = 2560, may be inaccurate.
010c:info:vkd3d_pipeline_library_init_disk_cache: Remapping VKD3D_SHADER_CACHE to: Z:\home\user\.local\share\bottles\bottles\GOG\cache\vkd3d_shader\vkd3d
-proton.cache.
010c:info:vkd3d_pipeline_library_init_disk_cache: Attempting to load disk cache from: Z:\home\user\.local\share\bottles\bottles\GOG\cache\vkd3d_shader\vk
d3d-proton.cache.
011c:info:vkd3d_pipeline_library_disk_thread_main: Performing async setup of stream archive ...
011c:info:vkd3d_pipeline_library_disk_cache_merge: No write cache exists. No need to merge any disk caches.
011c:info:vkd3d_pipeline_library_disk_cache_initial_setup: Merging pipeline libraries took 16.514 ms.
011c:info:vkd3d_pipeline_library_disk_cache_initial_setup: Mapping read-only cache took 0.232 ms.
011c:info:d3d12_pipeline_library_read_blob_stream_format: Device teardown request received, stopping parse early.
011c:info:vkd3d_pipeline_library_disk_cache_initial_setup: Parsing stream archive took 17.281 ms.
011c:info:vkd3d_pipeline_library_disk_thread_main: Done performing async setup of stream archive.
wine: Unhandled page fault on execute access to 00000002D4AD45C0 at address 00000002D4AD45C0 (thread 010c), starting debugger...

Other combinations do not crash:

doitsujin commented 1 year ago

Can't reproduce, this works fine with proton-experimental for me. Launcher always shows and both the D3D11 and D3D12 options work.

SuperSamus commented 1 year ago

vkd3d-proton 2.8. (EDIT: Not 1.8) Playing the GOG version (I'm using Wine, not Proton). Crashes regardless if I launch it from GOG or DRM free.

mbriar commented 1 year ago

There is no vkd3d-proton 1.8, do you mean 2.8?

SuperSamus commented 1 year ago

Yes, sorry, I meant 2.8.

mbriar commented 1 year ago

From your backtrace

ELF 00007fec47200000-00007fec4bf80000 Deferred amdvlk64.so

you are using amdvlk as a vulkan driver, which is known to be all kinds of broken with vkd3d-proton.

edit: actually, nevermind. Doesn't appear to used after all looking at the actual DXVK/vkd3d-proton log output..

mbriar commented 1 year ago

The gog version works just fine in DX12 for me as well though on the same GPU and Mesa version.

SuperSamus commented 1 year ago

I have amdvlk installed, but I'm using RADV (AMD_VULKAN_ICD="RADV"). Also, I repeat that the actual game has no problem in either DX11 or DX12, only the launcher is problematic (meaning that you must skip it by using the arguments -dx11 or -dx12, or by launching Control_DX11.exe or Control_DX12.exe instead).

mbriar commented 1 year ago

Does anything change with RADV_PERFTEST=rt?

SuperSamus commented 1 year ago

With RADV_PERFTEST=rt, the combination of DXVK 2.0 + vkd3d-proton now shows the launcher instead of skipping straight to DX11 (and DX12 launches correctly). Every other combination behaves the same (that is, DXVK 2.1 + vkd3d-proton still crashes with the same logs). In-game ray-tracing works correctly.

K0bin commented 1 year ago

Please check which version of VKD3D-Proton you're using. DXVK 2.1 is incompatible with older builds of it.

Iglu47 commented 1 year ago

the game launcher of EGS-version works fine on nvidia pascal + 525.85.05 driver dxvk-2.1.r3.g2263dcad + vkd3d-proton-2.8.r67.g1ffe9d1e ( https://github.com/doitsujin/dxvk/commit/2263dcad954742d7415defec956219fb111d38bf https://github.com/HansKristian-Work/vkd3d-proton/commit/1ffe9d1e5ed1013d0a6e3d98d49aa722824c24f0 ) with VKD3D_CONFIG=dxr11,no_upload_hvv was used

Please check which version of VKD3D-Proton you're using. DXVK 2.1 is incompatible with older builds of it.

and crashed on dxvk-2.1.r3.g2263dcad + vkd3d-proton on 2.8 tag

00000100 (D) C:\Program Files\Epic Games\Control\Control.exe
        ["C:\Program Files\Epic Games\Control\Control.exe"]
        00000104    0 <==
        00000108    0     SGen worker
        0000010c    0     Finalizer
        00000120    0

the terminal-output.txt can be compared with

backtrace.txt

probably the problem is that vkd3d-proton didn't get a new release tag at the same time as dxvk 2.1 so it can be quite difficult to specify a minimum version of vkd3d-proton

Iglu47 commented 1 year ago

yea, bisecting test indicates that this https://github.com/HansKristian-Work/vkd3d-proton/commit/8c547213d5681524bebf04fec596368109c30185 version is the minimum required with dxvk 2.1 in this issue case (d3d12: Load winevulkan.dll directly if possible.)

Iglu47 commented 1 year ago

@SuperSamus could you retest with 2.9?

SuperSamus commented 1 year ago

Alright, with DXVK 2.2 + vkd3d-proton 2.9, Control.exe launches successfully! (The launcher is skipped, defaults to DX11)

Weirdly, though, DXVK 2.2 (or 2.1) alone crashes: backtrace.txt. I guess that it's a DXVK issue at this point, but... why 2.1 too? (I tested on a fresh prefix) (And if you are wondering, with neither of them it also launches successfully)