Open Bug 1684354 Opened 5 years ago Updated 1 year ago

Blend demo uses 60% GPU

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement

Tracking

()

People

(Reporter: mayankleoboy1, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

Attachments

(2 files)

Use WR
Go to https://themaninblue.com/experiment/BlobbyBlendMode/
Monitor the GPU usage via either GPU-Z , or the builtin GPU usage in Windows Task Manager.

Nightly uses 60% GPU. Chrome uses 20%-30% GPU.

ER: Less GPU use, if possible.

Profile : https://share.firefox.dev/3hvvbkg

Attached file about:support

Feel free to dupe this to other bugs

Flags: needinfo?(gwatson)

Most of the shader GPU time is reported to be in B_MixBlend and B_Blend. This appears to be another instance of the slow mix-blend implementation we currently have with WR. This should be resolved by the ongoing work in 1684781, which is unblocked now due to the render task graph patches all landing.

Assignee: nobody → gwatson
Depends on: 1684781
Flags: needinfo?(gwatson)

I did some profiling of this with the recent mix-blend work - it only takes about 2.8ms GPU time on my high-end AMD 5700 GPU at 4k, but it's probably much slower on an integrated GPU.

Do you know if the GPU measurement in comment 1 on Chrome was using GPU rasterization? Or is it using the GPU to composite, but actually rasterizing those tiles on background CPU cores?

One fix in the pipeline for this is to optimize the mix-blend shader (https://bugzilla.mozilla.org/show_bug.cgi?id=1690401). There are also some other optimizations we can apply to the shader, such as specializing the multiply mode since it's the most commonly used one, rather than having it in an uber-shader.

Un-assigning myself for now, since this doesn't appear to be related to the scrolling / background mix-blend optimizations I'm working on, but just a stress test of the mix-blend shader performance, and I'm not working on that specific part right now.

Depends on: 1690401
Flags: needinfo?(mayankleoboy1)
Assignee: gwatson → nobody

(In reply to Glenn Watson [:gw] from comment #4)

Do you know if the GPU measurement in comment 1 on Chrome was using GPU rasterization? Or is it using the GPU to composite, but actually rasterizing those tiles on background CPU cores?

I have no idea what Chrome is doing here :)

I will be happy to check, if you can guide me how/what to do.

Flags: needinfo?(mayankleoboy1)

According to [1], using one of the following methods should force GPU rasterization:

To use the experimental hardware rasterizer on all pages, regardless of device and content: --force-gpu-rasterization or chrome://flags/#enable-gpu-rasterization

[1] https://www.chromium.org/developers/design-documents/chromium-graphics/how-to-get-gpu-rasterization

No longer depends on: 1684781

(In reply to Glenn Watson [:gw] from comment #6)

According to [1], using one of the following methods should force GPU rasterization:

To use the experimental hardware rasterizer on all pages, regardless of device and content: --force-gpu-rasterization or chrome://flags/#enable-gpu-rasterization

[1] https://www.chromium.org/developers/design-documents/chromium-graphics/how-to-get-gpu-rasterization

force enabling chrome://flags/#enable-gpu-rasterization
CPU : 1 core
GPU: 25%-30%
These readings are the same as with the flag chrome://flags/#enable-gpu-rasterization se to default.

Does this seem any better now? (it runs well on my machine, but that has a quite decent AMD GPU in it).

Flags: needinfo?(mayankleoboy1)
Attached file blob_stress_test.html
Flags: needinfo?(mayankleoboy1)

On my faster machine, with the original page:
Nightly: 30% GPU
Chrome: 20% GPU

With the stress-test testcase:
Nightly:90%
Chrome: 80%

@gw: I leave it up to you to decide if this bug has any low hanging fruit or something interesting to look at, and therefore should be kept open.
Adding bug 1683440 as a dependency.

Depends on: 1683440
Flags: needinfo?(gwatson)

Let's leave it open then, we can probably (definitely) optimize the blend / clip shaders involved here.

Flags: needinfo?(gwatson)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: