Closed Bug 1620041 Opened 2 years ago Closed 2 years ago

Open Google Sheets spreadsheets intermittently go all-black after hitting a driver reset

Categories

(Core :: Graphics, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: RyanVM, Assigned: sotaro)

References

Details

(Keywords: regression)

Attachments

(4 files)

I've noticed this for awhile now with WebRender but don't have any good STR other than "open a few Google Sheets tabs and wait awhile" :(

Every now and then, Google Sheets gets into a state where the entire content area goes all-black (except for cell focus outlines as shown in the screenshot). When it happens, it affects all Google Sheets tabs open in Firefox. Note that the attached screenshot taken by Firefox' built-in screenshot tool makes it look dark grey rather than black in case that's relevant.

The only way to reset things is to switch to a different sheet in the workbook, which appears to reset the content area. Switching between different Firefox tabs makes no difference.

Attached file about:support info

If it's useful, Google Sheets is a giant <canvas> element (i know, right?).

Can you try running 'DXCap.exe -forcetdr' to see if it reproduced the issue?

Flags: needinfo?(ryanvm)

(In reply to Jeff Muizelaar [:jrmuizel] from comment #3)

Can you try running 'DXCap.exe -forcetdr' to see if it reproduced the issue?

Yes it does!

Flags: needinfo?(ryanvm)

Can you get a regression window or at least see if the problem happens in older versions of Firefox/WebRender off?

Flags: needinfo?(ryanvm)

Jeff, you seem to know what's exactly going on, could you write it down / set the priority for this?

Flags: needinfo?(jmuizelaar)
Flags: needinfo?(jmuizelaar)
Priority: -- → P1
Blocks: wr-75

Hey Rares - would you be able to help get a regression window here?

Flags: needinfo?(rares.doghi)

I can reproduce this in builds going back more than a year.

The most consistent STR I found were to launch Firefox with a gsheets doc (I created https://docs.google.com/spreadsheets/d/1IKvTF0tOnjRGGb8U6CYAKTIl8ShAciC3NKoCYrC7css/edit#gid=0 as a test), then open a new tab so that the gsheet is in a background tab. After that, perform the TDR step from comment 3 and click back over to the gsheet tab. The canvas should be all-black now.

Flags: needinfo?(ryanvm)

Also, it reproduces for me with WebRender force-disabled as well. From what I can see, going back even further, I eventually hit the point where the TDR crashes the content process instead. I'm wondering if this dates back to when we auto-restarted the GPU process after a driver reset or something? Don't recall when exactly that changed.

Summary: Open Google Sheets spreadsheets intermittently go all-black with WebRender enabled → Open Google Sheets spreadsheets intermittently go all-black after hitting a driver reset

FWIW, The canvas of page[1] will be blank after driver reset from about:support.
[1] https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API

Priority: P1 → P3

Hi, I was also able to reproduce this issue using the Trigger Device Reset button from about:support thanks to Alice0775 comment 10, I couldnt find the DXCap.exe file on my computer and starting DXDiag wouldnt do anything.

In any case here is the regression range I got, I tried to narrow it down as much as possible but i got the Not enough data to bisect error, I'm afraid it's not that useful:

First known bad:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=66f496680fae6e7d8f02bc17ff58b9234ee07c70&tochange=e7fee7042d971d73c0e5caafba3b8d15da1bc8ca

Last known Good:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=66f496680fae6e7d8f02bc17ff58b9234ee07c70&tochange=41a66272bd113526fa1e533268ebd5bbf39f7532

Flags: needinfo?(rares.doghi)

STR:

  1. Direct3D 11 (Advanced Layers), Windows10
  2. Open Google Sheets spreadsheets
  3. Open about:support in new tab
  4. Click [Trigger Device Reset] button
  5. Switch tab to the spreadsheets

Actual Results:
The sheet is black.

Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=52b2b0d65a904292c5646494183ede51ab842349&tochange=14fd26761bc4d10c5334abe50d7b6f3a5908f08d

Suspect:
a5a2ae162869490ca8163c6e483a493ecf6c4c22 sotaro — Bug 1410766 - Re-acquireDevices in gpu process when SimulateDeviceReset() is called r=dvander

Component: Graphics: WebRender → Graphics
Flags: needinfo?(sotaro.ikeda.g)
No longer blocks: wr-75

The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.

Priority: P3 → --

I take a look.

Assignee: nobody → sotaro.ikeda.g

(In reply to Alice0775 White from comment #12)

Suspect:
a5a2ae162869490ca8163c6e483a493ecf6c4c22 sotaro — Bug 1410766 - Re-acquireDevices in gpu process when SimulateDeviceReset() is called r=dvander

Bug 1410766 should not be actual regression. Bug 1410766 just made SimulateDeviceReset() more like TDR.

Flags: needinfo?(sotaro.ikeda.g)

Chrome browser also caused a problem of STR in Comment 12 on TDR. But Chrome browser did not cause a problem with Google Sheets spreadsheets on TDR.

:RyanVM, can you still reproduce the problem of spreadsheets with WebRender on latest nightly?

Flags: needinfo?(ryanvm)
Priority: -- → P3
Flags: needinfo?(ryanvm)

When driver reset happens, DrawTargetD2D1 becomes invalid, since ID2D1Device and ID3D11Device become invalid and the are replaced by new ones. Therefore, DrawTargetD2D1 also needs to be replaced. It could mitigate the problem.

But even when DrawTargetD2D1 is re-created, part of problem is not addressed. Since canvas 2d needs to be re-rendered by a content.

Depends on: 1623254

Created Bug 1623254 for Comment 18.

By Bug 1623254, DrawTarget is recreated when it becomes invalid. It addresses majority of Google Sheets spreadsheets problem. But when a web content did not re-render whole canvas, we could still see the problem.

:RyanVM, can you still reproduce the problem of spreadsheets on latest nightly?

Flags: needinfo?(ryanvm)

Still reproducible for me on a build from today's m-c tip.

Flags: needinfo?(ryanvm)

:RyanVM, can you re-upload about:support when the proble happen? Thanks.

Flags: needinfo?(ryanvm)
Attached file updated about:support
Flags: needinfo?(ryanvm)

It seem that D2D does not work well on NVIDIA Quadro P2000, since canvas2d usage caused device reset and "AL_D3D11 abandoned sync". It might be better to disable d2d usage on it.

This reproduces for me on a Lenovo X1 Carbon with Intel 620 Graphics as well, FWIW.

(In reply to Ryan VanderMeulen [:RyanVM] from comment #27)

This reproduces for me on a Lenovo X1 Carbon with Intel 620 Graphics as well, FWIW.

Thanks. Can you attach about:support when the problem happens?

Flags: needinfo?(ryanvm)

:RyanVM, when the problem happened as in comment 24 and comment 27 did you do "DXCap.exe -forcetdr" as in comment 3? If the TDR happen often without "DXCap.exe -forcetdr", we need to blocklist the driver.

For 24, yes. For 27, I didn't have Visual Studio installed on that laptop so I forced the driver reset from about:support instead. Nothing in about:support either. I'll get DXCap on the laptop and try again.

:RyanVM, does comment 30 means that TDR does not happen during using Firefox normally? In this case, we do not need to blocklist driver.

I tested "Trigger Device reset" of about:support with URL of comment 8, it caused the sheet to black. But when I scrolled the sheet, the sheet was re-rendered. It is an effect of Bug 1623254 fix. The sheet was black since, the page did not re-rendered canvas. I commented it in Comment 20.

Current default canvas 2d does not store whole draw commands in gecko. Then a web page needs to re-draw a canvas. But when it seems possible when remote canvas is enabled(pref gfx.canvas.remote=true), since draw commands are recorded and replayed. But current remote canvas did not address the problem.

When remote canvas is enabled(pref gfx.canvas.remote=true), there is a case that canvas is re-stored successfully with "DXCap.exe -forcetdr".

But when "Trigger Device reset" of about:support is used, the sheet always became black and the web page needs to re-draw the canvas.

I haven't personally seen this issue in awhile now. Is there something we wanted to do here still or can we call this WFM?

Flags: needinfo?(ryanvm) → needinfo?(sotaro.ikeda.g)

I think that we could set this bug WFM.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(sotaro.ikeda.g)
Resolution: --- → WORKSFORME
See Also: → 1674147
You need to log in before you can comment on or make changes to this bug.