Skip to content
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

Godot 4 freeze when creating Window #49210

Closed
qarmin opened this issue May 30, 2021 · 2 comments
Closed

Godot 4 freeze when creating Window #49210

qarmin opened this issue May 30, 2021 · 2 comments
Labels

Comments

@qarmin
Copy link
Contributor

qarmin commented May 30, 2021

Godot version:
4.0.dev.custom_build. da12086

OS/device including version:
Ubuntu 21.04 Nvidia GTX 970

#41614 may be related, but this issue happens in project, not editor

Issue description:
When I run minimal project, then entire project freeze and when closing Godot, entire OS hang for a while.
I think that it may be Linux + Nvidia + Godot Vulkan problem

Perf shows that most of time, Godot spends inside swap_buffers function

Screenshot from 2021-05-30 19-01-59

Minimal reproduction project:

extends Node

var TIME_TO_DELETE: float = 1.0
var time_to_delete: float = TIME_TO_DELETE

func populate() -> void:
	add_child(ClassDB.instance("Window"))

func _ready() -> void:
	populate()

func _process(delta: float) -> void:
	time_to_delete -= delta
	if time_to_delete < 0:
		time_to_delete += TIME_TO_DELETE

		for i in get_children():
			i.queue_free()
		populate()
@insomniacUNDERSCORElemon

Considering the engine is made with the engine (and thus an exported project really isn't that different) this is probably the same issue as 41614. See the comments there particularly the comments by @Riteo relating to performance/synchronization.

Well, we already know that it's a synchronization issue of some sort, since the UI gets stuck on some Vulkan function binded to some related semaphore(see 41574 (comment)).

It's interesting though that by having a slower framerate it doesn't freeze, and I can confirm that by putting a big enough delay right before all drawing code indeed avoids all the freezes. AFAICT since the editor doesn't do any frame limiting, it uses the GPU's frame synchronization fully, and for whatever reason(never used Vulkan, but to me it feels like the fence is never actually updated, and the X server eventually times out or something) the end of a frame draw is never signaled.

Also as I've noted in 41614, for me at least compiling (with no target, which defaults to target=debug) using Clang makes freezing hard to notice except for in a few spots with multi-window enabled. In a situation like that, I could see how a much more barebones project might perform faster and thus would be more prone to crashing than your editor.

@qarmin
Copy link
Contributor Author

qarmin commented May 30, 2021

Looks that in #41574 there is really good explanation why it happens(I only read 41614 content)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants