bgfx: Linux/NVIDIA/vulkan: fullscreen window stops updating

Describe the bug This was originally reported against mame (https://github.com/mamedev/mame/issues/7820) but I have finally managed to reproduce it with bgfx examples. In brief, with examples built with --enable-sdl, fullscreen window will stop updating a few moments after hitting ctrl-f.

To Reproduce Steps to reproduce the behavior:

  1. Edit makefile as follows:
diff --git a/makefile b/makefile
index 667852910..193884fe4 100644
--- a/makefile
+++ b/makefile
@@ -104,7 +104,7 @@ wasm-release: .build/projects/gmake-wasm ## Build - Emscripten Release
 wasm: wasm-debug wasm-release ## Build - Emscripten Debug and Release
 
 .build/projects/gmake-linux:
-       $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=linux-gcc gmake
+       $(GENIE) --with-tools --with-combined-examples --with-shared-lib --with-sdl --gcc=linux-gcc gmake
 linux-debug64: .build/projects/gmake-linux ## Build - Linux x64 Debug
        $(MAKE) -R -C .build/projects/gmake-linux config=debug64
 linux-release64: .build/projects/gmake-linux ## Build - Linux x64 Release
  1. Start examples
  2. Switch to full screen with ctrl-f
  3. Wait until screen stops updating

Expected behavior Screen keeps updating as it does when --gl is passed

Screenshots N/A

Additional context This appears to only happen with nvidia binary drivers, my amd laptop is not affected.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (16 by maintainers)

Commits related to this issue

Most upvoted comments

This seems fixed as of 510.47.03 nvidia driver. From 510.39.01 changelog [1]:

Worked around an issue that prevented some games from flipping (and therefore taking advantage of G-SYNC and G-SYNC Compatible monitors) on certain desktops such as GNOME.

[1] https://forums.developer.nvidia.com/t/linux-solaris-and-freebsd-driver-510-39-01-beta/200220

I was able to reproduce using Pop!_OS 21.04 Live USB with nvidia driver preinstalled: https://pop.system76.com/

Sorry for the delay… I tried the Live USB a while back and the experience was questionable, but I got a new SSD the other day so I can properly dual boot into Pop OS now.

Good news is I can reproduce a crash when going fullscreen. Bad news is that’s about as much info as I got. For some reason Vulkan validation layers aren’t working and I just get VK_ERROR_DEVICE_LOST which is about as helpful as “something went wrong”. Also getting device lost simply when resizing, something fishy going on with SDL2 that the X11 entry is not triggering. I’ll try to find some time over the weekend to debug this, will let you know if I find anything else.

That crash is probably an unrelated bug 🙊 Can you add case VK_SUBOPTIMAL_KHR: here: https://github.com/bkaradzic/bgfx/blob/ee0fbea72662f702d7a95fba793a1c7371cfde5f/src/renderer_vk.cpp#L7322 (so both SUBOPTIMAL and OUT_OF_DATE set m_needToRefreshSwapchain = true). That should at least fix that.

Thanks for the pointer on the live USB, might work better than a VM.