doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
13.32k stars 856 forks source link

Witcher 3 fails to load if VSync is enabled in-game #809

Closed DucDuNord closed 5 years ago

DucDuNord commented 5 years ago

The Witcher 3 runs perfectly on my system as long as I do not enable VSync via the in-game video menu. If VSync is enabled, only a black screen appears and no sound is played.

I discovered what was preventing The Witcher 3 from running by launching the game with Wine's built-in D3D support and disabling the options in the menu one-by-one, then relaunching the game with DXVK enabled.

I am not certain what would happen if I tried to enforce VSync from outside the game, as I do not know how this might be achieved on a Linux system.

Software information

The Witcher 3, any resolution

System information

Apitrace file(s)

Will provide this if required.

Log files

Will create these if required (I have disabled VSync, so I no longer run into this problem).

doitsujin commented 5 years ago

Works fine on my RX 480 with mesa 19.0 as well as stable mesa. Which desktop/compositor are you using? Are you on X11 or Wayland?

Can you please add log files?

DucDuNord commented 5 years ago

I am running Gnome-Shell 3.30.1, using X11 (can try Wayland, too, if you like - I think it's included as an option in Ubuntu).

I'll create the log files for you and post them here.

DucDuNord commented 5 years ago

CURRENT LOGS (NO VSYNC, WITCHER RUNS FINE)

Will now run the game with VSync enabled.

WITCHER3_D3D11.LOG

D3D11CoreCreateDevice: Probing D3D_FEATURE_LEVEL_11_0 info: D3D11CoreCreateDevice: Using feature level D3D_FEATURE_LEVEL_11_0 warn: DXVK: No matching border color found for (1e+10,1e+10,1e+10,1e+10)

WITCHER3_DXGI.LOG (You will notice that I changed the resolution a few times)

Game: witcher3.exe info: DXVK: v0.93 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 info: AMD RADV VEGA10 (LLVM 7.0.1): info: Driver: 18.99.99 info: Vulkan: 1.1.70 info: Memory Heap[0]: info: Size: 7920 MiB info: Flags: 0x1 info: Memory Type[0]: Property Flags = 0x1 info: Memory Heap[1]: info: Size: 256 MiB info: Flags: 0x1 info: Memory Type[2]: Property Flags = 0x7 info: Memory Heap[2]: info: Size: 8176 MiB info: Flags: 0x0 info: Memory Type[1]: Property Flags = 0x6 info: Memory Type[3]: Property Flags = 0xe warn: DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT info: Game: witcher3.exe info: DXVK: v0.93 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 info: AMD RADV VEGA10 (LLVM 7.0.1): info: Driver: 18.99.99 info: Vulkan: 1.1.70 info: Memory Heap[0]: info: Size: 7920 MiB info: Flags: 0x1 info: Memory Type[0]: Property Flags = 0x1 info: Memory Heap[1]: info: Size: 256 MiB info: Flags: 0x1 info: Memory Type[2]: Property Flags = 0x7 info: Memory Heap[2]: info: Size: 8176 MiB info: Flags: 0x0 info: Memory Type[1]: Property Flags = 0x6 info: Memory Type[3]: Property Flags = 0xe warn: DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT info: Game: witcher3.exe info: DXVK: v0.93 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 info: AMD RADV VEGA10 (LLVM 7.0.1): info: Driver: 18.99.99 info: Vulkan: 1.1.70 info: Memory Heap[0]: info: Size: 7920 MiB info: Flags: 0x1 info: Memory Type[0]: Property Flags = 0x1 info: Memory Heap[1]: info: Size: 256 MiB info: Flags: 0x1 info: Memory Type[2]: Property Flags = 0x7 info: Memory Heap[2]: info: Size: 8176 MiB info: Flags: 0x0 info: Memory Type[1]: Property Flags = 0x6 info: Memory Type[3]: Property Flags = 0xe warn: DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT info: Game: witcher3.exe info: DXVK: v0.93 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 info: AMD RADV VEGA10 (LLVM 7.0.1): info: Driver: 18.99.99 info: Vulkan: 1.1.70 info: Memory Heap[0]: info: Size: 7920 MiB info: Flags: 0x1 info: Memory Type[0]: Property Flags = 0x1 info: Memory Heap[1]: info: Size: 256 MiB info: Flags: 0x1 info: Memory Type[2]: Property Flags = 0x7 info: Memory Heap[2]: info: Size: 8176 MiB info: Flags: 0x0 info: Memory Type[1]: Property Flags = 0x6 info: Memory Type[3]: Property Flags = 0xe warn: DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT info: Enabled device extensions: info: VK_EXT_shader_viewport_index_layer info: VK_EXT_transform_feedback info: VK_EXT_vertex_attribute_divisor info: VK_KHR_dedicated_allocation info: VK_KHR_descriptor_update_template info: VK_KHR_get_memory_requirements2 info: VK_KHR_image_format_list info: VK_KHR_maintenance1 info: VK_KHR_maintenance2 info: VK_KHR_sampler_mirror_clamp_to_edge info: VK_KHR_shader_draw_parameters info: VK_KHR_swapchain info: DXVK: Read 1096 valid state cache entries info: DXVK: Using 4 compiler threads warn: DXGI: MakeWindowAssociation: Ignoring flags info: DXGI: Setting display mode: 3840x2160@60 info: DXGI: Setting display mode: 3840x2160@60 info: Game: witcher3.exe info: DXVK: v0.93 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 info: AMD RADV VEGA10 (LLVM 7.0.1): info: Driver: 18.99.99 info: Vulkan: 1.1.70 info: Memory Heap[0]: info: Size: 7920 MiB info: Flags: 0x1 info: Memory Type[0]: Property Flags = 0x1 info: Memory Heap[1]: info: Size: 256 MiB info: Flags: 0x1 info: Memory Type[2]: Property Flags = 0x7 info: Memory Heap[2]: info: Size: 8176 MiB info: Flags: 0x0 info: Memory Type[1]: Property Flags = 0x6 info: Memory Type[3]: Property Flags = 0xe warn: DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT info: DXGI: Setting display mode: 2048x1152@60 info: DXGI: Setting display mode: 3840x2160@60

DucDuNord commented 5 years ago

....And here are the logs from an attempt at running The Witcher 3 with VSync enabled.

I have also included a screenshot, illustrating how DXVK does load, yet somehow gets stuck (with '0.8' FPS measured).

witcher3_d3d11.log witcher3_dxgi.log screenshot from 2018-12-11 19-53-43

DucDuNord commented 5 years ago

Finally, the same logs using Wayland. VSync enabled, The Witcher 3 won't run.

witcher3_d3d11.log witcher3_dxgi.log

shmerl commented 5 years ago

@DucDuNord: What is your amdgpu version (kernel)?

Vsync works OK for me (4.19.5 and 4.20.0-rc6). But with XWayland framerate is capped no matter if vsync is enabled or not.

See https://gitlab.freedesktop.org/xorg/xserver/issues/20

Oschowa commented 5 years ago

FWIW, vsync has worked for a long time and still works with the latested stack for my and many other, so it's probably no dxvk bug.

This is currently with gnome-shell/X11 3.30, mesa-git, dxvk 0.93.

doitsujin commented 5 years ago

err: DxvkSurface::getSurfaceCapabilities: Failed to query surface capabilities

This one is interesting. I have no idea what could cause that to happen.

Can you test latest master? It has a different presentation backend, maybe that fixes the problem.

DucDuNord commented 5 years ago

@DucDuNord: What is your amdgpu version (kernel)?

The kernel version is 4.18.0-12-generic.

@ Doitsujin - I will figure out how to do that, and let you know the results.

By the by, I was wondering whether this could me related to my running a somewhat unusual hardware setup. My computer is a Lenovo Y510P laptop. The AMD Vega 56 card is connected to the laptop via a 'connector' device that converts the Lenovo Ultrabay into a regular PCIE3 slot.

The performance is equivalent to that of a 'regular' PC with a Vega 56, as you can see here:

https://www.youtube.com/watch?v=PVbsib8eHRg

I had to disable the built-in dedicated NVIDIA graphics chip before I could enable the Vega card in Linux, though.

shmerl commented 5 years ago

What kind of connector device is it, something standard from Lenovo?

DucDuNord commented 5 years ago

No, custom. The Y510P Ultrabay is, effectively, a proprietary PCIE3 slot. That way, Lenovo was able to market and sell additions to the laptop without anyone competing. Someone at Techinferno designed an adapter about two years ago that converted the slot into a regular PCIE one, so that cards made by other manufacturers, too, could be used. I've been using mine for about a year; first with Windows, now with Linux.

https://www.techinferno.com/index.php?/forums/topic/9686-y510p-ultrabay-graphics-card/

shmerl commented 5 years ago

You can check your dmesg for any abnormalities.

DucDuNord commented 5 years ago

Undoubtedly, yes, but I wouldn't know what to look for!

shmerl commented 5 years ago

Well, look for anything related to amdgpu in the timeframe when you launch the game.

DucDuNord commented 5 years ago

With regards to doing a 'master' build: I am afraid I am rather out of my depth. I installed glslang, gcc, meson, mingw-w64, and the Vulkan SDK packages, but couldn't get the compile process to complete successfully.

shmerl commented 5 years ago

How is it failing? You don't need Vulkan SDK as far as I know. You do need glslang-tools (at least it's called that Debian) for the validator.

Depending on your distro, you might need to update alternatives for mingw as well. See here.

doitsujin commented 5 years ago

@DucDuNord here's a build if you can't get it to work locally: dxvk-master.tar.gz

DucDuNord commented 5 years ago

The problem has been resolved. It appears that it was related to Lutris somehow.

I'd installed the game using Lutris after both Crossover and 'regular' Wine had earlier failed to run the game after I had installed it (they opened an explorer window instead). After installing your new dlls, I decided to try to launch the game directly from the Wine prefix into which it had been installed, as I was afraid Lutris would attempt to 'update' the Wine configuration. The game worked fine, with and without VSync enabled.

At this point I got a bit suspicious, and reinstalled DXVK 0.93 using the .verb installer. I then ran the game directly from the simulated C:\ drive, as before. VSync worked fine. As soon as I launched the game through Lutris, though, it locked up immediately, since VSync was still enabled.

Sorry to have bothered you with this, and many thanks for all the effort! DXVK has made it possible for me to completely ditch Windows - The Witcher 3 was among the few programmes for which I still required my old OS.

shmerl commented 5 years ago

You can try analyzing what Lutris does by comparing the prefix (before and after) to narrow down the problem. In general, using Wine directly is preferable anyway.

SveSop commented 5 years ago

@DucDuNord A bit off-topic, but if you want to build dxvk with Ubuntu (18.04/18.10) there is some info here: https://github.com/doitsujin/dxvk/issues/766#issuecomment-442079595

DucDuNord commented 5 years ago

Thank you - that is very useful!

DucDuNord commented 5 years ago

I am relatively new to using Git, yet as this appears somehow to be related to settings applied by Lutris, rather than to DXVK in and by itself, it seemed to me that this issue should be closed.

null-von-sushi commented 5 years ago

@DucDuNord What lutris setting was this?

I also had the issue of Witcher 3 not loading, but after disabling VSync without DXVK and then reenabling DXVK it worked (though my frames are still shit compared to windows).

DucDuNord commented 5 years ago

@ null-von-sushi

Yes, that's the error. Somehow Vsync in The Witcher 3 is not compatible with DXVK. The problem does not occur if you use WineD3D, but since WineD3D is much slower than DXVK using that instead is not really an option.

I think The Witcher 3 enables Vsync by default, which means that the game always needs to be run with WineD3D the first time around, so that the user settings file is created, and Vsync can be disabled.

I only fully understood what was going on after this thread was closed. Perhaps I should open a new one in its stead.

shmerl commented 5 years ago

vsync works perfectly fine for me (Mesa / amdgpu / Vega 56). I haven't tested it with adaptive sync though, which is a whole different story.

doitsujin commented 5 years ago

Make sure that your wine build isn't overly exotic / broken, and if you're using XWayland, try a proper X session. Vsync in Witcher 3 works fine on both my AMD and Nvidia systems.

There's nothing for me to fix anyway, vsync is basically an on/off switch and if it causes a game to hang, that happens somewhere down the line, not sure how exactly presentation works on your (arguably weird) eGPU setup.