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

Use more appropriate vulkano heap sizes #8

Open
galister opened this issue Jan 28, 2024 · 0 comments
Open

Use more appropriate vulkano heap sizes #8

galister opened this issue Jan 28, 2024 · 0 comments

Comments

@galister
Copy link

Hi, I was mostly doing my own research on this and I thought you might be interested.

Vulkano's default StandardMemoryAllocator allocates around 576MB of memory even if you don't upload anything. This is not great for an overlay app that just wants to display a 720p image.

A typical AMD card is known to expose 3 heaps; 1 DEVICE_LOCAL, 1 HOST_VISIBLE and usually 1 smaller (<1GB) DEVICE_LOCAL | HOST_VISIBLE.

StandardMemoryAllocator::default_new() will allocate 256MB per large (>1GB) heap and 64MB for the small heap, making it seem like your app is using 576MB memory (+ openxr swapchains, as they are not managed by vulkano).

The answer for me was to explicitly set the heap sizes instead of using new_default().

https://github.com/galister/wlx-overlay-s/blob/6842872314ad444b38fdd15b90b784964c0fbdae/src/graphics.rs#L1172-L1209

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