protonscr

[DXGI/D3D11][Unreal Engine 4.25.4 Editor/OHDcore Mod Kit] D3D11SwapChain: Failed to recreate swap chain

dxvkclosed
doitsujin/dxvk#3927 · opened 2024-03-27 by hadi77ir · updated 2024-03-30 · 5 comments · github
Hhadi77ir 2024-03-27 github

First try:

  • Downloaded the mod kit/editor through "legendary".
  • Added it to Steam, set compatibility options to force "Proton Experimental".
  • It got stuck at Loading screen, then at the end of "loading" phase (somewhere near 90%) crashed.
  • It tried to launch "Crash Reporter" but for some reason (which later appeared to be the same issue with DXVK in Unreal Editor 4), there was just a black window.

Second try:

  • I simply installed Heroic Game Launcher, it detected the mod kit.
  • Then installed Wine-GE-Latest and made sure that it has DXVK installed.
  • Same result! It didn't run and there was just an empty black window for "crash reporter".

Third try:

  • Open a terminal window, set WINEPREFIX to the one from Heroic Game Launcher and add Wine-GE-Latest to PATH.
  • Still the same result. This time the error line appears in logs:
info:  Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Color space:  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
info:    Present mode: VK_PRESENT_MODE_IMMEDIATE_KHR (dynamic: yes)
info:    Buffer size:  1290x730
info:    Image count:  3
info:    Exclusive FS: 1
err:   D3D11SwapChain: Failed to recreate swap chain: VK_ERROR_OUT_OF_DEVICE_MEMORY
err:   DXGI: CreateSwapChainForHwnd: Failed to create swap chain, hr -2147467259
info:  Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Color space:  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
info:    Present mode: VK_PRESENT_MODE_IMMEDIATE_KHR (dynamic: yes)
info:    Buffer size:  1290x730
info:    Image count:  3
info:    Exclusive FS: 1
err:   D3D11SwapChain: Failed to recreate swap chain: VK_ERROR_OUT_OF_DEVICE_MEMORY
err:   DXGI: CreateSwapChainForHwnd: Failed to create swap chain, hr -2147467259
  • Then it tries to launch its "crash reporter", which fails to draw its UI with the following error appearing in the logs (stderr):
info:  Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Color space:  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
info:    Present mode: VK_PRESENT_MODE_IMMEDIATE_KHR (dynamic: yes)
info:    Buffer size:  750x594
info:    Image count:  3
info:    Exclusive FS: 1
err:   D3D11SwapChain: Failed to recreate swap chain: VK_ERROR_OUT_OF_DEVICE_MEMORY
err:   DXGI: CreateSwapChainForHwnd: Failed to create swap chain, hr -2147467259
  • When UE4Editor crashes and its crash reporter launches, its crash logs are copied to the clipboard. Those lines are attached in ue4-crash-log.txt

Fourth try:

  • In the same terminal window, make sure DXVK won't be used in the prefix.
  • Gets running and opens the editor window, but with unusable UI.

Fifth try:

  • Make a clean WINEPREFIX, using distro-provided Wine binaries.
  • Make sure WineD3D is being used.
  • It opens and the UI "seems to be" usable.

Software information

OHDcore Mod Kit (Operation Harsh Doorstop Mod kit, simply Unreal Engine 4.25.4 Editor with a bundled project)

System information

  • GPU: NVIDIA GTX 950M (4GB)
  • Driver: NVIDIA 550.54.14
  • Wine version: Wine-9.4 / Wine-GE-Latest (wine-8.0-3001-g39021e609a2 (Staging))
  • DXVK version: 2.3 (AUR dxvk-bin, uses binaries from GitHub releases)
  • Environment variables: VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
  • Environment: nvidia-xrun with icewm on Arch Linux

Apitrace file(s)

Couldn't get apitrace to work with native Wine and Wine-GE-latest with WineD3D forced. But when I'm trying to run it with DXVK enabled or WineD3D crashes, apitrace works and there is a trace file. I need some help with this.

Nonetheless, those files are attached as they may be helpful.

Log files

  • wine.log and ue4-crash-log are from my third try, DXVK v2.3 and Wine-GE-Latest.
  • wine-staging-wined3d.log is from my fourth try.

wine.log
ue4-crash-log.txt
UE4Editor.trace.xz
CrashReportClientEditor.trace.xz

wine-staging-wined3d.log

KK0bin maintainer 2024-03-27 github

Try lowering graphics settings, it very much sounds like the game is running out of VRAM.

Hhadi77ir 2024-03-27 github

Well it is the Unreal Engine 4.25.4 Editor. Not only I don't have access to any graphics settings, it crashes before opening and even the "crash reporter" can't render its UI as well.

Hhadi77ir 2024-03-30 github

If it helps, I see the following line being repeated when launching with vanilla Wine 9.0 (WineD3D):

030c:fixme:dxgi:d3d11_swapchain_present Unimplemented flags 0x200.
Hhadi77ir 2024-03-30 github

Tried several things this morning:

  • Discovered that Unreal Engine 4 has a built-in Vulkan rendering backend (VulkanRHI), tried to force it. Result? It didn't work too.
  • Tried running Vulkan demos through Wine. This one didn't work too.
  • Tried running native OpenGL demos with prime-run and those crashed too. With errors regarding "Not enough memory available" (BadAlloc).

At this point, it seems that NVIDIA driver 550.54 is the culprit on X11. Found that there are reports about it on reddit. Right now I'm downgrading the driver and will try again.

Hhadi77ir 2024-03-30 github

Confirmed: Downgrading to 535.171.04-1 (via nvidia-535xx-dkms) and abandoning nvidia-xrun-pm and using optimus-manager-git solved all of my problems. DXVK is running fine now (with better performance compared to Vulkan RHI, which takes a very long time for compiling shaders).

Proton versions

Launch options