doitsujin / dxvk

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

Black screen when using full-screen mode from wine version 9.18 #4329

Open XZVB12 opened 1 day ago

XZVB12 commented 1 day ago

Software information

Name of the game: Dwarf Fortress,BG3_dx11,Terraria, etc

System information

Log files

game.log

When the game is started in full screen mode, only black screen is visible and the game hangs. Problem reproduced on all DX games. The game can be run in window mode without problems. This issue is seen on versions 9.18-9.19, version 9.17 and below not affected. I sent the information about the error wine, but it was not considered because the problem appears only on dxvk, everything works on wined3d. https://bugs.winehq.org/show_bug.cgi?id=57275

doitsujin commented 21 hours ago

Do DXVK 2.4 or current master work?

FWIW so far I can't reproduce this locally.

WinterSnowfall commented 21 hours ago

One more thing to try here: does the problem go away if you revert to Nvidia drivers 535?

doitsujin commented 20 hours ago

Ok, so I was able to reproduce this on my Nvidia laptop when using a non-native resolution, but works fine when running native 1440p.

The problem is that we get VK_ERROR_OUT_OF_DATE from the Vulkan swap chain, create a new swap chain, and then immediately get OUT_OF_DATE again. Don't know why, and I also don't know why a wine change of all things would break this.

Edit: Validation layers reveal that the Nvidia driver requests a 1920x1080 swap chain, but DXVK creates a 2560x1440 one because that's what's passed to us in VkSurfaceCapabilitiesKHR. There seems to be some winevulkan/winex11 shenanigans going on.

XZVB12 commented 18 hours ago

Do DXVK 2.4 or current master work?

Unfortunately downgrading to 2.4/ build from source code on github did not solve the problem.

One more thing to try here: does the problem go away if you revert to Nvidia drivers 535?

Unfortunately I can’t downgrade the video driver version now. But it is unlikely that this would have fixed the situation, as it has not been a problem before.

doitsujin commented 18 hours ago

Yeah, see above, it's not our bug, this will break other Vulkan apps too. Running at native resolution should resolve the issue though.

XZVB12 commented 18 hours ago

Yeah, see above, it's not our bug. Running at native resolution should resolve the issue though.

1920x1080 is "native resolution" for me .

Unfortunately, wine bugzilla does not pay attention to the messages related to dxvk work. Is there any way to more clearly point out the problem ? I can add a link to this discussion, but they will most likely ignore it.

doitsujin commented 18 hours ago

I can't reproduce the issue when running at native res, but other than that the symptoms of the issue are the same.

If you can build your own wine, you could try reverting this commit (linking to github mirror because winehq seems to be down).

Blisto91 commented 18 hours ago

Out of curiosity does it work if when using wined3d you launch dx11 Baldurs Gate 3 with WINE_D3D_CONFIG=renderer=vulkan? It will use wined3ds vulkan renderer instead of OpenGL (d3d11 only)

XZVB12 commented 18 hours ago

Out of curiosity does it work if when using wined3d you launch dx11 Baldurs Gate 3 with WINE_D3D_CONFIG=renderer=vulkan? It will use wined3ds vulkan renderer instead of OpenGL (d3d11 only)

Without DXVK? Yes изображение

you could try reverting this commit

I'll try

doitsujin commented 17 hours ago

Candidate workaround:

https://github.com/doitsujin/dxvk/tree/swapchain-workaround

Edit: nvm, this doesn't even seem to fix it.

XZVB12 commented 17 hours ago

Edit: nvm, this doesn't even seem to fix it

Not working fully, but the game now does not hang completely, sound continues to play

I'll try

By default, the 32 bit version of wine is build, looking for information on how to change it.

doitsujin commented 17 hours ago

I updated the branch, with that I get at least the FFXIV benchmark to run on my laptop again, which is what I've been using for testing.

XZVB12 commented 16 hours ago

By default, the 32 bit version of wine is build, looking for information on how to change it.

Built x64 version, but it didn’t solve the problem. Gamescope also not working.

doitsujin commented 16 hours ago

Did you try the updated DXVK workaround?

XZVB12 commented 15 hours ago

Did you try the updated DXVK workaround?

I rebuild the swapchain-workaround branch with new changes and now it works for both my assembled wine and the wine from the package. This applies to games: Bg3_x11 Warhammer 40,000 Rogue Trader, Cult of the Lamb, Darkwood But some games still don’t work. For example Dwarf Fortress, terraria, Dead Cells. If you go back to wine 9.17 everything will continue working with the new DXVK, if that’s important.

изображение изображение

Sorry for the long answer, I checked different games/ combinations dwarf.log

doitsujin commented 15 hours ago

From the Dwarf Fortress log:

err:   Presenter: Failed to acquire from fresh swap chain multiple times.
err:     Desired size:    1920x1080
err:     Surface size:    1920x1080
err:     Surface limits:  1920x1080 - 1920,1080
err:     Returning desired size as a last resort, this might be out of spec!

This is so weird, it's just giving us the same surface size that we'd use anyway...

Assuming this is a 64-bit game, can you run with validation layers enabled (VK_INSTANCE_LAYERS=VK_LAYER_khronos_validation DXVK_DEBUG=validation)? This might shine some light on what winevulkan is trying to do there, but I think that's firmly past the point where we can fix it on our end.

XZVB12 commented 15 hours ago

I’m not sure if dwarf fortress 64 bit game, additionally run deadcels. deadcels.log dwarffortress.log

doitsujin commented 13 hours ago

hm yeah, nothing suspicious in there unlike in the non-native resolution case.

Very weird.

XZVB12 commented 13 hours ago

Is there anything else I can help with?

rbernon commented 13 hours ago

This is probably a Wine regression that I introduced in 9.18, working on it.

XZVB12 commented 13 hours ago

This is probably a Wine regression that I introduced in 9.18, working on it.

Description of the problem is similar, but I’m not sure it’s the same error. I had no problems with launching vulkan versions of games. At least BG3. But I probably don’t understand enough about what’s going on.The message VK_ERROR_OUT_OF_DATE was in my report. I’ll try to build the wine with your changes: https://bugs.winehq.org/attachment.cgi?id=77218&action=diff UPD:Well with these fixes wine refuses to work for me. Although it may be a problem in my build.

0124:err:environ:init_peb starting L"Q:\\Game\\Terraria\\Terraria.exe" in experimental wow64 mode
wine: failed to load L"\\??\\C:\\windows\\syswow64\\ntdll.dll" error c0000135
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: 0024:err:start:fatal_error FormatMessage failed

I will continue to use the updated DXVK as a temporary partial solution pending wine 9.20

sfjuocekr commented 4 hours ago

I can also report to face this problem but with Star Citizen, since 9.18 DXVK start with:

04b4:fixme:system:NtUserQueryDisplayConfig flags 0x2, paths_count 0x7ffffe1fe338, paths 0x7fffff601ec0, modes_count 0x7ffffe1fe33c, modes 0x70218bb2f180, topology_id (nil) semi-stub
04b4:fixme:system:NtUserQueryDisplayConfig flags 0x2, paths_count 0x7ffffe1fe338, paths 0x7fffff601ec0, modes_count 0x7ffffe1fe33c, modes 0x70218bb2f180, topology_id (nil) semi-stub
warn:  D3D11DeviceContext::QueryInterface: Unknown interface query
warn:  db6f6ddb-ac77-4e88-8253-819df9bbf140
065c:fixme:dwmapi:DwmEnableMMCSS (1) stub

Then proceeds to spam the log with:

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_FIFO_KHR (dynamic: yes)
info:    Buffer size:  3840x2160
info:    Image count:  5
info:    Exclusive FS: 1