Youtube webrender macOS super high GPU usage
Categories
(Core :: Graphics: WebRender, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | verified |
People
(Reporter: mail, Assigned: mikokm)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) Gecko/20100101 Firefox/67.0
Steps to reproduce:
Running a youtube video with webrender on a macbook pro 2015 15" (intel iris pro) on firefox deveolper edition 67b2.
Actual results:
Puts GPU usage at 80% vs safari at a comfortable 50 or under. Besides that the latent usage is also higher while the tab/firefox process is not actually visible, just running audio. In that case there's still about a 20 to 30% difference vs safari. The difference between a machine that feels sluggish and one that feels ok.
Firefox is pegging the GPU too much leaving almost nothing to the system to render app switches, scrolling in other apps etcetera, leaving an extremely poor UX.
With webrender off though it's still higher than safari (about 10%) but it's workable at least, mainly because when the video is not visible firefox uses about the same compared to safari.
Expected results:
This must be better before webrender is turned on by default on macOS.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 1•6 years ago
|
||
I expect this probably caused by our terrible texture upload path
Comment 2•5 years ago
|
||
Miko, this could be an interesting use case for texture upload improvements.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Assignee | ||
Comment 4•4 years ago
|
||
Depends on D80504
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D80505
Assignee | ||
Comment 6•4 years ago
|
||
The current video texture upload behavior of WebRender is the following:
- Video data is passed to WebRender as a pointer to shared memory
- WebRender allocates a PBO for the pixel data
- WebRender maps the PBO and copies the pixel data from the shared memory to the PBO
- OpenGL copies the PBO content to the texture (
glTexImage2D
)
These patches try to improve WebRender video playback by avoiding a copy during texture upload. This is done by uploading the pixel data directly from the shared memory to a texture, instead of going through a PBO. The copy is avoided with the use of Apple Client Storage OpenGL extension.
There are at least two ways to implement this and it is not immediately obvious which one is better.
Textures managed inside WebRender
Difficult/missing parts:
- An immediate upload path for persistent textures that bypasses texture cache and supports client storage
- Texture updates that avoid allocations and just call
glTexImage2D
- The lifetime of the shared memory pointer inside WebRender needs to match the lifetime of texture referencing it
Textures managed outside WebRender (these patches)
Since Gecko already supports Client Storage with OpenGL backend, this was easier to implement.
RenderExternalTextureHost
wrapsDirectMapTextureSource
that creates OpenGL textures and uploads the pixel data from the shared memory surface.- The resulting OpenGL texture handle is passed to WebRender.
Updated•4 years ago
|
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5b0cde54f206
https://hg.mozilla.org/mozilla-central/rev/ce204516752c
https://hg.mozilla.org/mozilla-central/rev/8cf433954cb5
Updated•4 years ago
|
Updated•4 years ago
|
Comment 9•4 years ago
|
||
Confirmed the issue with 67.0b3-macOS 10.15.5, after a few seconds of playback and page light-scrolling, CPU %usage skyrocket-ed by 60%.
Good improvement can be observed on 80.0b6; spikes occur on actions; but they're falling back way quicker
(idles at @6% as opposed to 26-80%).
Description
•