godot icon indicating copy to clipboard operation
godot copied to clipboard

Vulkan: Error spam while running project `VulkanContext::swap_buffers: Condition "err" is true. Returning: ERR_CANT_CREATE`

Open INdIEDeV016 opened this issue 3 years ago • 6 comments

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.

image

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

INdIEDeV016 avatar Mar 30 '22 17:03 INdIEDeV016

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?

Calinou avatar Mar 30 '22 20:03 Calinou

Yes it seems! image

INdIEDeV016 avatar Mar 31 '22 06:03 INdIEDeV016

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.

Screenshot from 2022-04-17 19-38-51

AndersonDeMatos avatar Apr 17 '22 22:04 AndersonDeMatos

@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.

INdIEDeV016 avatar Apr 18 '22 07:04 INdIEDeV016

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 avatar Aug 06 '22 19:08 JosephCatrambone

@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.

Calinou avatar Aug 07 '22 05:08 Calinou

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

image

codespren avatar Sep 30 '22 14:09 codespren

Hi!

Could you test this version to see if you can still repro the problem? Thanks.

darksylinc avatar Aug 19 '23 18:08 darksylinc

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.

JosephCatrambone avatar Aug 21 '23 19:08 JosephCatrambone

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.

INdIEDeV016 avatar Aug 23 '23 21:08 INdIEDeV016

Closing in favor of https://github.com/godotengine/godot/issues/71929.

Calinou avatar Aug 23 '23 21:08 Calinou