HansKristian-Work / vkd3d-proton

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

dxgi_vk_swap_chain_create_surface and Diablo 4 #1618

Closed kaanaksit closed 1 year ago

kaanaksit commented 1 year ago

I have played Diablo 4 on Lutris in my Linux machine for a month. But since today, it has stopped working with a vkd3d-proton-related error:

3705.787:064c:0650:err:vkd3d-proton:dxgi_vk_swap_chain_create_surface: Surface is not supported for presentation.

I didn't do anything besides updating Diablo 4 as usual through Battle.net and updating my system with sudo apt update && sudo apt dist-upgrade -y. Your help is appreciated!

System information

Log files

2023-07-03 10:57:47,895: Starting Lutris 0.5.13
2023-07-03 10:57:47,897: Using NVIDIA drivers 525.125.06 for x86_64
2023-07-03 10:57:47,897: GPU: NVIDIA GeForce RTX 2070
2023-07-03 10:57:47,897: GPU: NVIDIA GeForce RTX 3090
2023-07-03 10:57:47,897: GPU: 10DE:2204 10DE:147D (nvidia drivers)
2023-07-03 10:57:47,897: GPU: 10DE:1F07 10DE:12AD (nvidia drivers)
2023-07-03 10:57:48,066: Getting runner information for wine
Started initial process 39706 from gamemoderun /home/kaan/.local/share/lutris/runners/wine/lutris-GE-Proton8-10-x86_64/bin/wine /home/kaan/Games/battlenet/drive_c/Program Files (x86)/Battle.net/Battle.net Launcher.exe
Start monitoring process.
gamemodeauto: 
esync: up and running.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
Initial process has exited (return code: 0)
3704.576:064c:0650:info:vkd3d-proton:vkd3d_instance_apply_application_workarounds: Program name: "Diablo IV.exe"
3704.576:064c:0650:info:vkd3d-proton:vkd3d_instance_deduce_config_flags_from_environment: shader_cache is used, global_pipeline_cache is enforced.
3704.576:064c:0650:info:vkd3d-proton:vkd3d_config_flags_init_once: VKD3D_CONFIG=''.
3704.581:064c:0650:info:vkd3d-proton:vkd3d_get_vk_version: vkd3d-proton - applicationVersion: 2.9.0.
3704.581:064c:0650:info:vkd3d-proton:vkd3d_instance_init: vkd3d-proton - build: 6365efeba253807.
3704.837:064c:0650:info:vkd3d-proton:vkd3d_memory_info_upload_hvv_memory_properties: Topology: Device heaps are split. Assuming small BAR situation. Using HOST_COHERENT only.
3704.837:064c:0650:info:vkd3d-proton:vkd3d_bindless_state_get_bindless_flags: Device supports VK_EXT_mutable_descriptor_type.
3704.838:064c:0650:info:vkd3d-proton:d3d12_device_caps_init_shader_model: Enabling support for SM 6.6.
3704.838:064c:0650:fixme:vkd3d-proton:d3d12_device_caps_init_feature_options1: TotalLaneCount = 7872, may be inaccurate.
3704.838:064c:0650:info:vkd3d-proton:vkd3d_pipeline_library_init_disk_cache: Remapping VKD3D_SHADER_CACHE to: vkd3d-proton.cache.
3704.838:064c:0650:info:vkd3d-proton:vkd3d_pipeline_library_init_disk_cache: Attempting to load disk cache from: vkd3d-proton.cache.
3704.841:064c:0718:info:vkd3d-proton:vkd3d_pipeline_library_disk_thread_main: Performing async setup of stream archive ...
3704.841:064c:0718:info:vkd3d-proton:vkd3d_pipeline_library_disk_cache_merge: No write cache exists. No need to merge any disk caches.
3704.841:064c:0718:info:vkd3d-proton:vkd3d_pipeline_library_disk_cache_initial_setup: Merging pipeline libraries took 0.285 ms.
3704.841:064c:0718:info:vkd3d-proton:vkd3d_pipeline_library_disk_cache_initial_setup: Mapping read-only cache took 0.385 ms.
3704.841:064c:0718:info:vkd3d-proton:vkd3d_pipeline_library_disk_cache_initial_setup: Parsing stream archive took 0.011 ms.
3704.841:064c:0718:info:vkd3d-proton:vkd3d_pipeline_library_disk_thread_main: Done performing async setup of stream archive.
3705.546:064c:0650:info:vkd3d-proton:dxgi_vk_swap_chain_init: Creating swapchain (3840 x 2160), BufferCount = 3.
3705.546:064c:0650:info:vkd3d-proton:dxgi_vk_swap_chain_init_sync_objects: Enabling frame latency handles.
3705.787:064c:0650:err:vkd3d-proton:dxgi_vk_swap_chain_create_surface: Surface is not supported for presentation.
wine client error:5e4: write: Dosya betimleyici hatalı
wine client error:324: write: Dosya betimleyici hatalı
wine client error:1f4: write: Dosya betimleyici hatalı
2023-07-03 10:59:21,786: Some wine processes are still running: 23632, 16014, 14921, 20346, 21641
2023-07-03 10:59:21,789: Game still running (state: running)
2023-07-03 10:59:21,790: Stopping Blizzard Battle.net (wine)
HansKristian-Work commented 1 year ago

Sure this is not some PRIME weirdness?

kaanaksit commented 1 year ago

You may be right. I removed the .local/share/lutris folder from my system and also removed lutris in the process. I have also removed dxvk* with a sudo apt remove dxvk*, and rebooted.

After the reboot, I installed lutris, now I can not even install battle.net: resim

kaanaksit commented 1 year ago

Ok, I removed .cache/lutris and battle.net is installed. Along the way, installation installed a version of DXVK. I trust that I am using VKD3D version 2.9. After all this I still get the same error:

3363.543:05cc:05d0:err:vkd3d-proton:dxgi_vk_swap_chain_create_surface: Surface is not supported for presentation.

Blisto91 commented 1 year ago

Which dxvk version are you using. You will need at least 2.1 to be used along with vkd3d-proton 2.9

HansKristian-Work commented 1 year ago

Surface not being supported is more of a problem on the Vulkan end. It means you're not using the right GPU, or NV is trying to use PRIME but it cannot, or something like that.

The log above seems incomplete. There's no mention of which GPU is being used ... There's also two NV GPUs here. It's very plausible that it's picking the NV GPU that is not connected to a display or something, but that would not be a vkd3d-proton bug, but rather DXGI bug if anything.

kaanaksit commented 1 year ago

Which dxvk version are you using. You will need at least 2.1 to be used along with vkd3d-proton 2.9

I am using DXVK version 2.2

kaanaksit commented 1 year ago

How do I force VKD3D to use the correct GPU?

HansKristian-Work commented 1 year ago

This is up to DXVK DXGI I think. That's where adapters are enumerated. vkd3d-proton creates a device based on what app queries from DXGI and passes to D3D12DeviceCreate.

Blisto91 commented 1 year ago

dxvk have a device filter env var you could try and see if that helps or not https://github.com/doitsujin/dxvk#device-filter

kaanaksit commented 1 year ago

The game is now working. I changed to the correct lCD loader, and it just worked: resim

I also set DXVK_FILTER_DEVICE_NAME correctly on my system using the:

export DXVK_FILTER_DEVICE_NAME="NVIDIA GeForce RTX 2070" && lutris

On a shell, then run lutris. This fixed all my problems with the game.

kaanaksit commented 1 year ago

Thank you for your responses. I am closing this issue.