gdquest-demos / godot-demos-2022

Free and open-source Godot demos for learning, with guides and tutorials: 2022 edition.
Other
411 stars 40 forks source link

2d visibility notifier optimization demo not working for me #16

Closed obackhoff closed 2 years ago

obackhoff commented 2 years ago

First of all, I want to say I really appreciate all the work put into these tutorials.

I cloned the repo and tried the 2d optimization project on Godot 3.5 (and 3.4.5 with same results) and was not able to see any results at all.

  1. I opened the project
  2. Ran the project inside the engine
  3. The FPS is still around 300
  4. Clicked enable notifiers
  5. FPS is still around 300, possibly lower but that could be just margin of error

The first thing I noticed is the zero performance improvements. Second thing is the low FPS. In the youtube video the FPS is around 1200 without and around 3500 with notifiers enabled.

Do you think the specs of my machine just cannot handle more than 300 FPS for that relatively simple scene? Could it be a project setting? Why do you think I see no difference when enabling notifiers?

I profiled it using Godot's built in profiler and all function calls where very fast. Only "Process Time" at the top under Frame Time was kind of high. Could it be a windows setting? I made sure to have performance mode enabled in power settings on windows.

EDIT: I checked the performance stats of my machine and CPU utilization was around 15% and GPU around 35%. It seams it can do more.

Thanks in advance :)

My machine specs: Windows 10 intel i7-10750H Nvidia RTX 2070 max-q RAM 32gb

NathanLovato commented 2 years ago

15% overall CPU usage can just mean it's capping one CPU core while the others are unused. But capping one CPU core with so few FPS doesn't sound right with such a powerful CPU.

300 FPS for your machine, there's definitely something wrong. To me, it suggests that the framerate could be capped on your machine, preventing you from using your computer's full potential and seeing the difference.

Maybe Nvidia's app is capping the framerate of games or forcing the game to use vsync, for instance, which forces the app to sync with your monitor's refresh rate.

Otherwise, I'm not sure.

obackhoff commented 2 years ago

Hey, thanks for the quick response. It seems really strange to me as well.. my screen's refresh rate is 240Hz. Vsync is disabled in Godot and I cannot find another setting or rule that tells Nvidia to save power or something like that.

All of these tests have been using 1080p resolution and the default settings in the project.

The original tests were all done in windowed mode. Here is a bit more info:

I would appreciate any ideas to try. Thanks.

Untitled2 Untitled

obackhoff commented 2 years ago

Just a quick update for anyone having similar issues:

I disabled the integrated GPU in the Bios so that it only uses the Nvidia GPU and that had a huge impact:

without notifiers it's around 1250 FPS and with notifiers it is around 2000 FPS... I had done this before for other games and never really made a huge impact (on the GPU's limit) But it seems that Intel is creating a bottle neck or it tries to optimize power somehow... really strange.

This is clearly now an issue specific to my machine with hybrid graphics, not a Godot problem nor an implementation problem. The problem seems to see the copy operation from the Nvidia GPU to the integrated one, it seems that for this case it saturates at around those FPS and therefore the optimization with 2d visibility notifiers is negligible.

I appreciate your time to answer. If anyone knows how to improve the performance with hybrid graphics, please let me know.

NathanLovato commented 2 years ago

Glad you found the cause!