Open Bug 1753237 Opened 2 years ago Updated 3 months ago

Firefox has weird visual artifacts when loaded some of the time

Categories

(Core :: Graphics: WebRender, defect)

x86_64
Linux
defect

Tracking

()

People

(Reporter: thecount, Unassigned, NeedInfo)

References

(Blocks 2 open bugs)

Details

(Keywords: correctness)

Attachments

(4 files)

I've tried a few things to try to narrow this down as best I can.

What I know.

When it happens, it looks like the window has no background, and just copies what is behind it, if I move the window around, I see visual artifacts.

It only happens sometimes, but once it happens only closing and reopening the browser can fix it. Once it loads and it is good, it's good until I close it again.

It can happen on the profile select screen too.

If I set gfx.webrender.software or layers.acceleration.disabled to true, or set an env export MOZ_ACCELERATED=0 the issue goes away.

Info about my system.

I primarily use nightly or locally built Firefox's.

I'm using Fedora 34, I have an nvidia gpu, using X11, and Gnome 40.5.

The laptop is a Razer Blade 15 Advanced Model - QHD 240Hz - GeForce RTX 3080

Thanks for the report! Please open about:support, click on "Copy text to clipboard" and paste it here.
Please attach a screenshot of the artifacts.

Blocks: wr-nv-linux
Keywords: correctness
OS: Unspecified → Linux
Hardware: Unspecified → x86_64

It only happens sometimes, but once it happens only closing and reopening the browser can fix it. Once it loads and it is good, it's good until I close it again.

Given that this is on Nvidia, is there a chance that it only happens after a suspend/resume cycle with Firefox open?

Attached file debug info
Attached image firefox-artifacts-2.png
Attached image firefox-artifacts.png
  1. Do you use NVIDIA Prime? If yes, would selecting "Intel (Power Saving Mode)" fix the problem? (bug 1739259)

  2. Can this bug be fixed by starting Nightly with the following environment variable? (bug 1745172)
    $ __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json path/to/firefox

(In reply to Darkspirit from comment #7)

  1. Do you use NVIDIA Prime? If yes, would selecting "Intel (Power Saving Mode)" fix the problem? (bug 1739259)

No I do not believe I am using Nvidia Prime, but I'm not sure if I would I know if I am. I didn't install it, and in nvidia x server settings, I don't see that option. If it's there, it was there by default.

  1. Can this bug be fixed by starting Nightly with the following environment variable? (bug 1745172)
    $ __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json path/to/firefox

No, it doesn't look like setting this env did anything.

The severity field is not set for this bug.
:bhood, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(bhood)

Glenn, have you seen this behavior before?

Severity: -- → S2
Flags: needinfo?(bhood) → needinfo?(gwatson)

Does setting gfx.webrender.max-partial-present-rects to be 0 and then restarting the browser prevent the issue?

Flags: needinfo?(gwatson) → needinfo?(sdowne)

No, it doesn't seem to fix it.

Sorry for the delay.

Flags: needinfo?(sdowne) → needinfo?(gwatson)

Updated this comment a bunch because it initially gave me a a false positive.

Then took a bit to reproduce the error, as is sometimes an issue with intermittent things like this.

Setting gfx.webrender.max-partial-present-rects to 0 does not fix it.

There's a couple of interesting things from your about:support. It was taken when you're running software webrender, but that shouldn't affect the info below:

GPU #1
Active: Yes
Description: Mesa Intel(R) UHD Graphics (TGL GT1)
Vendor ID: 0x8086
Device ID: 0x9a60
Driver Vendor: mesa/iris
Driver Version: 21.1.8.0
RAM: 0
GPU #2
Active: No
Vendor ID: 0x10de
Device ID: 0x24dc
Diagnostics

This tells us:

  • Firefox can see two GPUs in your system.
  • The Intel GPU is what's being used for drawing when acceleration / hw-wr is enabled.
  • We only see a vendor / device ID for the nvidia GPU, there's no description of it (not sure if this is normal for 2nd GPU, but I think it should have a description, maybe it's a device id we don't recognize?).

So, I suspect what we're seeing here is a driver bug (I'm guessing you'd also prefer to be using the nvidia GPU given that you have two displays attached for performance reasons, but that's a separate follow up question).

It sounds like you have the nvidia proprietary driver installed - it's been a while since I used that, but there might be a way in the nvidia settings to configure firefox to run with the nvidia GPU.

I generally use ubuntu-based systems, so I don't know fedora very well. Would it be possible / easy to try updating either the mesa / intel driver or the nvidia driver? A non-destructive way to test this might be to download and test a live version of fedora 35 and see if it reproduces on a live system boot?

Flags: needinfo?(gwatson) → needinfo?(sdowne)

From what friends of mine who have intel+nvidia laptop configurations on Linux have said, nvidia prime offloading is pretty broken, this issue likely affects more than just Firefox but I would be interested to understand the mechanism if there is something we can do about it.

There is fairly extensive documentation for using nvidia prime offloading on Fedora here, Firefox may behave more consistently if you force it to offload or not offload: https://rpmfusion.org/Howto/Optimus#PRIME_Render_Offload

There may also be a "Run with dedicated graphics" option in the Gnome app menu where you can launch Firefox, mentioned by a user on a thread I saw.

Given the multi-process architecture we may be able to add a setting for whether to use the intel or nvidia driver inside Firefox settings, but I am not sure if that's the best solution at hand.

Severity: S2 → S3

NI - I will take another look at this, we need to determine which WM (Gnome 3?) and other details of the environment. I am likely able to repro this on my personal laptop but I'll need to set up Optimus.

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

Attachment

General

Created:
Updated:
Size: