protonscr

[dxgi] Metro Exodus: Enhanced edition multi GPU crash regression

dxvkclosed dxgi
doitsujin/dxvk#3725 · opened 2023-11-20 by Blisto91 · updated 2023-12-12 · 4 comments · github
1 matching comments, n / p to jump
BBlisto91 2023-11-20 github

Since commit https://github.com/doitsujin/dxvk/commit/83a294285e90c65554bc851c4d4a126aa15916a4 Metro Exodus: EE seems to crash right on startup on multi GPU systems.
The reason i believe it might be multi GPU only is because the issue goes away when i either force select my RX 6800 through MESA_VK_DEVICE_SELECT=1002:73bf MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE=1 or DXVK_FILTER_DEVICE_NAME=6800

A extra note that i don't know is relevant to the issue or not is that both my GPUs support ray tracing which the game requires.

Software information

Metro Exodus: Enhanced edition

If not using Bleeding Edge or master vkd3d-proton VKD3D_CONFIG=dxr is needed to launch the game as it requires ray tracing. Using radv below version 23.2.1 will also need RADV_PERFTEST=rt

System information

Log files

Proton log, xrandr output and game log
steam-1449560.log
xrandr.txt
metroexodus.log

Edit: vulkaninfo added.
vulkaninfo-linux.txt

Possible lines of interest from Proton log

18522.785:0124:0128:info:vkd3d-proton:dxgi_vk_swap_chain_init: Creating swapchain (1920 x 1080), BufferCount = 2.
18522.785:0124:0128:warn:vkd3d-proton:d3d12_resource_validate_desc: Invalid format 0.
err:   DXGI: CreateSwapChainForHwnd: Failed to create swap chain, hr -2147024809
BBlisto91 2023-11-21 github

Log with extra logging. Made on X11
steam-1449560-extra-logging.log

Extra test scenarios:
Primary monitor displayport moved to iGPU (motherboard) instead of dGPU. Issue still occurs.
Primary monitor connected to dGPU displayport and secondary monitor added plugged in to iGPU via HDMI. Issue still occurs.

BBlisto91 2023-11-21 github

After some more testing it actually seems like with the above commit the game behaves more like on native Windows. On Windows when the game is made to run on the iGPU it will crash at the same spot whereas dGPU works fine.

The more real issue seems to be that the game selects the iGPU by default on Linux no matter where the monitor is plugged in. On Windows the dGPU is selected by default when my monitor is connected to it. This is both in Power Saving and High Performance mode and i have to force the iGPU to be selected specifically if want to use it (where it then crashes). Switching the displayport cable to the motherboard switches the GPU selected in both power modes to the iGPU.

Ggofman 2023-11-22 github

So I think it is clear now. The game selects which GPU it wants to use ignoring dxgi outputs binding to adapters. Then it crashes (on Windows as well) if selected GPU with dxgi adapter doesn't have dxgi outputs (@Blisto91 made it on Windows by either forcing iGPU for the game or replugging monitor from dGPU to iGPU output). The only difference is that on Win it selects dGPU while on problematic setups on Linux it selects iGPU. I figured the game chooses GPU with more dedicated VRAM (as reported by IDXGIAdapter::GetDesc3) after dropping incompatible ones (lacking d3d12 features or having DXGI_ADAPTER_FLAG3_SOFTWARE flag). On Blisto's machine uner Linux dGPU has 16GB device local memory and 20GB is reported for iGPU. On Windows (through dxgi) it is 16GB / 500MB.

So it is a game bug all around the place, if we want to do anything with it it can only be made through some game specific workaround (easiest is probably setting DXGI_ADAPTER_FLAG3_SOFTWARE for iGPUs for the game or just skipping the iGPU from enumeration). The alternative would be to have dedicated memory capped for iGPUs, but I am not sure it won't break more than fix.