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

Properly configure the memory allocators #5869

Open
nical opened this issue Jun 24, 2024 · 0 comments
Open

Properly configure the memory allocators #5869

nical opened this issue Jun 24, 2024 · 0 comments

Comments

@nical
Copy link
Contributor

nical commented Jun 24, 2024

The vulkan backend uses the gpu-alloc crate and sets the memory allocator to the i_am_prototyping configuration which is explicitly not meant to make it to production. The starting device memory chunk size for that config is 8 MiB and doubles every time a new chunk must be allocated.

The d3d12 backend uses the default settings provided by gpu-allocator (different crate), which is fixed 256 MiB memory chunks for device memory and 64 MiB for host memory. 256 MiB appears to also be the default size for VMA.

For reference, it looks like Dawn uses a fixed memory chunk size of 8MiB with a buddy allocator.

I think that wgpu should expose this configuration to the outside while providing some reasonable defaults. Firefox (which may create many devices at the same time) will want much smaller chunk sizes by default than a typical big game.

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

No branches or pull requests

1 participant