-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
[Tracker] Vulkan error unable to create swapchain (device lost) happening randomly #71929
Comments
Should we force the engine to close in this situation, rather than trying to recreate the swapchain endlessly? As far as I know, there is no way to recover from this situation (not until the renderer can be restarted at run-time). Also, the error message should be tweaked to indicate most likely causes (bugs in graphics drivers). |
I'm not sure. First we need to investigate what is causing the error in the first place. Most of the impacted users report driver updates not resolving the issue for them. So it is more likely an issue on our end. |
Popped up with beta 17. As long as you can't fix it/find what it is, I'd be happier if it tried to save my last open edits and crashed instead of an error spam. My error lines are:
And the info message from the start of the editor:
|
As mentioned in #60755, I can help as I have 100% reproducible case (summary: launch editor, put computer to sleep, wake it up later, try to use any UI component => I got a "winner") Feel free to give me some debug code to run, patched version of Godot with additional debug code, anything which could help. I'm still not convinced it could solve all cases users have encountered with all OSes & hardware involved but it could narrow it down at least. For the record I have some older version of Visual Studio Community (latest is 2019) installed and never tried yet to compiled Godot from source, but I may give it a try if it could help. |
Yap, that is a good way to get it to happen. With beta 17 it sometimes happens, sometimes does not. (I can get the computer to go to sleep without it happening) |
@InfiniteProductions @Frontrider That is great to hear! We just merged a change that made it into RC1 that will provide more debug information on crash. So could one of you test RC1 running from the command line, reproduce the crash and then tell me what it says? It should have error messages like in the original post here, except there should be an error code reported as well |
I start using this release, but (un)fortunately, the issue no longer occurred in the same scenario ! |
Could not reproduce so far, I can give more details in a few days. |
I just reproduced the issue on rc-1 after 48 minutes of engine usage. The message is different from the ones so far though. |
aarrgghh I just got one but console goes away with the editor when closing it ! It could be great to have a log file somewhere instead of this console OR keep it open. I'll try again later. |
Getting this error in Godot 4 RC1 when trying to load the DM1-2 map in Liblast, https://libla.st/:
|
Using the same release:
I've got only these lines:
It doesn't looks like to be a "crash" as @clayjohn wrote. So no luck to get more debug info. |
Same. I just got it. Editor was left open in the background, it was still rc1. I'll try to replicate on rc2.
Try launching other full screen applications/games while godot is in the background. That might yield usable results. |
I'm having this on RC2, interspersed with random gibberish
I'm not sure if it makes any difference but i did switch from compatability to forward renderer, my project also makes heavy use of shaders, but runs absolutely fine in compatibility. Windows 11, RTX 3060 |
Just got the error on rc5. Same game, left the editor open for a while in the background, then the screen was turned off. No sleep mode, no nothing.
|
I'm getting this error suddenly with godot 4 final
|
For me this reproduces 100% reliably when I leave Godot on when I put my laptop to sleep.
OS: Linux (Arch Linux, up to date) |
@speakk what distro? That might be another useful but of info. |
Edited my post to add the distro. |
Occurs to me also, on Windows 10, 1070 Ti, 2700X, latest drivers |
The question is how could we debug this further, or is it coming from the driver rather then godot itself ? |
Well, its difficult to say. We don't have clear reproducible cases yet. When this error occurs varies wildly between person to person. Some users get it consistently, others get it randomnly. For some it is fixed with a driver update, for others not. My guess is that somewhere in the core Vulkan code we are doing something outside of the Vulkan specification which results in the device getting lost. The trouble is very few contributors have the deep knowledge about Vulkan required to debug this, further very few people are able to reproduce it, which makes it even harder to debug. Edit: To add to this, if you can reliably reproduce the issue, please try running your application from the command line and using the |
I tried @SimantoR 's "fix" and seems to have solved it? Can anyone else confirm? |
I have this issue occasionally. I notice it more frequently when Windows loses focus of the game window when alt-tabbing out. |
[4.2.1] The issue happens very often on my laptop with a dual AMD GPU. It happens on Forward+ and Mobile, switching to Compatibility makes the issue go away, as well as @SimantoR's solution. A quick way to trigger this seems to be playing around with sliders when changing a node's Modulate. |
It definitely is windowing. This bug still occures even with Single Window mode when changing screens or just maximizing and un-maxmixing the main window too fast |
Been happening to me moving around a low poly rock and I have a "warping" shader going on in my scene as well (never caused an issue before but I'm wondering if that is the cause all of a sudden). Console first returns a popup:
This is also AFTER changing to single window mode btw. So this doesn't seem to have fixed my issue. I'm staying on my Godot editor and it's happening while I'm moving things around. I can also repeat it pretty consistently where it currently is. I'm going to make a copy of it's current state so I can come back to it if someone wants to pair to figure out what is happening and so I can (hopefully) try to go back to working on building my racing game. GPU: RX 5600 XT |
For those encountering this issue recently. Can you try the same projects in 4.3 dev 5? (after making a backup of course) We made several strides in fixing some of the common causes for this error in the 4.3 dec cycle. So it would be helpful to know if the issue is fixed for you. The device lost error is very elusive and has thousands of possible causes, so I cannot say we fixed this altogether, but I am hopeful that for most people this error will become extremely rare or non existent. |
Anyone else having this issue: do try to disable any GPU tweak/overlay software you have running, ASUS GPU TWEAK III was causing the issues in my case as said in the issue I linked below @clayjohn However when I'm in the project manager and not the actual editor I am seeing a spam of GL errors copied into the text file below. These errors (nor the crash) don't happen if I turn off ASUS GPU TWEAK III as mentioned in the original issue. |
I upgraded to 4.3 Dev 5 and I am not seeing it anymore. However, a big caveat is that Jolt is not building in this version of Godot. So now I'm wondering if this was fixed in 4.3 or if there's an underlying issue with Jolt. Sorry I forgot to mention I was using Jolt in my previous comment. |
Your version of Jolt needs to match the version of the engine that you are using. Currently godot-jolt says it only supports Godot 4.2. So you will need to wait until godot-jolt is updated before using it with 4.3 https://github.com/godot-jolt/godot-jolt?tab=readme-ov-file#what-versions-of-godot-are-supported |
No I understand. I was just mentioning that while it seems fixed, I'm not sure if it's just because Jolt isn't available at this point for 4.3. |
I got this issue today after turning on shadows for OmniLight3D for a bunch of torches I have on the walls. I changed to gl_compatible before Godot crashed after looking into a potential fix and got a new error code (drivers/gles3/storage/light_storage.cpp:1067 - condition "!sli" is true). I tried 4.2.2 and 4.3 dev 5 all still crashed with shadows enabled. |
This is a known issue: #84747 It's fixed in the upcoming 4.3.dev6. |
I also got this problem when I turned on shadows for a bunch of OmniLight3D's. This with 4.3dev6. |
This shouldn't be as I just got Jolt, but I had the issue since I downloaded 4.2 |
I'm using godot for the first time and every time I boot it up and try to start using it, this error comes up. Ive run it in the command line and it spits out this error Haven't even been able to do anything in godot yet because when I try to click anything it just crashes Edit: I made a new project using compatibility in stead of Forward+ and it seems to work now |
I have been having it crash every time I open the advanced import settings window. Changing the editor to single window mode seems to be fixing the problem. Had the problem in 4.2.1 and 4.2.2 c# version, windows 11 |
I have also been getting the same:
For me it is very replicate-able/consistent, specifically on my Surface Pro and happens anytime I resize the Godot UI elements (i.e. everytime I resize the TileSets pane Godot crashes). Single Window Mode did not fix for me BUT changing to Compatibility mode immediately fixed the issue. Have not been able to get it to crash since, but changing back to Forward+ immediately brings back the issue. Hope that helps anyone else still having this issue for now. Let me know if any further info from someone who can consistently replicate it is helpful at this point. |
I started having the same issue while I was in the middle of making a fragment shader. This happens every time I use this shader after about 5-10 seconds. I am using Godot v4.2.2 stable, running on Windows with an RTX 3070, Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz, 16.0 GB RAM Update: I just tried the same thing in v4.3-dev5 and v4.3-dev6 and I am running into the exact same issue. So it wasn't fixed for me To replicate this, make a MeshInstance3D with a quad mesh and attach this shader to it. If the mesh is visible, Godot should crash in a few seconds. Note: I had to convert the shader into a txt file to be able to attach it here. Convert it back to a gdshader to use it |
@SbNanduri your case is a bit different. You have an infinite loop in your shader which is causing your GPU to crash. When UV.y is 1.0 your margin is 0 resulting in an infinite loop. Modern GPUs respond to infinite loops by crashing the GPU driver instead of freezing your computer and burning out the GPU. |
@clayjohn Oh my bad for missing that, and thanks so much! There aren't too many mentions of this error, and I hadn't seen any mentions of infinite loops in them, so I assumed it probably wasn't trivial |
And I thought this was an issue specific to either Linux, or Gnome, or using the proprietary drivers for Nvidia. Good to know this is still an issue. I can confirm this is an issue in the following specs:
|
What version of Godot? |
4.2.2-stable. I edited my comment, sorry. |
@KoltPenny do you mind testing with 4.3 beta 2 (make a backup of your project first). We fixed a number of bugs that could possibly cause this error You can download it here https://godotengine.org/download/archive/4.3-beta2/ |
@clayjohn At least the error is different 😅 . Still crashes and dies on Vulkan. Going to fallback to OpenGL for now. |
Godot version
4.0 beta14 and earlier and likely later
System information
Most users are on Windows, some on Linux, variety of GPUs (intel, nVidia and AMD)
Issue description
I am opening this tracker issue as a central place to track a bug that seems to be plaguing a variety of users. The bug occurs quite randomly, but appears to be most often connecting with complex shaders and/or updating uniforms.
The bug leads to a freeze or crash when updating swap buffers along with the following errors:
For some users these errors spam the console while the engine itself is frozen.
This issue is very difficult to debug as it is near impossible to reproduce reliably for people other than the affected users.
Tasks
VulkanContext::swap_buffers: Condition "err" is true. Returning: ERR_CANT_CREATE
#59699VulkanContext::swap_buffers
#60979ERR_CANT_CREATE
atVulkanContext::swap_buffers
error at Godot startup #52112Steps to reproduce
Steps to reproduce can be found in individual reports
Minimal reproduction project
See individual reports
The text was updated successfully, but these errors were encountered: