Closed Bug 1907828 Opened 1 year ago Closed 1 year ago

accelerated canvas (PDF viewer or Google Sheets) shows wrong content on Linux Nvidia

Categories

(Core :: Graphics: Canvas2D, defect, P2)

Firefox 128
Unspecified
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1924578

People

(Reporter: gmx.sht, Assigned: lsalzman, NeedInfo)

References

Details

Attachments

(3 files)

Attached image Screenshot of the issue

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Steps to reproduce:

I opened a pdf file in a new tab and scrolled up and down a few times.

Actual results:

Sometimes after scrolling I would see the wrong page. For example, when scrolling up to page 1, I saw page 3. Though, the selectable text was correct and didn't match the visuals (this is how I noticed the bug).
Sometimes the pages shown were from pdfs previously open in other tabs.

Expected results:

See the matching page visuals for the page number I'm on.

The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → PDF Viewer

:gmx.sht, could you share the pdf please ?

Flags: needinfo?(gmx.sht)

(In reply to Calixte Denizet (:calixte) from comment #2)

:gmx.sht, could you share the pdf please ?

This seems to happen randomly to all open pdfs.
Here are some of the ones I had open:

The issue seems to persist after clearing cache and restarting Firefox, but it's much harder to cause accidentally now.

Flags: needinfo?(gmx.sht)
Duplicate of this bug: 1908278

Obviously experiencing this too!

I’ve uploaded the PDFs I had issues with on my post but it seems to just be all of them.

Could you try to reproduce your issue in Firefox nightly ?
Or if you can't, could check if it's reproducible in setting gfx.canvas.accelerated to false in about:config ?

Setting gfx.canvas.accelerated to false and refreshing the tab seems to fix it, but setting it back to true and refreshing breaks again on some pdfs.

I used Nightly for several hours yesterday and never observed the bug. I then disabled gfx.canvas.accelerated in my standard install and also did not notice the bug, but my session was shorter with this one (~10 minutes). I will continue using it and report if I observe the bug.

I'm on Wayland (Hyprland compositor) for the record, using an NVIDIA card.

I'm using Wayland (KDE) with NVIDIA too.

Component: PDF Viewer → Graphics: Canvas2D
Product: Firefox → Core
See Also: → 1902012

We'll try to find someone who can reproduce on Linux, get this fixed.

Blocks: gfx-triage
Severity: -- → S2
OS: Unspecified → Linux
Priority: -- → P2
Summary: PDFs show wrong page → PDFs show wrong page on Wayland

I'm using Xorg with Nvidia and observed the same issue. Setting gfx.canvas.accelerated to false resolves it.

See Also: → 1907760

Could you please capture the output of your about:support to a file and attach it here?

Flags: needinfo?(gmx.sht)
Attached file about:support

Here's the about:support output

Flags: needinfo?(gmx.sht)

@lsalzman: Could this be a GL_OOM or other failure to clear or initialize a buffer or texture?

One idea we had in triage: Maybe we should gfxCriticalNote when we encounter an GL error (espectially GL_OUT_OF_MEMORY)?

Flags: needinfo?(lsalzman)

I can't see anything in the support information indicating that's the case, so I don't believe that is the problem at the moment, but I can't say what is actually wrong either based on the information at hand.

Flags: needinfo?(lsalzman)
Summary: PDFs show wrong page on Wayland → PDFs show wrong page on Linux Nvidia with accelerated canvas

:gmx.sht, with gfx.canvas.accelerated enabled and the behavior reproducing, could you please attach the output of your about:memory tab to the report when you can?

Flags: needinfo?(gmx.sht)

I was about to log some weird rendering bugs with hardware acceleration in Google Sheets with an accompanying screen recording, but it appears that this might be the same issue.

Google sheets also uses Canvas rendering, and the issue likewise goes away if I turn set gfx.canvas.accelerated to false.

I was going to report:
The issue only appears with hardware acceleration turned on in the preferences.

Sections of other open google sheets windows sometimes get rendered into the other google sheets windows.

Firefox appears to intermittently render old or out of place "frames" when scrolling or otherwise causing the rendered page to update.
This has the appearance that when you are scrolling in one direction, it appears to "flicker" as though abruptly scrolling to different sections, as far as I can tell this is purely visual, it isn't actually changing where it scrolled to, it is just momentarily rendering the incorrect thing.

It does feel indicative of something not being cleared when it should have been.

Summary: PDFs show wrong page on Linux Nvidia with accelerated canvas → accelerated canvas (PDF viewer or Google Sheets) shows wrong content on Linux Nvidia

Lee, is there any way we can move this forward?

Assignee: nobody → lsalzman
Flags: needinfo?(lsalzman)

We should spin up an OPT build that includes MOZ_GL_DEBUG_ABORT_ON_ERROR and see if we can't get crashing and crash stacks.

Sotaro, my suspicion is this might be some interaction between either Wayland or the Nvidia driver and RemoteTextureMap/compositing. Any ideas?

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

I had only Linux PC with Intel GPU. And I could not reproduce the problem until now.

The patch add logs. And with the STR, CanvasTranslator::PushRemoteTexture() was not called.
Instead, SourceSurfaceCanvasRecording::GetDataSurface() was called sometimes.

readback of DrawTargetWebgl might have a problem with NVIDIA GPUs.

Flags: needinfo?(sotaro.ikeda.g)

Sotaro, can we submit your patch to try and have the OP test that build?

Flags: needinfo?(sotaro.ikeda.g)

In bug 1902012, we disabled hardware acceleration for PDF.js as of Firefox 129. If you use the latest version of Firefox, 129 or later, is this problem still there?

(In reply to Bob Hood [:bhood] from comment #23)

Sotaro, can we submit your patch to try and have the OP test that build?

That patch just adds debugging logging, but doesn't do any semantic changes. So it wouldn't necessarily help the reporter test the issue. I think it would be more instructive right now to see if disabling PDF.js acceleration (which is now the default) helps the situation.

Flags: needinfo?(sotaro.ikeda.g)

I experience quite the same issue in other web application.
For example I use HomeAssisstant and my Dashboard consists of multiple graphs that get refreshed every few seconds. And after some time the content of the graphs is jumping around in a random way. If you hover the mouse of the dashboards it really is going crazy.
You can see how it looks like here: https://www.youtube.com/watch?v=JuTBmFvTFpQ

I run Firefox on Ubuntu 24.04 with proprietary Nvidia drivers (550.107.02) on a RTX 3080 Ti.

After restarting Firefox the issue will not show for quite a time. But after some time it begins to mess up all the canvases again.

Since today I am also using Pterodactyl for running game servers which comes with a virtual terminal that shows you the game servers logs and it uses a canvas too. For me the canvas is always black. Only some times you can see some weird characters here and there.

In Chromium everything is fine. On my other computer with Ubuntu 24.04, Firefox but an AMD iGPU I never had such issues.

So my guess is that the hardware acceleration makes problems here.

Btw. while I was writing this text my HomeAssistant dashboard did not show any issues, I guess because I restarted Firefox shortly before that. I also tried enabling gfx.canvas.accelerated.debug which only showed a green square in the top right corner of nearly every canvas, but not on every one.

I've been having this issue for many months as well - I view a lot of PDFs in Firefox for classwork, and often when scrolling up and down the pages will get flipped around. I'm also seeing it grab pages from PDFs open in other tabs (!).

I'm running Firefox 130.0.1 on Arch Linux (Zen kernel) with NVIDIA 560.35.03 drivers (DKMS), on NVIDIA GeForce GTX 970.

Reporters, and anyone else who can reproduce: in comment 25, Lee noted it would be helpful to determine if disabling PDF.js hardware acceleration resolves this issue for you. Would you please test that by navigating to "about:config" and setting the pdfjs.enableHWA pref to false?

I wonder if we're not setting EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV (from NV_robustness_video_memory_purge) for contexts in some cases?

(deleted: wrong bug)

(In reply to Brad Werth [:bradwerth] from comment #28)

Reporters, and anyone else who can reproduce: in comment 25, Lee noted it would be helpful to determine if disabling PDF.js hardware acceleration resolves this issue for you. Would you please test that by navigating to "about:config" and setting the pdfjs.enableHWA pref to false?

carschandler7, would you try to reproduce after taking the steps in comment 25?

Flags: needinfo?(carschandler7)
See Also: → 1924578

OP, could you please disable widget.dmabuf.enabled in your about:config and see if the behavior persists? This removed the behavior for me in bug 1924578.

No longer blocks: gfx-triage
Keywords: stalled

For reference, these are my results to various troubleshooting options so far (as of firefox 131.0.2).
I did not have a PDF test case so I did not test any PDF specific fixes, my test case was scrolling through google sheets.

Firefox defaults : Bug present
Hardware acceleration toggled off in settings : Bug not apparent
gfx.canvas.accelerated = false : Bug not apparent
widget.dmabuf.enabled = false : Bug not apparent

To me it looks like setting widget.dmabuf.enabled: false fixes ny general canvas issue. But I need to test it for the rest of the day too.

Depends on: 1922688

Looks like widget.dmabuf.enabled: false does not help with that issue.

See Also: → 1924400

(In reply to N. Göddel from comment #35)

Looks like widget.dmabuf.enabled: false does not help with that issue.

Please make sure to restart Firefox after toggling that pref.

See Also: → 1928447
See Also: → 1928167
Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1924578
Resolution: --- → DUPLICATE

(In reply to N. Göddel from comment #35)

Looks like widget.dmabuf.enabled: false does not help with that issue.

Looks like dmabuf was force-enabled in the prefs, so that would override the normal enabled pref... Workaround in bug 1924578 will bypass this.

Since the bug is closed, the stalled keyword is now meaningless.
For more information, please visit BugBot documentation.

Keywords: stalled
Duplicate of this bug: 1910395
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: