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.1 onwards runs extremely slow on Ubuntu 22.04 #82063

Closed
traditionalgithub opened this issue Sep 21, 2023 · 30 comments
Closed

Godot 4.1 onwards runs extremely slow on Ubuntu 22.04 #82063

traditionalgithub opened this issue Sep 21, 2023 · 30 comments

Comments

@traditionalgithub
Copy link

Godot version

4.1 onwards (excluding flatpak versions)

System information

Godot v4.1.1.stable - Ubuntu 22.04.3 LTS 22.04 - Vulkan (Compatibility) - NVIDIA GeForce GTX 1060 (nvidia; 535.86.05) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

Everything runs slow, especially project opening. It takes several minutes opening up an empty project. Switching between nodes (in said newly created empty project) costs roughly 5 seconds.

This happens in 4.2-dev5, 4.1.1, 4.1.0.

While the latest flatpak version (Godot v4.1.1.stable (bd6af8e) - Freedesktop SDK 23.08 (Flatpak runtime) - Vulkan (Compatibility) - NVIDIA GeForce GTX 1060 (nvidia) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)) and version 4.0.4 (Godot v4.0.4.stable - Ubuntu 22.04.3 LTS 22.04 - Vulkan (Compatibility) - NVIDIA GeForce GTX 1060 (nvidia; 535.86.05) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)) and 4.0.3 are not as slow as mentioned above, they still run fairly slow comparing to 3.5.2. The nVidia driver package is nvidia-driver-535 (Ububtu restricted source).

I'm running all these versions on my msi GP62MVR-7RFX laptop.

Steps to reproduce

Download the specific versions from godotengine.org, extract them and then run them. brief hardware and software environment information is specified in Issue Description.

Minimal reproduction project

With the specific godot versions and a newly created empty project.

@danilw
Copy link

danilw commented Sep 21, 2023

Everything runs slow, especially project opening.
Flatpak

Are you sure Nvidia drivers works in your "flatpak" environment?
I can be wrong - maybe your flatpak-environment force Godot to use Intel integrated GPU or even Mesa software render - this why it so slow.

What you see in Godot Editor Output when you launch Empty project, first line there must be:

Godot Engine v4.1.1.stable.official.bd6af8e0e - https://godotengine.org
Vulkan API 1.3.224 - Forward+ - Using Vulkan Device #1: NVIDIA

something like this, can you confirm your Godot use your Nvidia GPU?

@traditionalgithub
Copy link
Author

traditionalgithub commented Sep 21, 2023

What you see in Godot Editor Output when you launch Empty project, first line there must be:

Godot Engine v4.1.1.stable.official.bd6af8e0e - https://godotengine.org
Vulkan API 1.3.224 - Forward+ - Using Vulkan Device #1: NVIDIA

What I am getting from Help > Copy System Info are always one liners. Does two-lined info comes from Windows versions?

For the flatpak version of 4.1.1 I got : Godot v4.1.1.stable (bd6af8e) - Freedesktop SDK 23.08 (Flatpak runtime) - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1060 (nvidia) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads).

For the standalone version from godotengine.org I got : Godot v4.1.1.stable - Ubuntu 22.04.3 LTS 22.04 - Vulkan (Compatibility) - NVIDIA GeForce GTX 1060 (nvidia; 535.86.05) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Both are slower than version 3.5.2 ( the LTS version). But the flatpak version takes approximately one minutes to open up a empty project while the standalone binary version takes about more than 6 minutes to do it.

something like this, can you confirm your Godot use your Nvidia GPU?

How may I do this? Is there something like an option to be checked or selected in the editor's option menu?

@AThousandShips
Copy link
Member

Does two-lined info comes from Windows versions?

As per the comment, this is talking about the console when you launch it, also available in the editor output at the bottom of the editor

What you see in Godot Editor Output when you launch Empty project

@traditionalgithub
Copy link
Author

For the flatpak version it reads as :
Godot Engine v4.1.1.stable.flathub (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
For the standalone version it reads
Godot Engine v4.1.1.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
There is also this following line:
modules/gltf/register_types.cpp:73 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
Is this making the standalone version extremely slow?

@danilw
Copy link

danilw commented Sep 22, 2023

What I am getting from Help > Copy System Info are always one liners. Does two-lined info comes from Windows versions?

I talk about this:
Run Godot4 - New Project - create empty 3dscene - press Run
image

Middle bottom screen you see Output with Nvidia line, show/copy what you have.

@traditionalgithub
Copy link
Author

Run Godot4 - New Project - create empty 3dscene - press Run
For the flatpak version, the message reads:

Godot Engine v4.1.1.stable.flathub.bd6af8e0e - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 535.86.05 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 1060

For the standalone version it reads:

Godot Engine v4.1.1.stable.official.bd6af8e0e - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 535.86.05 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 1060

Both runs use compatibility renderer.

@danilw
Copy link

danilw commented Sep 22, 2023

OpenGL API 3.3.0 NVIDIA 535.86.05 - Compatibility

this is not Vulkan

@traditionalgithub
Copy link
Author

traditionalgithub commented Sep 22, 2023

No, they are not. I changed to compatibility mode in hope that will reduce the time. But this hardly works, the amount of time is still roughly the same.
I also tried unplugging all usb devices before opening a project, but neither does this work, and it is said to be a method in windows.

@danilw
Copy link

danilw commented Sep 22, 2023

No, they are not. I changed to compatibility mode in hope that will reduce the time. But this hardly works, the amount of time is still roughly the same.
I also tried unpkug all usb devices before opening a project, but neither does it work, and it is said to be a method in windows.

I have no experienced something like this ever in Godot4, so it may be your system specific.
I was thinking it may be flatpak related, and if you have same behavior if you launch Godot4 without flatpak.

Your system specs are more than enough to launch godot instantly, I do not know how to fix your case.

@clayjohn
Copy link
Member

Can you try running your project using the --benchmark argument from the command line?

The output should look something like:

BENCHMARK:
	- register_core_types :  0.014875  sec.
	- servers :  0.321525  sec.
	- register_editor_types :  0.003225  sec.
	- scene :  0.25477  sec.
	- editor_register_and_generate_icons_all :  0.278391  sec.
	- editor_register_and_generate_icons_with_only_thumbs :  0.002916  sec.
	- editor_register_fonts :  0.023803  sec.
	- create_editor_theme :  0.628902  sec.
	- create_custom_theme :  0.628923  sec.
	- project_manager :  0.871006  sec.
	- startup_begin :  1.484659  sec.
	- unregister_editor_types :  0.000009  sec.
	- unregister_core_types :  0.021715  sec.
	- Main::cleanup :  0.09779  sec

@traditionalgithub
Copy link
Author

traditionalgithub commented Sep 22, 2023

I have no experienced something like this ever in Godot4, so it may be your system specific.
I was thinking it may be flatpak related, and if you have same behavior if you launch Godot4 without flatpak.

Yes. From my limited knowledge flatpak creates something similar to containers for the programs to be installed, so the original environment does not affects the flatpak apps. But I am too clueless to find the cause.

@traditionalgithub
Copy link
Author

traditionalgithub commented Sep 22, 2023

Can you try running your project using the --benchmark argument from the command line?

By launching the project manager, I got:

Godot Engine v4.1.1.stable.official.bd6af8e0e - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 535.86.05 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 1060
 
BENCHMARK:
	- register_core_types :  0.059753  sec.
	- servers :  0.296907  sec.
	- register_editor_types :  0.010784  sec.
	- scene :  0.150382  sec.
	- editor_register_and_generate_icons_all :  0.111082  sec.
	- editor_register_and_generate_icons_with_only_thumbs :  0.000869  sec.
	- editor_register_fonts :  0.307085  sec.
	- create_editor_theme :  0.587543  sec.
	- create_custom_theme :  0.587554  sec.
	- project_manager :  5.208346  sec.
	- startup_begin :  5.739489  sec.

By opening edited empty project (edits include only arbitrarily created nodes no more than ten), I got:

Godot Engine v4.1.1.stable.official.bd6af8e0e - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 535.86.05 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 1060
 
BENCHMARK:
	- register_core_types :  0.059753  sec.
	- servers :  0.296907  sec.
	- register_editor_types :  0.010784  sec.
	- scene :  0.150382  sec.
	- editor_register_and_generate_icons_all :  0.111082  sec.
	- editor_register_and_generate_icons_with_only_thumbs :  0.000869  sec.
	- editor_register_fonts :  0.307085  sec.
	- create_editor_theme :  0.587543  sec.
	- create_custom_theme :  0.587554  sec.
	- project_manager :  5.208346  sec.
	- startup_begin :  5.739489  sec.
	- unregister_editor_types :  0.000007  sec.
	- unregister_core_types :  0.026357  sec.
	- Main::cleanup :  0.250904  sec.

During the long period of opening the project, I also got these messages:

ERROR: Condition "!texture_allocs_cache.has(p_id)" is true.
   at: texture_free_data (drivers/gles3/storage/utilities.h:111)
ERROR: Cubemap Arrays are not supported in the GL Compatibility backend.
   at: texture_2d_layered_initialize (drivers/gles3/storage/texture_storage.cpp:763)
ERROR: Attempting to use an uninitialized RID
   at: get_or_null (./core/templates/rid_owner.h:199)
ERROR: Condition "!t" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:705)

@traditionalgithub
Copy link
Author

Is it normal to open a up a nearly empty project in approximately half a minute with my hardware?

@danilw
Copy link

danilw commented Sep 24, 2023

Is it normal to open a up a nearly empty project in approximately half a minute with my hardware?

I have Ryzen3 3200 4 cores CPU with integrated Vega8 GPU - using integrated GPU:

VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json ./Godot_v4.1.1-stable_linux.x86_64

Vulkan API 1.3.238 - Forward+ - Using Vulkan Device #0: AMD - AMD Radeon Vega 8 Graphics (RADV RAVEN)

took 5 sec of time opening 3d-antialiasing demo, on video 10-15 sec time

1.webm

3d-antialiasing demo from https://github.com/godotengine/godot-demo-projects

@traditionalgithub
Copy link
Author

What might be the common causes of loss of speed if they are not about usb and / or GPU?

@traditionalgithub
Copy link
Author

Since standalone version 4.1.1 spends about half a minute launching project manager, I think the --verbose output might help diagnose the problem.

./Godot_v4.1.1-stable_linux.x86_64 --verbose
Godot Engine v4.1.1.stable.official.bd6af8e0e - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
Xshape 1.1 detected.
Xinerama 1.1 detected.
Xrandr 1.6 detected.
Xrender 0.11 detected.
Xinput 2.2 detected.
XInput: Refreshing devices.
XInput: No touch devices found.
Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.
Only one GPU found, using default.
ScreenSaver: DBus 1.12.20 detected.
PortalDesktop: DBus 1.12.20 detected.
Using "default" pen tablet driver...
Shader 'CanvasSdfShaderGLES3' SHA256: 72cda41890bce2f09217c172023d31e735a3fee605bad83c8e63f1a981a36a77
Shader 'SkeletonShaderGLES3' SHA256: add3f03e6eebdffdf0073fae42195857307eddada333b82998642329511917a2
Shader 'ParticlesShaderGLES3' SHA256: 9bf432d37b0b4792d67aa9f577258845d4047e3f98e990aeca6fd20a868c4db2
Shader 'ParticlesCopyShaderGLES3' SHA256: c778843b0cd1c7ce4c621fa2b924f703ac4001faef0555114b81a76c264a6908
Shader 'CopyShaderGLES3' SHA256: b1bc5a355ed9bda23f291956f121e0535b4e81b54cdac398412d200e6133161f
Shader 'CanvasShaderGLES3' SHA256: 007cddfcf35f7d57b219cffec53f6a7d9fe7a1979be4db64c6450cfac6000053
Shader 'CanvasOcclusionShaderGLES3' SHA256: 968915a469db9a7d505be274e8060c8288c15a5865baeb8362b3b0e2cacb16f3
Shader 'SceneShaderGLES3' SHA256: 7757391c487ac94cfa6418166bd5fdacce470f09394c1a2a875e878c8c5d8596
Shader 'SkyShaderGLES3' SHA256: 1fe105946e63973aecf5198091930c2bdb17778012ef0253e325ade3a297e6c8
Shader 'CubemapFilterShaderGLES3' SHA256: 2b651c285a02b7d4221af1827e1613c03e73e600ebc40b9e6a0b22bb855bd75f
OpenGL API 3.3.0 NVIDIA 535.104.05 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 1060
JoypadLinux: udev enabled and loaded successfully.
PulseAudio 15.99.0 detected.
PulseAudio: context other
PulseAudio: context other
PulseAudio: context other
PulseAudio: context ready
PulseAudio: Detecting channels for device: alsa_output.usb-Edifier_Technology_Co._Ltd_HECATE_GS02_GAMING_SOUND_CARD-00.analog-stereo
PulseAudio: detected 2 output channels
PulseAudio: audio buffer frames: 512 calculated output latency: 11ms
 
TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
CORE API HASH: 3144975361
EDITOR API HASH: 3555714656
EditorSettings: Load OK!
Loaded system CA certificates
EditorSettings: Save OK!

@traditionalgithub
Copy link
Author

I also tried build the program from the source of 4.1.1 and the current master branch. The time spent on opening are roughly the same as the stable standalone version. Is there some ways to investigate the cause of the speed loss?

@danilw
Copy link

danilw commented Sep 29, 2023

I also tried build the program from the source of 4.1.1 and the current master branch. The time spent on opening are roughly the same as the stable standalone version. Is there some ways to investigate the cause of the speed loss?

can you try to load from some USB-linux-distro that have Nvidia drivers preinstalled, and launch Godof from there, to know this is not "your current distro problem"

or install some Linux with DE and Nvidia drivers to empty space if you have - and test same

@traditionalgithub
Copy link
Author

can you try to load from some USB-linux-distro that have Nvidia drivers preinstalled, and launch Godof from there, to know this is not "your current distro problem"

Thanks for the suggestion, will do that.

@traditionalgithub
Copy link
Author

The speed is a lot better in the live usb systems and the newly reinstalled fedora with my same hardware now. Opening up an empty takes less than 10 second, though i think it is still a bit slow. Maybe it is because of the dual nvidia vga and integrated intel vga?

@aapolipponen
Copy link

I had this problem on Fedora, changed the system I ran Godot on (first one was Nvidia), then it worked perfectly. This is not a permanent solution though.

@traditionalgithub
Copy link
Author

changed the system I ran Godot on (first one was Nvidia)

Which system have you changed to?

@aapolipponen
Copy link

changed the system I ran Godot on (first one was Nvidia)

Which system have you changed to?

Ryzen 5 5600x, RX 6600

@hakro
Copy link
Contributor

hakro commented Oct 10, 2023

Hey !
I have a similar issue, although not necessarily the same hardware (I can open a separate issue if needed)

Testing on Godot 4.1, and 4.2 dev6 which behaved the same.
When using in iGPU and Vulkan, the editor, or a game, start up in more that 37 seconds, with an empty fresh project and scene.
This is a new laptop, with a fresh Ubuntu 22.04 based OS, with an Intel Core i7-13700H

-> Godot_v4.2-dev6_linux.x86_64  --path games/GDTest  --benchmark --rendering-method mobile
Godot Engine v4.2.dev6.official.57a6813bb - https://godotengine.org
xkbcommon: ERROR: couldn't find a Compose file for locale "en_AG" (mapped to "en_AG")
WARNING: Error setting locale modifiers
     at: DisplayServerX11 (platform/linuxbsd/x11/display_server_x11.cpp:5647)
WARNING: XOpenIM failed
     at: DisplayServerX11 (platform/linuxbsd/x11/display_server_x11.cpp:5695)
WARNING: XCreateIC couldn't create wd.xic
     at: _create_window (platform/linuxbsd/x11/display_server_x11.cpp:5323)
Vulkan API 1.3.246 - Forward Mobile - Using Vulkan Device #0: Intel - Intel(R) Graphics (RPL-P)

BENCHMARK:
        - register_core_types :  0.00759  sec.
        - servers :  36.615546  sec.
        - register_editor_types :  0.001621  sec.
        - scene :  0.092383  sec.
        - load_autoloads :  0.000002  sec.
        - game_load :  0.006083  sec.
        - startup_begin :  36.726204  sec.
        - unregister_editor_types :  0.000006  sec.
        - unregister_core_types :  0.012985  sec.
        - Main::cleanup :  0.111843  sec.

This does not happen on the iGPU using compatibility renderer.
This does not happen at all, on any rendrer, when enabling the Nvidia GPU.
It does not happen either on a 12 years old Dell laptop with an Radeo GPU.

So seems like it's related to the Intel iGPU + Vulkan specifically on my case. The game does start though. It only takes 40 seconds to do so.

Cheers

@danilw
Copy link

danilw commented Oct 11, 2023

I just say - from this all iGPU Intel/AMD mess, and since "some" people running Godot4 Vulkan render in WSL or other VM - all of them may use mesa-lavapipe-llvm CPU emulation, instead of using actual GPU.

And Godot4 can show "notification/warning" window when Godot running not on "physical discrete GPU", especially when used CPU-translation for Vulkan.

godotengine/godot-proposals#8071

@traditionalgithub
Copy link
Author

I now got a much better way to reproduce the situation : Boot the laptop using Zorin Os (Core) live usb with Nvidia driver mode. Change the language / locale to Traditional Chinese (or maybe other non-English / CJK languages, I have not tried them) and then log out then log in. Then launch Godot Engine 4.1.2 stable (the stand alone version downloaded from godotengine.org), create an empty project and open that project (the locations of the program and project may or may not affect the speed, but they must be writable). Then the project will take about half a minute to open. It the language / locale is changed to English, the time takes to open empty projects drops down to around six seconds.

I think the above procedure can be further simplified into this : With a Ubuntu-based system, change the language to non Latin character based ones (CJK, Thai, Georgian, Persian and so on) and then open any project. The change of speed is drastic. It gets much slower in the non-Latin character based language opening up a project. And with Latin-based ones on the other hand are much faster.

So I suspects that it has something to do with the locale of the Ubuntu-based systems.

@Calinou
Copy link
Member

Calinou commented Oct 17, 2023

create an empty project and open that project (the locations of the program and project may or may not affect the speed, but they must be writable). Then the project will take about half a minute to open. It the language / locale is changed to English, the time takes to open empty projects drops down to around six seconds.

This sounds like a shader caching issue (cache must be generated the first time the editor is opened), rather than something related to the editor language. See godotengine/godot-proposals#3657.

@traditionalgithub
Copy link
Author

This sounds like a shader caching issue (cache must be generated the first time the editor is opened), rather than something related to the editor language. See godotengine/godot-proposals#3657.

Changing the language to English works pretty well for me in raising the speed, the time needed for opening a small project drops to less than 5 seconds. It take much longer time to open the same project, and such comparison can be made repeatedly. Is that shader-related too?

@Zireael07
Copy link
Contributor

If changing language to English improves the loading speed, then it's most likely the advanced text features.

@traditionalgithub
Copy link
Author

Since the cause seems to be less obscure, I think it would be better for analyzing the situation with another dedicated issue. Closing this one for now.

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

No branches or pull requests

10 participants