Open Bug 1238309 Opened 8 years ago Updated 2 months ago

canvas radial gradient slow

Categories

(Core :: Graphics, defect, P3)

44 Branch
defect

Tracking

()

People

(Reporter: mahks1, Unassigned)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(9 files)

Attached file slow_canvas.html
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20160105164030

Steps to reproduce:

Draw radial gradient to canvas 





Actual results:

See test case :
Nightly 46.0a1 draws 100 in 1.12 seconds
Beta 44.0b7   draws 100 in 1.36 seconds
43.0.4  draws 100 in 0.01 seconds


Expected results:

Newer versions should not be slower
Keywords: regression
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
I get 0.003s on both Firefox 43 and Nightly 46, on Windows 7.
You should post your about:support from both versions.
Attached file about:config 43 data
Attached file about:config 46 data
Attached file about:config 43 text
Attached file about:config 46 text
Yeah it looks you completely lost hardware acceleration on the way from Firefox 43 to 46, probably because we blocklisted your graphics driver due to some bug in it. The important lines here are the "GPU Accelerated Windows" one and the "AzureCanvasBackend" one.
Can you update your graphics driver and see whether that fixes it?
Seems it has the latest driver, tried several "newer" versions but windows thought it had latest.
Does the ever "confirmed:true" from Yang (above) mean he did see the problem?
(In reply to Mahks from comment #7)
> Seems it has the latest driver, tried several "newer" versions but windows
> thought it had latest.

You should download the latest version from http://support.amd.com/en-us/kb-articles/Pages/ATI-Radeon-3000-Series-Drivers.aspx
Don't trust the Windows Update to update your drivers.
Sorry, it is affected by gfx.direct2d.disabled for me.
Status: NEW → UNCONFIRMED
Component: Untriaged → Graphics
Ever confirmed: false
Keywords: regression
Thanks for that driver site, new driver installed, no change to issue.
Installed nightly on a second computer, 

nightly 100 @ 2.42 seconds
FF 43 100 @ .004 seconds
Yeah, even with the new driver, Firefox is blocking your GPU. It means the developers saw that your GPU was crashing a lot (probably). If that's not true in your case, you can force-enable it to bring back the speed.
Set "gfx.direct2d.force-enabled" to "true" on about:config
Thanks Mahks.

Milan, do you know what blacklisting changes between 43 and 46 caused this?

Adapter Description: ATI Mobility Radeon HD 3400 Series
Adapter Drivers: aticfx32 aticfx32 atiumdag atidxx32 atiumdva
Adapter RAM: 256
Asynchronous Pan/Zoom: none
ClearType Parameters: Gamma: 2200 Pixel Structure: R ClearType Level: 100 Enhanced Contrast: 50
Device ID: 0x95c4
DirectWrite Enabled: false (6.1.7600.16385)
Driver Date: 4-24-2013
Driver Version: 8.970.100.0
GPU #2 Active: false
GPU Accelerated Windows: 0/1 Basic (OMTC)
Subsys ID: 01381025
Supports Hardware H264 Decoding: No; Hardware video decoding disabled or blacklisted
Vendor ID: 0x1002
Flags: needinfo?(milan)
Blocks: 1238554
What happens if you set environment variable MOZ_DISABLE_CRASH_GUARD and re-run?
Set environment variable MOZ_DISABLE_CRASH_GUARD=1 : 100 times = 1.44765 seconds
Set gfx.direct2d.force-enabled=true : 100 times = 1.41958 seconds

Both in 46.0a1
On 2nd computer running Win 7 64bit : 100 times = 2.27 seconds
So, it isn't the crash guard that's blocking this configuration; spoofing the same setup doesn't block, so I'm at a bit of a loss.  David, can you put together a try (debug) build that logs the reason for blocking a configuration and we can see if Mahks wouldn't mind running with it and sending us the log?
Flags: needinfo?(milan) → needinfo?(dvander)
Mahks, could you go to about:telemetry, and paste the lines starting with "gfx." under the "Environment Data" -> "System" group?
Flags: needinfo?(dvander) → needinfo?(mahks1)
Flags: needinfo?(mahks1)
Noticed that in about:telemetry = gfx.D2DEnabled false
Yet in about:config = gfx.direct2d.force-enabled;true
It looks like two things went wrong. First, "d3d11.textureSharing" is true but "d2d.status" is "failed". This means we either failed to initialize DirectWrite (unlikely) or failed to create a D3D11 device for D2D (much more likely).

From there it's not clear why you don't have D3D11 acceleration, but since one D3D11 call already failed, it's likely that something in the compositor failed to initialize so it fell back to software.

I'll do an instrumented build soon to see if those theories are true.
I should have sain that the firefox.exe that it installed was quarantined.
No errors I could identify in about:support

With the second build with the console, I see some warnings in the console, do not seem to be graphics related, can not find a way to pipe that console to a file.
Anything I can do about this?
You haven't been able to run the instrumented build from comment 25?
Yes, the results for the first link are in the attachment in comment 28.

For the second link in comment 25, I was unable to find a way to save the output from the console.
I'll get another build here soon, it sounds like the compositor is failing to initialize but not at any of the places I would expect.
Assignee: nobody → dvander
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Whiteboard: [gfx-noted]
Now that FF45 is the production version, this problem becomes more of an issue.

What I don't understand is why the problem is not being noticed by more users/developers.
The video card is in wide use.

Or is it that canvas is not used that much? 
I found a canvas bug in Chrome that totally defeated a method of canvas, but it took near a year for there to be sufficient response from developers before they fixed it.

I would be very disappointed if I had to start using Chrome to get around this one.
(Chrome clocks 100 in .02 seconds)

Why does chrome not have an issue with the video card?
Mahks, could you try the latest nightly Firefox and let us know what is the value for about:support graphics under Features->Compositing, in particular, if it now shows Direct3D 9 instead.
Flags: needinfo?(mahks1)
Compositing : Direct3D 11
WebGL Renderer	Google Inc. -- ANGLE (ATI Mobility Radeon HD 3400 Series Direct3D9Ex vs_3_0 ps_3_0)
Hardware H264 Decoding	No; Hardware video decoding disabled or blacklisted
DirectWrite	false (6.1.7600.16385)
Flags: needinfo?(mahks1)
That's interesting - you have the acceleration back, since compositing shows D3D11, although it's perhaps interesting that the D3D11 ANGLE is not on.  Are you still seeing the same kind of a slowdown as reported in comment 0?
In  48.0a1 still took about a second for the 100 count. about 10% improvement, 
but still 100 X slower than FF 43.

Compositing	Direct3D 11
Asynchronous Pan/Zoom	wheel input enabled; touch input enabled
WebGL Renderer	Google Inc. -- ANGLE (ATI Mobility Radeon HD 3400 Series Direct3D11 vs_4_1 ps_4_1)
Hardware H264 Decoding	No; Hardware video decoding disabled or blacklisted
DirectWrite	false (6.1.7600.16385)

GPU #1
Active	Yes
Description	ATI Mobility Radeon HD 3400 Series
Vendor ID	0x1002
Device ID	0x95c4
Driver Version	8.970.100.0
Driver Date	4-24-2013
Drivers	aticfx32 aticfx32 atiumdag atidxx32 atiumdva
Subsys ID	01381025
RAM	256
Diagnostics
ClearType Parameters	Gamma: 2200 Pixel Structure: R ClearType Level: 100 Enhanced Contrast: 50
AzureCanvasAccelerated	0
AzureCanvasBackend	skia
AzureContentBackend	cairo
AzureFallbackCanvasBackend	cairo
ClearType Parameters	Gamma: 2200 Pixel Structure: R ClearType Level: 100 Enhanced Contrast: 50
Decision Log
DIRECT2D	
unavailable by runtime: Failed to acquire a Direct2D 1.1 factory
Almost like we can't find a function we need in d2d1.dll.

Mahks, can you find d2d1.dll in C:\Windows\System32 and in Properties->Details read off the File/Product version?  Alternatively, if you have entries in about:crashes, send a link to a top few.
It looks like a few things could cause this:
 - D2D1CreateFactory is missing in d2d1.dll
 - D2D1CreateFactory returned null or an error code
 - The factory did not QI to ID2D1Factory1 (meaning, it's D2D 1.0 or something)

We could narrow this down further by passing an error message up to gfxConfig
I'm guessing we don't have the d2d1.dll, and that this is a Direct2D 1.0, but not 1.1 capable system (e.g., Windows 7 without the platform update.)  We stopped allowing D2D 1.0 with 44, and when that hits a system that only has 1.0 and not 1.1, they would lose the acceleration.
Now have d2d1.dll Version 6.1.7601.17514 Dated 2010.11.20

Is this the correct version? or still 1.0

If not, Do you know which platform update has the correct one? I cannot find any references...

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: dvander → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: