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

Add workaround for webgpu blur backend #1

Open
wants to merge 4 commits into
base: background_blur
Choose a base branch
from

Conversation

shaoboyan
Copy link

WebGPU blur sample exposes a GPU memory leak issue in WebGPU.
When using WebGPU canvas as source input to VideoFrame, the GPU memory leaks.

This PR add a workaround for this issue by reading gpu data back to CPU and
use 2D canvas as VideoFrame source input.

Description

Purpose

WebGPU blur sample exposes a GPU memory leak issue in WebGPU.
When using WebGPU canvas as source input to VideoFrame, the GPU memory leaks.

This PR add a workaround for this issue by reading gpu data back to CPU and
use 2D canvas as VideoFrame source input.
@shaoboyan
Copy link
Author

@huningxin @Jiawei-Shao PTAL, thanks!

Copy link
Owner

@huningxin huningxin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shaoboyan!

@shaoboyan
Copy link
Author

@huningxin and @Jiawei-Shao PTAL again, thanks!

Copy link
Owner

@huningxin huningxin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @shaoboyan !

Just want to confirm with you whether your cl 3544653 fixes this issue in Chromium?

@shaoboyan
Copy link
Author

Yes, I did some test locally. Hope you could also have a try when it is landed.

@huningxin
Copy link
Owner

@shaoboyan , thanks for your work on the workaround and the chromium fix.

I tested your PR, it fixes the memory leak issue. However, I found FPS drop (30FPS -> 20FPS) after applying this workaround. I guess it is because memory is readback to CPU for processing. As you know, this sample is mainly for the investigation of the full-GPU-only video processing pipeline, ideally it should keep the data on GPU along the way.

Given the chromium fix has good progress, I would propose to merge this workaround into a separate branch. People can use it if they meet the memory leak. And once the chromium fix is landed, I'll let people know and use the latest Chromium.

WDYT?

@shaoboyan
Copy link
Author

@huningxin I think it is Ok for me if people are using it. And I think that CL should be landed soon.

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

Successfully merging this pull request may close these issues.

3 participants