godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.18k stars 21.2k forks source link

Vulkan: Editor constantly uses 1-2% CPU while doing nothing on empty project due to Vulkan lacking 2D batching #71084

Closed tustin2121 closed 2 months ago

tustin2121 commented 1 year ago

Godot version

v4.0.beta10.mono.official [d0398f62f]

System information

MacOS Catilina 10.15.6, MacBook Air

Issue description

I just downloaded 4.0 beta 10 and started a new project, and simply sitting and staring at the empty project screen causes my mac's fan to spin up and stay spinning on high. The editor isn't doing anything, but it apparently just can't sit still? The CPU usage is always at at least 1% or 2%, and it apparently wakes the processor at least 150 times per second.

I would expect simply staring at the editor with nothing on screen would leave the CPU alone. If I swipe away to another screen or minimize the editor, I would expect the CPU usage to fall as well, but the editor still uses 1-2% constantly. There's no way I can use Godot if it is going to eat my laptop's battery just doing literally nothing...

image

Steps to reproduce

Open a new project and just sit and wait. Going to the AssetLib tab seems to speed up the process, but it's not required.

Minimal reproduction project

N/A

Zireael07 commented 1 year ago

I suspect this is the audio system?

Calinou commented 1 year ago

Duplicate of https://github.com/godotengine/godot/issues/38154.

tustin2121 commented 1 year ago

coreaudiod was using a high percentage of CPU when Godot was open. I changed the audio system to "Dummy" in the project settings and restarted the editor, and now that usage in coreaudiod is gone, but the editor itself is still using the same amount of CPU. So it's either something other than the audio system, or I guess the audio system is still outputting dummy sound data to the dummy driver?

image
Calinou commented 1 year ago

Can you reproduce this on 3.5.1?

tustin2121 commented 1 year ago

Downloaded 3.5.1, opened a blank project in it, modified the Project Settings to make it use the Dummy audio driver. The numbers in the process monitor seem worse, but my computer is not heating up and spinning up the fan to high. Whatever is making 4.b10 eat my batteries and turn my macbook into an airplane is not happening in 3.5.1.

image
Calinou commented 1 year ago

Whatever is making 4.b10 eat my batteries and turn my macbook into an airplane is not happening in 3.5.1.

Can you reproduce in 4.0.beta10 after switching the rendering method to Forward Mobile? Also try GL Compatibility.

tustin2121 commented 1 year ago

The 4.0.b10 project I've been testing on has been using the mobile renderer. Switching to gl_compatability makes the fan calm down:

image

Switching to the forward_plus renderer makes the fan spin up again after a while:

image

I guess I'll be using the gl_compatibility renderer for a while.

Calinou commented 1 year ago

This is likely because the editor is much slower to render when using Vulkan due to lack of 2D batching. See also https://github.com/godotengine/godot/issues/70869.

clayjohn commented 1 year ago

To me this sounds like vsync may not be working in on the macOS builds.

Calinou commented 1 year ago

To me this sounds like vsync may not be working in on the macOS builds.

This should be fixed in macOS 13.0 (Ventura), but you'll need to upgrade as this is an upstream issue: https://github.com/godotengine/godot/issues/56355

https://github.com/godotengine/godot/pull/66367 will provide a workaround for older macOS versions.