Open Bug 1654231 Opened 4 years ago Updated 3 years ago

Nvidia powerstates causing stuttering in web browser

Categories

(Core :: Graphics: WebRender, defect, P3)

78 Branch
x86_64
Windows 10
defect

Tracking

()

Tracking Status
firefox-esr78 --- disabled
firefox79 --- wontfix
firefox80 --- fix-optional
firefox81 --- affected

People

(Reporter: djfluidz07, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

  • Installed an NVIDIA graphics card, into two different systems, either a 2080ti or GT710 (only one card in each system), installed Windows 10 1909, clean install.
  • Installed Firefox, no other applications.
  • Set Firefox to Adaptive in NVIDIA control panel (which is default)
  • Opened Firefox
  • Ensured that smooth scrolling is enabled
  • Opened a webpage with text or text/images, or even the about:config page
  • Waited for the NVIDIA GPU clocks to settle and idle
  • Scrolled the page in Firefox using the scroll wheel, or keyboard arrows
  • Observed, the GPU spiked to 1350mhz/1750mhz, and the GPU Time spiked to 1.0ms+, causing Firefox to stutter

Actual results:

When I scrolled after a period of activity..
The NVIDIA card boosted to low level 3d clock speeds..
The GPU time spiked higher than normal..
This broke smooth scrolling and the page stuttered

Expected results:

  • GPU settles to power saving clocks
  • Scrolling the page after a period of activity
  • No Gpu Time spikes
  • No stuttering

This issue does not occur if I set Firefox to prefer maximum performance in NVCP. Also this issue does not occur If I use intel onboard graphics.
It only happens when im using an NVIDIA graphics card, I tested two NVIDIA cards, in two different systems, and was able to reproduce the issue.

I have uploaded a playlist to Youtube. Please view these four videos for more detail :
https://www.youtube.com/playlist?list=PLTgrTWERDYktOR-JvPinqtrBpEM_3aQDh

Firefox does not need to have additional load for this issue to happen. I have reinstalled windows, tested Windows 10 1809, 1909 and 2004, tested two different systems. I have tested at least 5 Nvidia drivers too, to no avail.

I am able to reproduce the issue in Chrome as well, but only when I enable smooth scrolling and there is additional load on the GPU, such as having OBS studio open in then background.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Graphics
Product: Firefox → Core

Can you attach your about:support for us to see? Related code has changed recently, so I wonder if you also see this on Firefox Nightly?

Flags: needinfo?(djfluidz07)

(In reply to Jeff Gilbert [:jgilbert] from comment #2)

Can you attach your about:support for us to see? Related code has changed recently, so I wonder if you also see this on Firefox Nightly?

Hi, sorry for the delay, I've no had much chance to use my pc.

I have been testing with Firefox nightly 81.0a1 today. It seems that the clocks spiking to low level 3d isn't happening near as much, and doesn't happen when scrolling pages with just plain text. Which is a good thing.

However the clocks will sometimes spike, causing a small stutter, when scrolling a page with images/video (for example reddit homepage).

Anyway, it seems way better so far, I have even compared Firefox 78.0.1 and the nightly side by side, switching back and forth and nightly seems much more stable. I have only been testing for an hour and will be testing some more. I'll update the thread soon.

"Can you attach your about:support for us to see? Related code has changed recently, so I wonder if you also see this on Firefox Nightly?"

How do i attach? copy and paste?

Thanks

Flags: needinfo?(djfluidz07)

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

For more information, please visit auto_nag documentation.

Flags: needinfo?(ktaeleman)

(In reply to djfluidz07 from comment #3)

(In reply to Jeff Gilbert [:jgilbert] from comment #2)

Can you attach your about:support for us to see? Related code has changed recently, so I wonder if you also see this on Firefox Nightly?

Hi, sorry for the delay, I've no had much chance to use my pc.

I have been testing with Firefox nightly 81.0a1 today. It seems that the clocks spiking to low level 3d isn't happening near as much, and doesn't happen when scrolling pages with just plain text. Which is a good thing.

However the clocks will sometimes spike, causing a small stutter, when scrolling a page with images/video (for example reddit homepage).

Anyway, it seems way better so far, I have even compared Firefox 78.0.1 and the nightly side by side, switching back and forth and nightly seems much more stable. I have only been testing for an hour and will be testing some more. I'll update the thread soon.

Well that's good to hear at least!

"Can you attach your about:support for us to see? Related code has changed recently, so I wonder if you also see this on Firefox Nightly?"

How do i attach? copy and paste?
"Copy raw data to clipboard" is better, but even copy and paste should work for now!

Flags: needinfo?(djfluidz07)
Blocks: wr-perf
Severity: -- → S3
Component: Graphics → Graphics: WebRender
Flags: needinfo?(ktaeleman)
Keywords: perf
Priority: -- → P3
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64

(In reply to Jeff Gilbert [:jgilbert] from comment #6)

(In reply to djfluidz07 from comment #3)

(In reply to Jeff Gilbert [:jgilbert] from comment #2)

Can you attach your about:support for us to see? Related code has changed recently, so I wonder if you also see this on Firefox Nightly?

Hi, sorry for the delay, I've no had much chance to use my pc.

I have been testing with Firefox nightly 81.0a1 today. It seems that the clocks spiking to low level 3d isn't happening near as much, and doesn't happen when scrolling pages with just plain text. Which is a good thing.

However the clocks will sometimes spike, causing a small stutter, when scrolling a page with images/video (for example reddit homepage).

Anyway, it seems way better so far, I have even compared Firefox 78.0.1 and the nightly side by side, switching back and forth and nightly seems much more stable. I have only been testing for an hour and will be testing some more. I'll update the thread soon.

Well that's good to hear at least!

"Can you attach your about:support for us to see? Related code has changed recently, so I wonder if you also see this on Firefox Nightly?"

How do i attach? copy and paste?
"Copy raw data to clipboard" is better, but even copy and paste should work for now!

Hi,

As this issue happens with and without webrender enabled (depending on refresh rate), I copied the raw data for both scenarios.

Firefox 79.0, 144hz, Direct3D 11 (Advanced Layers) - https://pastebin.com/xZCWX0XR
Firefox 79.0, 60hz, Webrender enabled - https://pastebin.com/ArPhuJxL

Thanks.

Flags: needinfo?(djfluidz07)

Oops, I just realised that I originally posted the issue for Firefox 78.0.1 and shared the about:support for 79.0 (Firefox auto updated). I need to check that its still an issue with 79.0. I'll get back to you today.

Hi,

Oddly enough, after some more testing I found I am able to reproduce the clockspeed spiking in Nightly 81.0a1 when OBS studio is open in the background, with Display Capture added as a source, Obs is not recording/streaming.

When I remove Display Capture as a source in Obs, the clockspeeds when scrolling stays low and doesn't seem to spike at all.

What confuses me, when I previously tested 78.0.1, the clockspeeds would spike when scrolling, with/without webrender enabled, without any apps open in the background, only Firefox open. It seems that Obs is putting some strain on the gpu which in turn causes Firefox to trigger the spiking.

https://www.youtube.com/watch?v=qyHEQzqKID8

I need to do more testing.

Here's the about:support for the nightly that was used in the video above.

https://pastebin.com/ygkKPY0T

Blocks: wr-gpu-time
No longer blocks: wr-perf

The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true
You need to log in before you can comment on or make changes to this bug.