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

Memory usage tracking #356

Closed
Tracked by #387
Korijn opened this issue Apr 23, 2023 · 0 comments · Fixed by #399
Closed
Tracked by #387

Memory usage tracking #356

Korijn opened this issue Apr 23, 2023 · 0 comments · Fixed by #399
Labels
enhancement New feature or request

Comments

@Korijn
Copy link
Collaborator

Korijn commented Apr 23, 2023

I saw this other library applying a neat strategy to track memory usage: https://github.com/greggman/webgpu-memory/blob/main/src/webgpu-memory.js

The core idea is to decorated all functions that create and destroy buffers and textures, and track memory usage there. It's a simple idea but I can see how it would give a very good estimate of actual usage.

There are many other things you could track like shaders, canvases, etc, but buffers and textures are most likely the main chunk of memory usage. It's good to start with something simple.

We could consider making this a feature of wgpu-py that can be toggled on/off, since it introduces some performance overhead that isn't desirable in production code.

We could include current memory usage information in the "reporting" functions that we have available.

@almarklein almarklein added the enhancement New feature or request label Apr 24, 2023
This was referenced Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants