Skip to content

Godot 4.4 doesn't allocate shared GPU memory correctly #101850

Closed
@NovaXP

Description

@NovaXP

Tested versions

  • Reproducible in Godot 4.4 Dev 1, Godot 4.4 Beta 1 (haven't tested versions in between)
  • Not reproducible in Godot 4.3 Stable

System information

Godot v4.4.beta1 - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated AMD Radeon R9 M200X Series (Advanced Micro Devices, Inc.; 27.20.20913.2000) - Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz (8 threads)

Issue description

While testing the Godot Benchmarks project using Godot 4.4 Beta 1 on some older computer setups, I found that the benchmark would always crash at the "Viewport > Activation > Activate 1024 Viewports" part on a system with only 1 GB of VRAM. When the console is open, the output reads:

Running benchmark 1 of 1: viewport/activation/activate_1024_viewports
ERROR: Can't allocate memory for image, error: -2.
   at: (drivers/vulkan/rendering_device_driver_vulkan.cpp:1812)
ERROR: Condition "!texture.driver_id" is true. Returning: RID()
   at: texture_create (servers/rendering/rendering_device.cpp:1020)
ERROR: Condition "texture.rd_texture.is_null()" is true.
   at: texture_2d_initialize (servers/rendering/renderer_rd/storage_rd/texture_storage.cpp:820)
ERROR: Attempting to use an uninitialized RID
   at: (./core/templates/rid_owner.h:259)

This same issue occurs on both Windows 10 and Ubuntu 22.04 LTS, and none of the other tests fail, only Activate 1024 Viewports. When converting the benchmark project to 4.3 Stable, the test is able to run successfully.

I tried reproducing the issue on a separate computer with 2 GB of VRAM, and while the issue didn't occur, I found in Task Manager that the Activate 1024 Viewports test would use around 0.75 GB of VRAM in 4.3 Stable, but around 1.1 GB in 4.4 Dev 1 and 4.4 Beta 1 (I haven't tested any of the versions in between yet). In the images below, the green line represents the test being run in 4.3 Stable, and the red line represents the same test being run in 4.4 Beta 1.

Image

Image

(I understand that old hardware can't be supported forever, so if this issue is a side effect of a new feature that will benefit most users then that's okay. I just wanted to bring attention to it in case it's not a known or intended change.)

Steps to reproduce

Run the Godot Benchmarks project in Godot 4.4 Beta 1, select and run only the following tests and note how much VRAM was used:

  • Activate 1024 Viewports
  • Activate 256 Viewports
  • Activate 64 Viewports

Then, repeat the same process using Godot 4.3 Stable and compare the VRAM usage to 4.4 Beta 1.

Minimal reproduction project (MRP)

https://github.com/godotengine/godot-benchmarks

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Bad

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions