godot
godot copied to clipboard
Vulkan: Error spam while running project `VulkanContext::swap_buffers: Condition "err" is true. Returning: ERR_CANT_CREATE`
Godot version
v4.0.alpha.custom_build [118f29694]
System information
Windows 10, Vulkan Clustered, NVIDIA GeForce GT 1030
Issue description
This error occurs randomly while running my game. And freezes project just like other issues out there, but in my case I am not sure what causes it. No overlay software is used. It doesn't crash on startup, but while running the project. Not sure what causes it! Best guess: CPU intensive tasks such as adding many CanvasItem nodes (Node2D or Control Nodes) to SceneTree at once and it generally happens for relatively complex and big projects. So, can't make a reproduction project for now.

And it has been occurring for me even before alpha releases.
Steps to reproduce
Not sure. Quite random. Or mostly when some CPU intensive tasks such as adding many CanvasItem nodes (Node2D or Control Nodes) to SceneTree at once.
Minimal reproduction project
N/A
Related to https://github.com/godotengine/godot/issues/57937 and https://github.com/godotengine/godot/issues/45725.
As per https://github.com/godotengine/godot/issues/45725#issuecomment-1016252446, did you update your NVIDIA driver to 511.23 or newer?
Yes it seems!

this also happened to me, in two different situations. But I can't reproduce this error intentionally.
The first time it happened while I was minimizing the debug window of my running project by double clicking on border of the OS window.
The second time when I was scrolling the mouse wheel over a HSlider on the debug window of my project while it was running.
In both situations the "game" window froze and I had to stop its execution by clicking the stop button on the editor.
I'm using Pop!_OS 21.10, and my video drivers are updated.
The project I'm working on is at the moment, basically a complex GUI and some 2D polygons being drawn to the screen.

@AndersonDeMatos Yes, after further testing and close observation, your problems have happened in my project. It seems, there is some unidentified Vulkan 2D rendering problem.
I seem to be running into this issue, too, on Alpha 13 with hotfix (Godot Engine v4.0.alpha13.official.82811367c). For me, it happens on nVidia graphics when coming out of system suspension.
ERROR: Vulkan: Did not create swapchain successfully.
at: prepare_buffers (drivers/vulkan/vulkan_context.cpp:2048)
ERROR: Condition "err" is true. Returning: ERR_CANT_CREATE
at: swap_buffers (drivers/vulkan/vulkan_context.cpp:2125)
Startup logs:
Godot Engine v4.0.alpha13.official.82811367c - https://godotengine.org
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0
Vulkan API 1.2.131 - Using Vulkan Device #1: NVIDIA - NVIDIA GeForce GTX 1050 Ti with Max-Q Design
@JosephCatrambone Can you reproduce this with other games or applications using Vulkan? Suspend on Linux is notoriously buggy with graphics drivers, especially with the proprietary NVIDIA driver.
I received this same error in Godot 4 Beta 1 when I zoomed close to meshInstance ingame. The meshInstance had a shader material with many if-clauses. I changed the shader logic so that there were less ifs and the error went away.
Now I updated to Godot 4 Beta 2 and error occurs immediately when I run the project even if I disable the problematic shader. I tried to start a new, empty project and it seems to work fine.
macOs Monterey 12.6, AMD Radeon Pro 5500M

It's been a year or so and my machine's drivers have likely updated since then, but I think I can try some night this week.
I don't know which commit might have resolved the issue, but there are no more random swapchain errors and crashes anymore.
This issue can be closed.
Closing in favor of https://github.com/godotengine/godot/issues/71929.