Last Comment Bug 801286 - Hardware acceleration is slower with layers.acceleration.force-enabled:true on Linux
: Hardware acceleration is slower with layers.acceleration.force-enabled:true o...
Status: NEW
[gfx-noted]
: regression
Product: Core
Classification: Components
Component: Graphics: Layers (show other bugs)
: 18 Branch
: x86_64 Linux
: -- normal with 7 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
https://developer.mozilla.org/media/u...
Depends on: 779356
Blocks: ogl-linux-beta
  Show dependency treegraph
 
Reported: 2012-10-13 06:11 PDT by vulcain
Modified: 2016-04-27 11:52 PDT (History)
28 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-
-
wontfix
affected
affected
affected
affected


Attachments
about:support (8.01 KB, text/plain)
2012-10-13 06:11 PDT, vulcain
no flags Details
glxinfo (12.25 KB, text/plain)
2012-10-13 06:22 PDT, vulcain
no flags Details
GLXInfo on a PC for which FF Nightly w/ OMTC is slower than stable 16.0.1 (12.30 KB, text/plain)
2012-10-16 00:39 PDT, Adrien CLERC
no flags Details
glxinfo after an update to ppa Mesa 9.2 (9.47 KB, text/plain)
2013-05-20 06:49 PDT, vulcain
no flags Details
about:support in JSON (3.86 KB, application/json)
2015-10-27 12:40 PDT, Dmitry Gutov
no flags Details
glxinfo where OMTC is slower with OpenGL than without (22.83 KB, text/plain)
2015-10-27 14:37 PDT, Dmitry Gutov
no flags Details

Description vulcain 2012-10-13 06:11:43 PDT
Created attachment 671081 [details]
about:support

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/19.0 Firefox/19.0
Build ID: 20121013030542

Steps to reproduce:

I go to https://developer.mozilla.org/media/uploads/demos/p/a/paulrouget/8bfba7f0b6c62d877a2b82dd5e10931e/hacksmozillaorg-achi_1334270447_demo_package/HWACCEL/ and launch the test


Actual results:

FF16.0.1 60+ FPS
FF19.0a1 (2012-10-12) 5FPS


Expected results:

to have 60+ FPS with OMTC
Comment 1 vulcain 2012-10-13 06:22:19 PDT
Created attachment 671082 [details]
glxinfo

linux 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Comment 2 Ernst Sjostrand 2012-10-13 22:42:05 PDT
I don't notice any slowdown, I get 60 fps.
  Graphics

        Adapter Description
        X.Org -- Gallium 0.4 on AMD BARTS

        Device ID
        Gallium 0.4 on AMD BARTS

        Driver Version
        3.0 Mesa 9.1-devel

        GPU Accelerated Windows
        0/1 Basic no information

        WebGL Renderer
        no information

        Vendor ID
        X.Org

        AzureCanvasBackend
        cairo

        AzureContentBackend
        none

        AzureFallbackCanvasBackend
        none
Comment 3 vulcain 2012-10-14 00:42:57 PDT
@  Ernst Sjostrand
I don't think you have OMTC because:
"GPU Accelerated Windows
        0/1 Basic no information"
See to active OMTC:
https://mozillagfx.wordpress.com/2012/10/06/how-to-help-testing-off-main-thread-compositing/
Comment 4 Ernst Sjostrand 2012-10-15 00:04:55 PDT
When I run with layers.force-enabled it says 1/1, but when I export MOZ_USE_OMTC=1 I get that instead. The blog post doesn't specify anything that shows OMTC on/off unfortunately.
Comment 5 Robert Kaiser (not working on stability any more) 2012-10-15 07:47:59 PDT
See bug 798786 for the about:support weirdness when OMTC is on. Actually, that "Basic no information" stuff is probably a sign that OMTC is actually enabled. ;-)
Comment 6 Benoit Girard (:BenWa) 2012-10-15 07:58:29 PDT
Yes that's because to the content/main thread we're drawing the page using software. The fact that the compositor is hardware accelerated is completely transparent to content.
Comment 7 Adrien CLERC 2012-10-16 00:38:05 PDT
I got the same behavior on Linux (openSuse 12.1 w/ radeon) between FF 16.0.1 and 19.0a1 (2012-10-15).

I go from 8fps in the stable version to 3fps with the nightly and OMTC enabled.
Comment 8 Adrien CLERC 2012-10-16 00:39:53 PDT
Created attachment 671744 [details]
GLXInfo on a PC for which FF Nightly w/ OMTC is slower than stable 16.0.1
Comment 9 Karl Tomlinson (ni?:karlt) 2012-10-16 01:50:18 PDT
(In reply to Adrien CLERC from comment #7)
> I go from 8fps in the stable version to 3fps with the nightly and OMTC
> enabled.

(In reply to Adrien CLERC from comment #8)
> Created attachment 671744 [details]

Unfortunately this demo uses ridiculously huge images (640x7760) that are not directly supported on older hardware and therefore not accelerated. 

(In reply to Benoit Girard (:BenWa) from comment #6)
> Yes that's because to the content/main thread we're drawing the page using
> software.

For GPUs that can handle textures of this size, X11 basic layers are GPU accelerated.
Comment 10 vulcain 2013-05-20 06:49:44 PDT
Created attachment 751677 [details]
glxinfo after an update to ppa Mesa 9.2

Test with Firefox Nightly 24.0a1 (2013-05-19) and Mesa 9.2.0 (git-639d0f7 precise-oibaf-ppa)
Result:  7 fps
Comment 11 J. Gatellier 2013-06-11 05:48:47 PDT
For me the test is fast with OMTC when skiagl is also in use.

with parameters:
layers.offmainthreadcomposition.enabled;true
gfx.canvas.azure.backends;skia
gfx.canvas.azure.accelerated;true

FF24.0a1 no omtc, cairo 9fps
FF24.0a1 no omtc, skia 6fps
FF24.0a1 no omtc, skiagl 8fps
FF24.0a1 omtc, cairo 6fps
FF24.0a1 omtc, skia 6fps
FF24.0a1 omtc, skiagl 48fps
Comment 12 vulcain 2013-09-24 14:32:24 PDT
After an udpate to Linux 3.8 and Mesa 9.1.4 
60 + FPS with Firefox 24: 
Description de la carte	Intel Open Source Technology Center -- Mesa DRI Intel(R) Ironlake Mobile
Fenêtres avec accélération graphique	0/1 Basic
ID du périphérique	Mesa DRI Intel(R) Ironlake Mobile
ID du vendeur	Intel Open Source Technology Center
Rendu WebGL	Intel Open Source Technology Center -- Mesa DRI Intel(R) Ironlake Mobile
Version du pilote	2.1 Mesa 9.1.4
windowLayerManagerRemote	false
AzureCanvasBackend	cairo
AzureContentBackend	none
AzureFallbackCanvasBackend	none

22 FPS with Firefox Nightly 27.0
Description de la carte	Intel Open Source Technology Center -- Mesa DRI Intel(R) Ironlake Mobile
Fenêtres avec accélération graphique	1/1 OpenGL
ID du périphérique	Mesa DRI Intel(R) Ironlake Mobile
ID du vendeur	Intel Open Source Technology Center
Rendu WebGL	Intel Open Source Technology Center -- Mesa DRI Intel(R) Ironlake Mobile
Version du pilote	2.1 Mesa 9.1.4
windowLayerManagerRemote	false
AzureCanvasBackend	cairo
AzureContentBackend	none
AzureFallbackCanvasBackend	none
AzureSkiaAccelerated	0
layers.offmainthreadcomposition.enabled => false

It's better
Comment 13 Chris Peterson [:cpeterson] 2014-04-11 16:00:16 PDT
Mass tracking-e10s flag change. Filter bugmail on "2be0fcce-e36a-4e2c-aa80-0e3d33eb5406".
Comment 14 bull500 2014-09-22 04:02:55 PDT
With layers.acceleration.force-enabled - enabled
around 17 fps

With layers.acceleration.force-enabled - disable 
60+fps

Card - Nvidia GT-525M, Optimus Enabled(Bumblebee), Fedora 20 ,Firefox: 35.0a1 (2014-09-21)
Comment 15 sheepdestroyer 2014-12-13 03:09:26 PST
With layers.acceleration.force-enabled - enabled
around 24 fps

With layers.acceleration.force-enabled - disable 
60+fps

Intel HD3000(SandyBridge), Fedora 21, Mesa 10.5.0-devel, Firefox 37.0a1 (2014-12-12)
Comment 16 Dmitry Gutov 2015-10-26 16:04:24 PDT
With layers.acceleration.force-enabled true: ~37 fps
With false: 60+ (or so the web page says)

Cairo backend, Intel HD Graphics 4000, Ubuntu 15.10, Driver Version 3.0 Mesa 11.0.2, Firefox 43.0a2 20151026004023
Comment 17 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2015-10-27 09:58:35 PDT
(In reply to Dmitry Gutov from comment #16)
> With layers.acceleration.force-enabled true: ~37 fps
> With false: 60+ (or so the web page says)
> 
> Cairo backend, Intel HD Graphics 4000, Ubuntu 15.10, Driver Version 3.0 Mesa
> 11.0.2, Firefox 43.0a2 20151026004023

I have a Lenovo x230 which closely matches this configuration. Could you please tell me if this is Ubuntu 32-bit or 64-bit so I can test this more accurately?
Comment 18 Dmitry Gutov 2015-10-27 10:08:58 PDT
(In reply to Anthony Hughes, QA Mentor (:ashughes) from comment #17)

> Could you
> please tell me if this is Ubuntu 32-bit or 64-bit so I can test this more
> accurately?

It's 64-bit. The CPU is i7 3630QM. And, if that matters anything, the above results were obtained with my usual Firefox profile (not a bare one).
Comment 19 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2015-10-27 10:40:03 PDT
(In reply to Dmitry Gutov from comment #18)
> (In reply to Anthony Hughes, QA Mentor (:ashughes) from comment #17)
> the above results were obtained with my usual Firefox profile (not a bare one).

So you cannot reproduce this in a new profile then? If so, testing this on my laptop might be pointless. Could you attach a copy of your about:support page to this bug report?
Comment 20 Dmitry Gutov 2015-10-27 10:46:39 PDT
(In reply to Anthony Hughes, QA Mentor (:ashughes) from comment #19)

> So you cannot reproduce this in a new profile then?

I didn't say that. Tried it in a new profile now, and got exactly the same results.

Let me know if you need my about:support output.
Comment 21 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2015-10-27 11:52:32 PDT
(In reply to Dmitry Gutov from comment #20)
> Tried it in a new profile now, and got exactly the same results.

Okay thanks, that's good to know.
 
> Let me know if you need my about:support output.

Yes, please do.
Comment 22 Dmitry Gutov 2015-10-27 12:40:40 PDT
Created attachment 8679608 [details]
about:support in JSON

(In reply to Anthony Hughes, QA Mentor (:ashughes) from comment #21)

Here you go.
Comment 23 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2015-10-27 13:43:56 PDT
Here is my system info:
* Ubuntu 15.10 64-bit
* OpenGL 3.0 Mesa 11.0.2
* Cairo backend
* Intel Core i7-3520M CPU @ 2.90GHz x4

Here are my results:
> Firefox 41.0.2: 60+ fps [OMTC ON] vs 60+ fps [OMTC OFF]
> Firefox 42.0b9: 60+ fps [OMTC ON] vs 60+ fps [OMTC OFF]
> Firefox 43.0a2: 60+ fps [OMTC ON] vs 60+ fps [OMTC OFF] (e10s ON)
>                 60+ fps [OMTC ON] vs 60+ fps [OMTC OFF] (e10s OFF)
> Firefox 44.0a1: 55  fps [OMTC ON] vs 49  fps [OMTC OFF] (e10s ON)
>                 60+ fps [OMTC ON] vs 60+ fps [OMTC OFF] (e10s OFF) 

The only situation where I saw degraded performance was Firefox 44.0a1 with e10s enabled and turning OMTC off actually degraded performance further in this scenario. Even still the degraded performance was still within an acceptable range. I would say that my system probably is not able to reproduce this bug as described although I'm not sure what the differentiating factor is. I suppose the fact that this is a brand new Ubuntu installation could have something to do with it but I really do not know.
Comment 24 Dmitry Gutov 2015-10-27 14:34:52 PDT
(In reply to Anthony Hughes, QA Mentor (:ashughes) from comment #23)

> 60+ fps [OMTC ON] vs 60+ fps [OMTC OFF]

I'm not sure we're talking about the same thing. As I understand it, layers.acceleration.force-enabled, which I and some previous commenters experimented with, switches between Basic OMTC and GL-accelerated OMTC. 

Maybe a better title for this bug would be "[OMTC Linux] Slower with hardware acceleration enabled".

> I would say that my system probably is not able to
> reproduce this bug as described although I'm not sure what the
> differentiating factor is. I suppose the fact that this is a brand new
> Ubuntu installation could have something to do with it but I really do not
> know.

Indeed, my system is fairly old, and has survived several distro upgrades. Will you post your glxinfo output? I'm posting mine.
Comment 25 Dmitry Gutov 2015-10-27 14:37:42 PDT
Created attachment 8679691 [details]
glxinfo where OMTC is slower with OpenGL than without
Comment 26 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2015-10-27 15:52:14 PDT
(In reply to Dmitry Gutov from comment #24)
> I'm not sure we're talking about the same thing. As I understand it,
> layers.acceleration.force-enabled, which I and some previous commenters
> experimented with, switches between Basic OMTC and GL-accelerated OMTC. 

layers.acceleration.force-enabled is false by default. Turning it on the FPS on Nightly drops further to 43 FPS so it seems like that is also a factor.

> Will you post your glxinfo output? I'm posting mine.

I did a diff between your glxinfo and mine, they are identical except for some of the more technical bits which I don't understand. https://pastebin.mozilla.org/?diff=8850696 (yours is the +, mine is the -).
Comment 27 Dmitry Gutov 2015-10-27 16:11:59 PDT
(In reply to Anthony Hughes, QA Mentor (:ashughes) from comment #26)

> layers.acceleration.force-enabled is false by default. Turning it on the FPS on Nightly drops further to 43 FPS so it seems like that is also a factor.

Good, then our systems are in agreement. It's the *only* factor in my case. Like described in my first comment, I get 60+ with it off (default), and 37 or so with it on.

Disabling OMTC itself doesn't seem to work, by the way: even if I set layers.offmainthreadcomposition.enabled to false, "GPU Accelerated Windows" in about:support still says "0/1 Basic (OMTC)". And I get the same 60+ FPS in the test.

> I did a diff between your glxinfo and mine, they are identical except for
> some of the more technical bits which I don't understand.
> https://pastebin.mozilla.org/?diff=8850696 (yours is the +, mine is the -).

Thanks. The difference is too technical for me as well.
Comment 28 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2015-10-28 10:13:49 PDT
[Tracking Requested - why for this release]:

Did some further testing with layers.acceleration.force-enabled set to true:
> Firefox 17: 60 fps
> Firefox 18: 20 fps
> Firefox 19: 21 fps
> Firefox 41: 39 fps
> Firefox 44: 43 fps

Based on these results it would appear that we regressed performance starting in Firefox 18 and while performance has nearly doubled since then we're still about 30% off. I'll see if I can regress this further but it's going to be extremely difficult given this is 3 years old.
Comment 29 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2015-10-28 11:44:44 PDT
Last Good: Firefox 18.0a1 2012-09-05 [6705e131aeaa]
First Bad: Firefox 18.0a1 2012-09-06 [0c4fa25f637b]
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6705e131aeaa&tochange=0c4fa25f637b
Comment 30 Ernst Sjostrand 2015-10-29 02:27:17 PDT
So I guess it's:
Anthony Jones — Bug 773460 - Change the default canvas over to Azure; r=nrc 

There's also
Marco Castelluccio — Bug 788042 - Use MOZ_X11 instead of MOZ_WIDGET_GTK2 under gfx/layers. r=karlt
Comment 31 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2015-10-29 10:43:39 PDT
(In reply to Ernst Sjostrand from comment #30)
> So I guess it's:
> Anthony Jones — Bug 773460 - Change the default canvas over to Azure; r=nrc 
> 
> There's also
> Marco Castelluccio — Bug 788042 - Use MOZ_X11 instead of MOZ_WIDGET_GTK2
> under gfx/layers. r=karlt

Anthony and Marco, could you please have a look at this bug?
Comment 32 Ernst Sjostrand 2015-11-01 07:49:03 PST
With:
gfx.xrender.enabled	false
layers.acceleration.force-enabled	true
gfx.canvas.azure.accelerated	true
gfx.canvas.azure.backends	skia
gfx.content.azure.accelerated	true
gfx.content.azure.backends	skia

I get 60+ at 4K resolution with Mesa graphics.
Comment 33 Dmitry Gutov 2015-11-01 08:22:55 PST
(In reply to Ernst Sjostrand from comment #32)

Seeing similar results here (but I don't use a 4K resolution).

Changing the backends to skia gives me 44 FPS. Adding the *.azure.accelerated properties (they're not there by default) brings it up to 59 (tested these settings two times).

gfx.xrender.enabled, on or off, doesn't make any visible difference.

Note that this is still slower than with layers.acceleration.force-enabled false, according to the benchmark. In that case I get consistent 60+ FPS.
Comment 34 Marco Castelluccio [:marco] 2015-11-02 08:49:36 PST
I think bug 773460 is more likely to have caused a perf regression, but I admit I don't remember what was the purpose behind bug 788042 (I should have written something in its first comment!).
Comment 35 Erdem U. Altinyurt 2015-11-03 18:13:48 PST
Using HWACCEL test at top + my setup x86_64 ARCH Linux + Radeon 6850HD using OpenSource Drivers on 1080p screen

Firefox Nightly v45a1

Azure*Backends=Cairo + CairoUseXRender=1  -> 60+ FPS
Azure*Backends=Cairo + CairoUseXRender=0  -> 11 FPS
Azure*Backends=Cairo + CairoUseXRender=1 + E10 MultiProcessing ->7 FPS
Azure*Backends=Cairo + CairoUseXRender=0 + E10 MultiProcessing -> 11 FPS
Azure*Backends=Cairo + CairoUseXRender=1 + Layers Force Acceleration -> 6 FPS

Azure*Backends=Skia + AzureSkiaAccelerated=0 -> 13 FPS
Azure*Backends=Skia + AzureSkiaAccelerated=1 -> 13 FPS
Azure*Backends=Skia + AzureSkiaAccelerated=1 + Layers Force Acceleration -> 12 FPS
Azure*Backends=Skia + AzureSkiaAccelerated=1 + Layers Force Acceleration + E10 MultiProcessing -> 16 FPS

So only cairo + xrender give me proper 60+ result.
Comment 36 Anthony Jones (:kentuckyfriedtakahe, :k17e) 2015-11-08 14:02:53 PST
(In reply to Erdem U. Altinyurt from comment #35)
> So only cairo + xrender give me proper 60+ result.

Isn't that the default?
Comment 37 Erdem U. Altinyurt 2015-11-08 16:51:24 PST
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #36)
> (In reply to Erdem U. Altinyurt from comment #35)
> > So only cairo + xrender give me proper 60+ result.
> 
> Isn't that the default?
Depends,
A.F.A.I.K. since E10 is activated by default.
Azure*Backends=Cairo + CairoUseXRender=1 + E10 MultiProcessing ->7 FPS
Comment 38 Dmitry Gutov 2015-11-08 17:05:56 PST
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #36)

> Isn't that the default?

Isn't the point of this bug to discuss why the default is what it is, and how that can be improved? I.e. no HW acceleration for layers in Linux.
Comment 39 Ritu Kothari (:ritu) 2015-11-12 11:44:30 PST
41 was EOL'd last week. This is now a wontfix for FF41.
Comment 40 Anthony Jones (:kentuckyfriedtakahe, :k17e) 2015-11-30 21:38:41 PST
(In reply to Dmitry Gutov from comment #38)
> (In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #36)
> 
> > Isn't that the default?
> 
> Isn't the point of this bug to discuss why the default is what it is, and
> how that can be improved? I.e. no HW acceleration for layers in Linux.

Just checking that nothing is broken. IIUC resolving this bug depends on bug 627699.

Note You need to log in before you can comment on or make changes to this bug.