-
-
Notifications
You must be signed in to change notification settings - Fork 22.5k
[3.x] Disable GPU threaded optimizations option #106556
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
base: 3.x
Are you sure you want to change the base?
Conversation
1f7a779
to
1866c3a
Compare
e696b9a
to
02da94d
Compare
02da94d
to
f2724b3
Compare
f2724b3
to
938644e
Compare
6ca3328
to
d0a4504
Compare
We can disable indirectly by enabling verbose GL debug output.
d0a4504
to
d210959
Compare
Moved here, addressed to @elvisish:
Also checking the code, all this is switched off when running the editor, it only is active when you are running the game itself. If you are getting slowdowns in the editor, it suggests something else is going on, totally unrelated to this PR.
The relevant switch in GLES2 and GLES3 is:
In both cases it should not be active in the editor (when is_editor_hint() is true). Additionally the correct artifact should print "Attempting to disable GPU Driver threaded optimization via OpenGL debugging" when it is active, this is dependent on you having an adapter name with the string "nvidia" in it. To clarify, the whole system WILL ONLY BE ACTIVE when verbose output is off. I'll see if I can find out what is causing this. To clarify, how long does it take to start with verbose mode? It shouldn't take longer than verbose mode, providing the same debug options are selected (and should take considerably less). It's likely some of the settings I have applied are resulting in more logging, maybe I can test this by emulating it in Linux. UPDATE: I've tested in linux and don't get any debug logs in Trucktown, 3D Platformer or TPS demo. Another possibility is that our debug printing itself is what is causing the difference and maybe flushing std::out or something, in which case the original hypothesis that this is disabling multitheaded optimization might have been incorrect. 🤔 Also would you be able to copy into the post some of the verbose logs you get, just to check these are not actually GL errors that are occurring on your GPU. If these are errors then anything could be happening. To clarify let me know (in a post on the PR) whether you are testing on GLES2 or GLES3, that will help. Also an MRP would be useful, does this slowdown occur with an empty project? Can you also test with an empty project? Also if you run the editor from the artifact, then select
|
We can disable indirectly by enabling verbose GL debug output.
Fixes #33969
Alternative to #106551
PR on hold for now as it requires testing and refinement with a user that has hardware which exhibits the problem in order to proceed.
A long standing issue on Windows with Nvidia drivers has been the threaded optimization driver setting. This seems to cause significant stuttering for some users.
Godot 4 tries the approach of using the Nvidia SDK to turn off the optimization directly in the driver (#71472), however that has caused a number of regressions.
Instead users have reported that enabling OpenGL debug logging seems to fix the issue, believed to be by forcing the driver to disable the feature. This is not ideal for exports, because Godot does significant processing to print these debug logs.
Here we add a similar feature which turns on debug logging, but instead provides a pass through so that no processing takes place on Godot side, minimizing the cost of the technique.
Notes
verbose_logging
takes precedence, but by definition if that is on, it will also disable threaded optimization. So probably no need to mention it in the docs.--allow-gpu-threaded
to override the project setting just in case an end user wants to play a game with multithread optimizations enabled.print_line
here just for initial testing so we can see it's active. It would have been aprint_verbose
, but by definition, we can't use this new mode whenverbose
is on. 😁