-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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'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. |
I found this thread after having the same device lost issue, and I'm not sure if I can contribute, but this is what happened to me: I was fixing an error in a .gd file when the device lost problem occurred, and I couldn't start the editor again. The error continued when I switched tabs while the editor was loading (Godot_v4.2.1-stable and Godot_v4.2.2-stable). When I didn't switch tabs, the editor didn't crash, and I corrected the error in the .gd file. When I tried again, I couldn't reproduce the bug. I am on an IdeaPad 3 15IIL05 |
I can't even open the editor. I started a new project and got this immediately |
@byromaniac as a temporary solution, launch it through a terminal with the |
Yea I started a new project in compatible mode and that worked
…On Mon, Jul 29, 2024 at 1:12 PM KoltPenny ***@***.***> wrote:
@byromaniac <https://github.com/byromaniac> as a temporary solution,
launch it through a terminal with the --rendering-method gl_compatibility
option.
—
Reply to this email directly, view it on GitHub
<#71929 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEKDRINWFYRVY2TZZXJLSQ3ZO2AXZAVCNFSM6AAAAAAUEFOVXKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJWGU4TSMZZG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Pretty sure compatable mode uses OpenGL for graphics so no Vulkan device to lose. So I guess that works if you are ok with that. I would be curious to know if people who had this issue are still seeing it in 4.3 as I know a lot of work was done towards this in that update. |
OS: Ubuntu Jammy 20.04 I was getting the same var results = space_state.intersect_ray(query)
if results:
var bullet_mark = bullet_hole_dark.instantiate()
get_tree().root.add_child(bullet_mark)
bullet_mark.global_position = results.get("position") # bullet_mark -> decal For a moment I thought maybe it was because of memory allocation, I went online to search. After modifying my code to this it works. var results = space_state.intersect_ray(query)
if results:
var bullet_mark = bullet_hole_dark.instantiate()
get_tree().root.add_child(bullet_mark)
bullet_mark.global_position = results.get("position")
await get_tree().create_timer(2).timeout
bullet_mark.queue_free() Partially solved my problem. |
Intel Haswell IGPs only have partial Vulkan support due to hardware limitations, so please switch to the Compatibility rendering method which uses OpenGL instead. I'm surprised Forward+/Mobile even starts on your PC, but I guess Mesa drivers are built different… The Compatibility rendering method does not support decals, but for small decals like bullet holes, you can use a MeshInstance3D with a QuadMesh and rotate it according to the raycast normal. |
I still get this error on 4.3 stable. I'm running on Intel UHD Graphics with a i5-1035g1 processor which supports Vulkan according to the intel website. I can open the editor in forward and mobile and I can also tinker around with all the different properties in the WorldEnvironment node that are Vulkan exclusive. I can only do this for a short while until too much load is put on my computer and Godot crashes with this error message: |
Getting similar issue on 4.3 stable and 4.4 dev2. The device is 2019 Macbook Pro 13" 2.4 GHz Quad-Core Intel Core i5, Intel Iris Plus Graphics 655 1536 MB. For whatever reason, Forward+ seems to be fine, however Mobile causes crash on 4.4 and makes editor UI black on 4.3. Here're the crash logs:
|
As for the relevant Validation Layers environment variables: export VK_LAYER_PATH=/path/to/vulkan/1.2.148.1/x86_64/etc/vulkan/explicit_layer.d
export VULKAN_SDK=/path/to/vulkan/1.2.148.1/x86_64
export LD_LIBRARY_PATH=/path/to/vulkan/1.2.148.1/x86_64/lib
export PATH=/path/to/vulkan/1.2.148.1/x86_64/bin:$PATH Note: SIP on macOS will probably block |
I found a similar error doing https://docs.godotengine.org/en/stable/getting_started/first_3d_game/08.score_and_replay.html The error: Steps to reproduce:
You should now be getting tons of errors. You can hit "Stop Running Project"/F8 to stop it. Otherwise it will keep going, which will cause you to slow down and crash. |
@Dhighruler please open a new ticket for that problem. It looks very specific. This is a generic tracker. |
#98465 could be added to this list. It's not |
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: