Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Remove unnecessary command buffer execution #13041

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

homeisfar
Copy link

When resizing the game window there is a chance that the swapchain state is bad. This will result in a deadlock on Linux + Nvidia's proprietary driver. This code can be removed and the next command buffer execution will simply occur when the swapchain has been recreated.

The root issue may be a Linux Nvidia driver implementation problem. I wasn't able to reproduce the original problem on Windows, nor on my Steam Deck. I tested this change on Fedora 40+Nvidia & SteamOS+AMD.

Fixes https://bugs.dolphin-emu.org/issues/13523

When resizing the game window there is a chance that the swapchain state
is bad. This will result in a deadlock on Linux + Nvidia's proprietary
driver. This code can be removed and the next command buffer execution
will simply occur when the swapchain has been recreated.

The root issue may be a Linux Nvidia driver implementation problem. I
wasn't able to reproduce the original problem on Windows, nor on my
Steam Deck. I tested this change on Fedora 40+Nvidia & SteamOS+AMD.

Fixes https://bugs.dolphin-emu.org/issues/13523
@dreamsyntax
Copy link
Member

I'll test this and report back, this has been annoying me for a long time.

@dreamsyntax
Copy link
Member

dreamsyntax commented Aug 28, 2024

Did a brief (50 restarts) test on Windows. I no longer am getting the Vulkan Hook crash with OBS as a possible side effect.

NVIDIA RTX 3080 | Driver 560.94 | OBS 30.2.3

@dreamsyntax
Copy link
Member

Tested on Arch

NVIDIA RTX 3080 | 560.35.03

Observed behavior:
On resizing a VK_ERROR_OUT_OF_DATE_KHR alerts.
image

"Ignore for this session" successfully completes the resize.
Then, I can resize as many times as I want IFF I am increasing the size without pausing the emulation. It works as expected.

However the moment I attempt to shrink the window without pausing the emulation the deadlock occurs again.

@mitaclaw
Copy link
Contributor

Manjaro Linux here, using an Nvidia GeForce GTX 980 Ti with driver version 550.107.02.

This change seemingly has fixed the deadlock when rendering to main window, or at least I cannot get the deadlock to occur with repeated and excessive resizing. Resizing when rendering to the floating window is still problematic. Same as Dreamsyntax, I get the message Warning: Failed to grab image from swap chain: -0X3B9ACDEC VK_ERROR_OUT_OF_DATE_KHR almost immediately, but for me that's where it gets stuck no matter what. There is a function call ExecuteCommandBuffer(false, true) in VKGfx::CheckForSurfaceResize() identical to the one that was removed in this PR which ultimately leads to the vkWaitForFences deadlock at the core of this issue, but it is executed by both render to main window and render to floating window, so I don't know how one works and the other doesn't.

@homeisfar homeisfar marked this pull request as draft August 30, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants