godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.15k stars 19.96k forks source link

Projects being ran close themselves after a few minutes with `xcb_in.c:757: xcb_request_check: Assertion '!reply' failed.` if VSync is disabled. #78841

Open Neerti opened 1 year ago

Neerti commented 1 year ago

Godot version

v4.0.3.stable.official [5222a99f5]

System information

OS: EndeavourOS Linux x86_64. CPU: Intel i5-12600K. GPU: AMD Radeon RX 6700 XT. RADV driver version 23.1.3. Vulkan API version 1.3.246.

Issue description

When running a simple project that uses Forward+ and has vsync turned off, the window that has the running project will close itself after a short period of time, ranging from a few seconds to a few minutes. No error message is printed to the editor. Running Godot from a terminal will show Godot_v4.0.3-stable_linux.x86_64: xcb_in.c:757: xcb_request_check: Assertion `!reply' failed. when the running project closes itself.

This occurs for both 3D and 2D projects, and also for exported projects.

This does not appear to happen if VSync is set to be active in the project. It also does not appear to happen if the Compatibility (OpenGL) renderer is used instead of Forward+ (Vulkan) regardless of VSync state.

Googling the error brings me to https://github.com/godotengine/godot/issues/69352 and https://github.com/godotengine/godot/issues/75308 , however the assertions are different and the circumstances are somewhat different so I assume it's a separate issue.

Full terminal output:

Running: /home/neerti/Projects/Godot/Godot4/Godot_v4.0.3-stable_linux.x86_64 --path /home/neerti/Projects/Godot/Godot4/MinimalReproductionProject --remote-debug tcp://127.0.0.1:6007 --editor-pid 29007 --position 704,374 res://scene.tscn
Godot Engine v4.0.3.stable.official.5222a99f5 - https://godotengine.org
Vulkan API 1.3.246 - Forward+ - Using Vulkan Device #0: AMD - AMD Radeon RX 6700 XT (RADV NAVI22)

Godot_v4.0.3-stable_linux.x86_64: xcb_in.c:757: xcb_request_check: Assertion `!reply' failed.

Steps to reproduce

  1. Run Godot in a shell if you want to see the assertion failure message.
  2. Open the provided minimal reproduction project.
  3. Run the project with VSync Mode set to Disabled. (The provided project should have that already be set).
  4. Wait for a few minutes until the window closes.
  5. When it does, check the shell for the error message.

Minimal reproduction project

MinimalReproductionProject.zip

Calinou commented 1 year ago

Are you using a X11 or Wayland session? Use echo $XDG_SESSION_TYPE to know. (Godot is more stable in X11 sessions currently.)

Neerti commented 1 year ago

I'm using X11.

quinnyo commented 1 year ago

Can't reproduce on XWayland (sway), Vulkan API 1.3.246 - Radeon RX 5600 XT (RADV NAVI10). 5500-6000 FPS, CPU limited.

Have you tried a more complex test scene? With stuff in it that will 'naturally' limit the frame rate?

Just as an extra data point / troubleshooting thing, you may want to try it with the 'amdvlk' vulkan driver (as opposed to RADV) if that's available in your distro. You can select vulkan drivers using the VK_ICD_FILENAME environment variable. e.g. to run godot with the amdvlk driver: % env VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/amd_icd32.json:/usr/share/vulkan/icd.d/amd_icd64.json godot --path etc... (paths correct for Arch Linux, do check)

akien-mga commented 1 year ago

What's your libx11 package version?

Sslaxx commented 1 year ago

I'm getting this every now and then with 4.1.1, uncertain if it's entirely related to this issue though:


[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
godot.x11.opt.tools.64: ../../src/xcb_io.c:278: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.```
krizej commented 11 months ago

Any progress on this? Still happening with libx11 version 1.8.6-1 and Godot 4.1.1.stable

krizej commented 11 months ago

Used a debug build of Godot 4.2 with GDB, which pointed to this line https://github.com/godotengine/godot/blob/fe5b1c8d49313d63fbe91cb7cdf463e10fb86afa/drivers/vulkan/vulkan_context.cpp#L2561 Couldn't reproduce on amdvlk drivers after waiting for ~2 hours.