• General Chat
  • Godot 4.0 is slower that 3.4 on my setup. Is the issue related to Godot's vulkan implementation?

Hello everyone!

I'm Marcin and I'm new here. I'm playing with Godot for about month and I like the engine and editor very much. I read almost everywhere that Godot 4.0 is faster due to Vulkan implementation, not mentioning a better quality. And yes, Godot 4.x has brilliant new features, many improvements, and many problems solved comparing to 3.4. But on my setup there is a catch: 4.0 is slower than 3.4 even in very simple scenes. It's nothing hard to go down to ~25fps on 1280x720.

I understand complexity of measuring and comparing performance on two quite different engines, so I'm NOT trying to achieve more fps in all cases. The problem is that there is quite easy to go below 60fps on 1920x1080. Just with one sky, one light and few cubes.

I created very simple project for testing, where all costly features are disabled (ssao, ss reflections, dof, glow, etc.). Also FXAA, MSAA, etc. are disabled, and every render option in project settings is set to a fastest mode. Only shadows are enabled. Then I converted this project to 4.0. Results for the scene rendered on 1920x1080 resolution: ~100-110 fps for Godot 3.4 (GLES3), ~65-70fps for Godot 4.0 (Vulkan). There is no complex _process nor physics (just one RigidBody).

My setup is:

System:
  Host: x Kernel: 5.10.93-1-MANJARO x86_64 bits: 64
    Desktop: GNOME 41.3 Distro: Manjaro Linux
Machine:
  Type: Laptop System: Dell product: Precision 3520 v: N/A
    serial: <superuser required>
  Mobo: Dell model: 0G0G6Y v: A00 serial: <superuser required> UEFI: Dell
    v: 1.20.2 date: 06/03/2021
Memory:
  RAM: total: 15.51 GiB used: 7.01 GiB (45.2%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: quad core model: Intel Core i7-7700HQ bits: 64 type: MT MCP cache:
    L2: 1024 KiB
  Speed (MHz): avg: 932 min/max: 800/3800 cores: 1: 900 2: 971 3: 1000
    4: 993 5: 900 6: 899 7: 900 8: 900
Graphics:
  Device-1: Intel HD Graphics 630 driver: i915 v: kernel
  Device-2: NVIDIA GM107GLM [Quadro M620 Mobile] driver: nvidia v: 495.46
  Device-3: Realtek Integrated Webcam_HD type: USB driver: uvcvideo
  Display: x11 server: X.Org 1.21.1.3 driver: loaded: modesetting
    unloaded: nvidia resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz
  OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) v: 4.6 Mesa 21.3.4

The system is up to date.

It's worth mentioning that I'm running many games from Steam through Proton with very good results (usually at mid quality with SSAO disabled). I checked Unreal Engine with it's FPS project template, and it is running just fine. I understand that Godot 4.0 is in alpha stage, but I think that such performance drop is not expected. There are many posts and videos about stressing out the engine (r/godot for example), and everyone is telling that 4.x is far better in terms of performance and quality. I understand that my issue may be related to the hardware and/or drivers. But as far I know Vulkan is just an API, where many things are dependent on the implementation.

So is possible that Vulkan implementation in Godot 4.x is somehow not performant for some hardware setups? Should I talk with devs, or should I search for the cause somewhere else (but where)?

Godot 4.x

Godot 3.4

Kind Regards, Marcin

That's depressing. I guess it's supposed to do better as the scene gets more complex, so maybe test it on a much more complex setup with multiple lights, etc.

Vulkan is lower level and offers potentially better performance, but not always in all cases. It is just an API, the things you are running still are running given the limitations of your hardware, and the operating system, and the drivers in use. And the quality can vary widely depending on those factors.

Just to give you an idea, I have an Intel integrated GPU testing system (HD 500) that has poor Vulkan support. It does technically work, it claims it is supported, but performance is really bad. First, it is only Vulkan 1.2, when I think we are on 1.4 now. Then the driver quality is less since it is Intel, Nvidia and AMD have higher quality drivers. So on Doom 2016, I get 60 fps at 720p low settings OpenGL, but only 30 fps with Vulkan. The graphics look the same, there are no glitches. Just half the performance.

You will probably find this as well. On newer, higher-end graphics cards with good drivers (like Nvidia or AMD on Windows) you could be looking to get 50% or up to 100% better performance on Vulkan (typically you get better gains on more complex heavy scenes). With a simple scene, it might be the same performance, but rarely less than OpenGL.

But OpenGL has been around for a long time, the drivers are mature for all vendors and stable. Vulkan is relatively new, not used in many AAA games, so the driver quality can be lesser, though this has improved in recent years. Especially after big Vulkan only games like Doom Eternal and Wolfenstein, it seems that the vendors have solved any last remaining issues. So it is rare to have glitches, at least on Nvidia and AMD on newer cards. But if you have an old GPU (like Vulkan 1.2 or below) or it is integrated graphics, then you might get worse performance.

Look in the console log and see which Vulkan device is being used, since you have 2. It may be that Godot is picking the first device, your Intel GPU, and that is why performance is bad. You can have basically as many devices as you want in Vulkan, but typically you only allocate one to do the rendering. While there are ways to make a sort of ghetto-SLI with whatever is on your system (like combining an Intel and Nvidia GPU) the gains are dubious and I doubt Godot is attempting it. So it may be that it's just picking the wrong GPU. You might be able to force it to choose a specific device, or just disable the Intel GPU in your operating system.

Thanks for replies.

For Godot 3.x (OpenGL) I must choose which GPU which will be used. Godot 4.0 is always picking Nvidia GPU. I forgot to mention about this in the first post, sorry.

Yes, it may be a driver/hardware problem. But I did simple tests for my operating system. First is glxgears for OpenGL. I got between 96 and 120 fps on Nvidia GPU for fullscreen (1980x1080). Second test is vkcube for Vulkan, similar to glxgears, and I got between 127 and 135 fps.

I understand that this is not directly comparable with complex engine like Godot, but I'm trying to eliminate suspects and/or find bottlenecks. There is still possibility that OS/driver is causing the issue with Godot, but probably not at the very low level of the display stack.

Of course I'll also check Godot 3 vs 4 using similar but more complex scene, as @fire7side suggested.

Well, honestly, it's probably just Godot 4.0. It's kind of slow even on my system (desktop with a 6800XT and 16-core CPU). I have one of the best systems you can build right now and it's still a little choppy. Godot 3.4 is perfectly smooth. It's probably cause it's in alpha, there is no problem with Vulkan.

@cybereality said: But OpenGL has been around for a long time, the drivers are mature for all vendors and stable.

I wouldn't go so far as to say that, I know you mean specifically PC but there are plenty of mobile vendors who still haven't properly implemented all the features of GLES in their drivers.

Oh yeah, mobile is a mess. I was talking about desktop PC.

Godot 4.0 uses better shadow filtering by default, which is noticeably more demanding. Try decreasing the shadow quality options in the Project Settings. See also https://github.com/godotengine/godot/pull/53961 and https://github.com/godotengine/godot/pull/54158.

Also, try decreasing Max Clustered Elements to 32 (the lowest permitted value) in the Project Settings. Clustering has a base cost, yet its benefits are only noticeable in complex scenes. You can also try to go further and change the rendering backend from Vulkan Clustered to Vulkan Mobile, but there are currently many bugs with the Vulkan Mobile backend. Since you are on a low-end GPU (even by 2013 standards), you need to decrease everything you can to get decent performance on a modern rendering engine – like you'd do when trying to play a recent AAA game on such a system.

I also have a pull request that makes clustering less demanding, but it's not merged yet.

Hi.

These shadow settings were used in the comparison:

I've changed soft shadows to Hardest, but there is still about 65-70fps. I've disabled shadows for Directional Light and performance increased about 10fps (~75-80fps).

FYI, disabling shadows for DL in Godot 3.4 increases scene's performance about 5-7fps on my setup.

If I can help you somehow with tracking the issue (if there is one), please feel free to ask me.

This is not strictly related to Godot 3.4 vs 4.0 performance, but remember that modern Linux desktop environments such as GNOME often force X11 compositing with no way to (consistently) disable it. This compositing can make or break rendering performance, especially on old/low-end hardware. Running the project in fullscreen may sometimes work to bypass compositing, but not always. In this case, the only way to work around this is to switch to another desktop environment such as KDE or Xfce. Both of their respective window managers (KWin and Xfwm) have optional compositing, so you can turn it off at any time to improve gaming performance significantly, even in windowed games.

PS: You should keep 16 Bits checked for shadows in the project settings as this will make them render faster compared to 24-bit shadows (which are used if 16 Bits is unchecked). There is no discernible visual difference in most scenes.

I also noticed choppier performance on Wayland, since I can't get FreeSync to work on the latest Ubuntu. I decided to switch back to X11 (and enabled FreeSync), and that helped a bunch.

Running the project in fullscreen may sometimes work to bypass compositing, but not always. In this case, the only way to work around this is to switch to another desktop environment such as KDE or Xfce.

I'm on X11 (X.Org 1.21.1.3) with AwesomeWM running as a shell of Gnome environment (that's why it is identified as Gnome desktop in the first section of inxi output). I've retested the scene on pure AwesomeWM/X11 and results are pretty similar. Also I've did another test with Gnome on Wayland, but without significant difference (maybe there was drop of few fps).

I'm not using compositor on my X11 session, but I've retested with picom (aka compton): for backends glx and xr_glx_hybrid there is performance drop to 50-55fps; for backend xrender it is similar as without compositor (~70fps).

PS: You should keep 16 Bits checked for shadows in the project settings as this will make them render faster compared to 24-bit shadows (which are used if 16 Bits is unchecked). There is no discernible visual difference in most scenes.

Ok, that's my misunderstanding. These options have no tooltips yet, so I thought that disabling them reduces quality to 8 bit :confounded: Sorry. Still, after enabling 16bit I see no significant difference. Probably because of a very simple scene.

Knowing what to check and what to avoid, I'll create more complex scene to compare. The idea behind simple scene was about not using things that can differ too much, i.e. baked lighting. With more complex setup things would be less comparable, IMO.

Thanks, Marcin

I mean, it's an older laptop. You can't expect too much.

Sorry, I forgot to mention that I will also follow Calinou's suggestions about settings, but a bit later.

@cybereality yes, it's not bleeding edge hw and it's just a laptop. I'm not expecting too much. Maybe G4 requires way more gpu power - it's fine. I'm just asking is this expected, or is this a kind of issue.

Well I think it will improve. Like I said, it's even choppy on my brand new desktop machine. But it's not Vulkan, Vulkan is fine. It's just alpha software and the first release. I'm sure they can fix it before the final version.

Some quick findings:

  • Reducing Sky Reflections/Roughness layers from 8 to 1 decreased performance about 8-10fps (to ~60fps).
  • Reducing Max Clustered Elements didn't help.
  • Changing backend to Vulkan Mobile increased performance about 10fps.
  • Decreasing quality of shadows (Directional Shadow/Size, Shadow Atlas/Size and Quadrants) has no visible impact on performance
  • Disabling Textures/AF (previously filtering was set to 4x) has no visible impact on performance.
  • Driver/Threads Model set to Multi-Threaded increased performance about 5-7fps, but it is unstable (crashed on window resizing)

I think that trying to decrease other settings is no way to go, unless you would like to find potential bottleneck. I'll add some complexity to the scene next days, and try to judge what my hardware can handle, and what can't.

Thanks for your time, all answers and suggestions. I'll follow Godot development and try 4.0 builds from a time to time. The best thing is that compiling Godot takes two days less than Unreal :smiley:

I tried to compile Godot on my Chromebook and it took 19 hours, and then failed to link at the very end. On my desktop I have a 32-thread CPU so it only takes around 2 minutes.

@cybereality said: I tried to compile Godot on my Chromebook and it took 19 hours, and then failed to link at the very end. On my desktop I have a 32-thread CPU so it only takes around 2 minutes.

AFAIK Chromebook isn't too powerful ;) On my i7 compilation of Godot takes about ten minutes. UE took about 2 days including out of memory, out of disk space and long compilation itself. It is starting about 5 minutes and opening simple projects takes similar time. Too bloaty for me, but looks good in terms of overall quality with good toolset. I'd love to see some features of UE Editor in Godot.

Meanwhile I checked performance of UE, because I remembered that it was running fine on high quality settings. The reality is that project created from FPS template achieves about 30-33fps (100% render size, FHD, High render preset). I can increase performance to almost 60fps by reducing render quality to low (incl. 25% render size, - kind of "pixel art"). And this was little surprising for me, so I started thinking about what I felt and saw before. It looks that overall good "feeling" comes from slight motion blur and something like "reqularity" (stability?), even if there is noticeable fps drop. G4 looks quite sharp and choppy, that's why low fps is more visible / noticeable.

Funny situation, BTW: I spent some hours with my 2nd project in Godot 4, where fps dropped to 3-5 fps last days. After some investigation I found the cause - it was one CharacterBody3D with predefined simple motion based on move_and_slide (simple jumps), placed inside a little space in a mesh with quite complex collision shape. The object was hitting floor and ceiling dozen times per sec slowing down everything. :smile: This observation is not related to this thread nor the main test scene, but it had an impact on my "feelings" about Godot 4.

Regards Marcin

I tried Unreal 5 on a GTX 1060 and just barely got 30 fps, even with 50% scaling. It still looked okay and I guess it was playable, but that is an okay system, mid-range from a few years ago. It wouldn't even open on my laptop.