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

Vulkan: VoxelGI VRAM size estimation is inaccurate #55641

Open
Tracked by #55328
Calinou opened this issue Dec 5, 2021 · 2 comments
Open
Tracked by #55328

Vulkan: VoxelGI VRAM size estimation is inaccurate #55641

Calinou opened this issue Dec 5, 2021 · 2 comments

Comments

@Calinou
Copy link
Member

Calinou commented Dec 5, 2021

Godot version

4.0.dev (2a9dd65)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)

Issue description

VoxelGI VRAM size estimation in the editor appears to be too conservative. Actual VRAM usage seems much higher.

In the testing project linked below, these are the VRAM size deltas I measured from my system:

Mode Estimated Actual Estimated → Actual factor
No VoxelGI N/A 0 MB N/A
VoxelGI Subdiv 64 0.25 MB 5 MB 20 times larger
VoxelGI Subdiv 128 2 MB 260 MB 130 times larger
VoxelGI Subdiv 256 16 MB 510 MB ~31.88 times larger
VoxelGI Subdiv 512 128 MB 2260 MB ~17.66 times larger

The delta is measured from the "No GI" VRAM size mentioned in the absolute VRAM usage values below:

GPU has 8192 MB of VRAM.

Engine not running: 750 MB
No GI: 970 MB
64 subdiv: 975 MB
128 subdivisions: 1230 MB
256 subdivisions: 1480 MB
512 subdivisions: 3230 MB

Antialiasing and other effects were disabled, and the project is running at the default window size of 1024×600. All other setting were left to their default values.

It seems there is no singular amplification value that would be reliable in all cases. From the above testing, we can conclude that the average amplification factor across all subdivision sizes is 50. However, the testing project uses mostly horizontal VoxelGI extents, which means the Y axis has 4 times less voxels than in a VoxelGI with fully cubic extents (Y axis as tall as others). This can likely influence the amplification factor.

Steps to reproduce

  • Look at your VRAM usage when the editor is not running (use nvidia-smi on Linux, or any other program that displays VRAM usage). This is the "Engine off" VRAM usage scenario.
  • Create a project with some meshes. Save the scene, then quit to the project list. Run the project. Look at VRAM usage again. This is the "No GI" VRAM usage scenario.
  • Open the project in the editor again, then add a VoxelGI node. Configure some meshes with their global illumination mode set to Baked.
  • Look at the VRAM size estimation. Note that you will currently have to modify the source code and recompile to see the label, as per VoxelGI information label is cut off #53529.
  • Bake VoxelGI. Quit to the project list a second time.
  • Run the project from the project manager (to ensure the editor isn't running at the same time). Look at VRAM usage a third time. This is the "VoxelGI Subdiv 128" VRAM usage scenario.
  • Repeat this operation with higher and lower VoxelGI subdivision sizes.

Minimal reproduction project

test_voxelgi_large.zip

@KoBeWi
Copy link
Member

KoBeWi commented Jun 4, 2022

Is this still valid in newest alpha?

@Calinou
Copy link
Member Author

Calinou commented Jun 11, 2022

Is this still valid in newest alpha?

Yes (tested on 4.0.alpha 1847094). The amplification factor seems similar, and is pretty much always greater than 16 (even when vertical extents are identical to horizontal extents).

@clayjohn clayjohn modified the milestones: 4.0, 4.x Jan 12, 2023
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

3 participants