-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
AsyncComputeTaskPool blocking main thread on bevy 0.13+ for Linux #13672
Comments
Very odd that this is Linux specific. Definitely bad though! |
Ya, strange no one else has encountered the issue either. I would think it was specific to my system if it weren't for previous versions working. Bring the 0.12.1 |
Awesome. My expectation is that this is something weird going on in one of the upstream dependencies. |
I was able to track it down to the "Async pipeline compilation" commit. |
Would be good to fix, but not quite milestone-worthy at this late stage. |
shaders are compiled on the I think the fix is just to not create the tasks in a startup system, which is not really a realistic scenario anyway |
In my personal project I was starting tasks during an update system and still running into issues. I can see if I can tweak the example to reproduce not using a startup system. |
Confirmed what @mockersf mentioned. However not using a startup system is not good enough. Spawning tasks within the first few frames causes the same delay in window opening. Using a timer to wait 0.1s causes no issues. Is there a ready state or something more reliable than just having a small delay before tasks can be spawned? |
Are we actually sure running blocking tasks on an async task pool is an ok thing to do? |
it's an async task pool just because we decided to call it that way... but that separation is more or less artificial and only maintained by the developer. and the default thread repartition per task pool probably doesn't make sense for any specific game. and it should be dynamic anyway, doesn't make sense to block threads all the time for asset loading when that probably only happens during startup or level loading. There are ideas to remove that distinction, like #12090, which would probably fix this issue by having more threads available for shaders and async tasks at start |
Maybe try with https://github.com/rparrett/bevy_pipelines_ready |
Maybe an easy fix is expose |
That's basically this PR, but it needs more work before merging. #12090 |
# Objective - Fixes #13672 ## Solution - Don't use blocking sleep in the tasks, so that it won't block the task pool
Bevy version
Relevant system information
What you did
Run bevy "async_compute" example.
What went wrong
Running
async_compute
example on bevy 0.13 or later, I would expect the example to run the same as it did in previous version of bevy (0.12) or as it does on other platforms (OSX tested in this case). Once the example is run, the bevy window will not open until most of the async tasks have finished.Putting printlns in the update system will see they run once or twice and then block until tasks have finished. This behavior is also observed in my non-example project.
Additional information
Attached are videos comparing 3 different versions of bevy. The expected behavior is version 0.12.1
0.12.1 https://github.com/bevyengine/bevy/assets/1187608/6b38f4d3-e9bc-408b-96f0-42057fb8d8a2
0.13.2 https://github.com/bevyengine/bevy/assets/1187608/fb46744a-ecde-4060-8a67-730195acd883
0.14.0 https://github.com/bevyengine/bevy/assets/1187608/cece0171-44c4-435a-a4b2-44e98537504a
The text was updated successfully, but these errors were encountered: