-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: background_blur
Are you sure you want to change the base?
Add workaround for webgpu blur backend #1
Conversation
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.
@huningxin @Jiawei-Shao PTAL, thanks! |
src/content/insertable-streams/video-processing/js/webgpu-background-blur.js
Outdated
Show resolved
Hide resolved
d90dab9
to
2f99fa5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @shaoboyan!
src/content/insertable-streams/video-processing/js/webgpu-background-blur.js
Outdated
Show resolved
Hide resolved
src/content/insertable-streams/video-processing/js/webgpu-background-blur.js
Outdated
Show resolved
Hide resolved
src/content/insertable-streams/video-processing/js/webgpu-background-blur.js
Outdated
Show resolved
Hide resolved
@huningxin and @Jiawei-Shao PTAL again, thanks! |
There was a problem hiding this 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?
Yes, I did some test locally. Hope you could also have a try when it is landed. |
@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? |
@huningxin I think it is Ok for me if people are using it. And I think that CL should be landed soon. |
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