protonscr

Dxvk v1.5 Wine-5.0-rc4 crash with Witcher 3, Battle net

dxvkclosed can't reproduce
doitsujin/dxvk#1324 · opened 2020-01-07 by cg666 · updated 2020-01-10 · 5 comments · github
1 matching comments, n / p to jump
Ccg666 2020-01-07 github

Software information

I build Wine and DXVK from sources. It used to work :)
But with latest wine and dxvk, I got a crash for Witcher 3 and Battle net app.

System information

  • GPU: GeForce GTX 960
  • Driver: NVIDIA 440.44
  • Wine version: wine-5.0-rc4
  • DXVK version: v1.5 (tag on git)

Do you need toolchain infomations ? I use Docker image to build everything

Apitrace file(s)

No API trace

Log files

No logs

Investigations

I got a crash with Witcher 3 (same with battle net app) :

wine: configuration in L"/mnt/ssd/wine/prefix" has been updated.
info:  Game: witcher3.exe
info:  DXVK: v1.5
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
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
wine: Unhandled page fault on execute access to 0000000000000000 at address 0000000000000000 (thread 005c), starting debugger...

After debugging as I can, I found the crash occurs here :

src/dxvk/dxvk_instance.cpp

m_vki = new vk::InstanceFn(true, this->createInstance());

At the end of InstanceLoader() constructor ?!?! My logs where displayed in InstanceLoader() ctr, but nothing in InstanceFn() ?!

Whatever, I rolled back to v1.4.6 and it's working.

So I test different versions, I found the issue appears here :

07c2de62be51928f87aa0612fbe05f6946991625 : no crash here
dc13f4831829d6b444306dbc38fa892d3f4e7d45 : crash here !

After testing, I notice VK_EXT_full_screen_exclusive is causing the crash. What I expect regarding the strange behavior of IntanceLoader/InstanceFn crash. (class size mismatch ? InstanceLoader::m_instance becomes invalid ?!)
If I disabled VK_EXT_full_screen_exclusive, application starts normaly.

In wine sources, I didn't find bindings for vkGetPhysicalDeviceSurfacePresentModes2EXT ? Is it related ?

vkGetPhysicalDeviceSurfacePresentModes2EXT() is a part of Vulkan 1.1.130 (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModes2EXT.html)
But in Dxvk's wiki page, NVIDIA driver shall be 430.14 or newer. But drivers 440.44 are shipped with Vulkan 1.1.119 (or I miss something on my setup)

Then I don't know how to fix it, does Dxvk shall check if vkGetPhysicalDeviceSurfacePresentModes2EXT() is available ? Or does Wine shall implement support of this function.

Hope it will help.

Ddoitsujin maintainer 2020-01-08 github

VK_EXT_full_screen_exclusive is optional (it's meant for Windows anyway), and DXVK does not call vkGetPhysicalDeviceSurfacePresentModes2EXT if the extension is not supported. Did you change anything?

What do you mean by "disabled VK_EXT_full_screen_exclusive"?

FWIW I cannot reproduce the problem at all.

Ccg666 2020-01-08 github

I don't change anything in the code. I used versions describe in previous post (tag v1.5 and wine 5.0-rc4)

"disabled VK_EXT_full_screen_exclusive" means :
include/vulkan/vulkan_win32.h

// #define VK_EXT_full_screen_exclusive 1

And :
src/vulkan/vulkan_presenter.cpp

    VkResult status;

//     if (m_device.features.fullScreenExclusive) {
//       status = m_vki->vkGetPhysicalDeviceSurfacePresentModes2EXT(
//         m_device.adapter, &surfaceInfo, &numModes, nullptr);
//     } else {
      status = m_vki->vkGetPhysicalDeviceSurfacePresentModesKHR(
        m_device.adapter, m_surface, &numModes, nullptr);
//     }

    if (status != VK_SUCCESS)
      return status;
    
    modes.resize(numModes);

//     if (m_device.features.fullScreenExclusive) {
//       status = m_vki->vkGetPhysicalDeviceSurfacePresentModes2EXT(
//         m_device.adapter, &surfaceInfo, &numModes, modes.data());
//     } else {
      status = m_vki->vkGetPhysicalDeviceSurfacePresentModesKHR(
        m_device.adapter, m_surface, &numModes, modes.data());
//     }

In that way, it's working. Probably, an issue with detection of vkGetPhysicalDeviceSurfacePresentModes2EXT availability ? (my setup maybe)

I can do the following tests :

  • test on clean prefix v1.5
  • test on clean prefix latest head with b376417
Ddoitsujin maintainer 2020-01-08 github

Well it sounds more like you're crashing in vkGetInstanceProcAddr already.

Do you have the Windows Vulkan loader installed inside your prefix or something?

Ccg666 2020-01-08 github

I have tested with latest version b376417 (not working)
I have tested same version with a clean prefix, and only override :

"d3d10"="native"
"d3d10_1"="native"
"d3d10core"="native"
"d3d11"="native"
"d3d9"="native"
"dxgi"="native"

And Witcher is starting correctly. Sorry for false positive. I'll try to figure which dll override is causing the mess.

Ccg666 2020-01-10 github

I removed the following DLL override in user.reg and this solve the issue :

msvcp100
msvcp110
msvcp120
msvcp140
msvcp80
msvcr100
msvcr100_clr0400
msvcr110
msvcr120
msvcr140
msvcr80
msvcr90
ucrtbase

Games seems to work perfectly. (Witcher, PoE, SC2, HeartStone ...)

I'm closing the issue.

Nothing extracted yet.