Nvidia powerstates changing causing stuttering in web browser

Discussion in 'Videocards - NVIDIA GeForce' started by fluidz, Jul 21, 2020.

  1. fluidz

    fluidz Master Guru

    Messages:
    219
    Likes Received:
    14
    GPU:
    Msi trio x 2080ti
    Just wondering if any of you have come across this issue.

    https://www.youtube.com/playlist?list=PLTgrTWERDYktOR-JvPinqtrBpEM_3aQDh

    I have an issue with two NVIDIA cards that I have tested in two very different systems, both 2080ti and GT710. Interestingly, the issue doesn't seem to occur when using intel onboard graphics.

    This issue affects both Firefox and Chrome (with smooth scrolling enabled), however I will be focusing on Firefox in this example as I find using it reproduces the issue more often than Chrome.

    - The issue -

    If I leave Firefox alone for approx 1-3 seconds, giving the GPU enough time to drop to idle clock speed, then scroll the webpage, suddenly the GPU will spike from a low level state to low level 3d state. When this spike occurs, I observed there is a Gpu Time spike of 1ms+, sometimes much higher and the consequence of that spike is the webpage will stutter.

    It only happens when the browser is set to Adaptive/Optimal in NVCP (adaptive is default). Smooth scrolling turned on seems to be a trigger as it uses more GPU resources (smooth scrolling is turned on by defauilt in Firefox).

    - Temporary solution -

    If I set Firefox to Prefer maximum performance in NVCP, the GPU clock speed will be set to low level 3d clock speeds when Firefox is open on screen. As the clockspeed isn't fluctuating with activity, there are no Gpu Time spikes. Therefore Firefox does not stutter when the card boosts. This stops the stuttering but isn't the most ideal solution due to wasted power and extra heat.

    - Visual Example of issue -

    Gpu clock speed spikes to 1350/1750 when scrolling after a period of scrolling inactivity, resulting in a stutter

    [​IMG]

    Gpu time spikes to 1.3ms when scrolling after a period of scrolling activity, resulting in a stutter

    [​IMG]


    Steps to reproduce:

    • I installed an NVIDIA graphics card, into two different systems, 2080ti and GT710 (one card in each system), installed Windows 10 1909, clean install. To compare results.
    • I Installed Firefox on both systems, no other applications.
    • I 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 from a low power save state to low level 3d, and the GPU Time also spiked to 1.0ms+, Firefox stuttered.
    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 result:

    • Scrolling the page after a period of activity should result in no Gpu time spike and no stuttering

    Summary:
    (updated)

    This is an issue if Firefox is set to its default Adaptive power plan in NVCP.
    It also affects optimal power mode.
    This issue does not occur if I set Firefox to prefer maximum performance in NVCP.
    This issue does not occur If I use intel onboard graphics.
    This issue only occurs when Im using an Nvidia graphics card. I tested two NVIDIA cards, in two different systems, with a clean install of Windows 10 1909, and was able to reproduce the issue in both systems. One system was from 2013 and the other built late last year.
    The issue appears worst when using a high refresh rate due to increased scrolling smoothness
    Changing Windows to 2004, 1909, 1809, doesn't help.
    Changing the Nvidia driver doesn't seem to help, even after using DDU
    Switching hardware doesn't help, tested two totally different systems.
    Toggling hardware acceleration on/off in the web browser doesn't help. (When HW is turned off the browser is stuttering all over the place, not just when the clockspeed boosts).
    Switching to Chrome, or a different version of Firefox doesn't help.
    Tested both Nvidia cards, individually, in Msi mode, doesn't help.
    Link state power management turned off, doesn't help.
    CPU power plan set to Ryzen High performance or Windows High performance, doesn't help.
    Tested two different monitors, pb278q and xb271hu, same issue regardless of monitor used.
    Switching from Displayport to HDMI doesn't help.
    The issue happens at both 1440p, 1080p, 144hz, 60hz and 50hz.
    The issue happens in Firefox with or without webrender enabled.
    The issue happens when smooth scrolling is enabled, the issue is not as apparent when ss is disabled.


    Systems tested

    System 1 :

    cpu: i7 4770k, stock clock, no overheating
    motherboard: g1 sniper z87, latest bios, optimized defaults
    ram: Corsair Vengeance Pro 2 x 8gb, dual channel, tested stock & xmp profiles
    psu: Corsair RM850
    graphics: Nvidia Gt710, stock, tested multiple Nvidia drivers inc 451.67
    sound: Creative SoundCore3D
    hard drive: Tested 2 hard drives, one mechanical, other ssd, clean install of windows on each
    monitor: Asus pb278q, tested multiple resolutions/refresh rates, same issue occurs.

    System 2 :

    cpu: ryzen 3700x, stock clock, no overheating
    motherboard : b450 mortar max, latest agesa bios 1.0.0.6, optimized defaults
    ram : Crucial Ballistix sport 2 x 8gb, dual channel, tested stock & xmp profiles
    psu : Corsair RM850x (newer model), tested with individual 12v rails
    graphics: 2080ti, stock, latest bios pre installed, tested multiple Nvidia drivers inc 451.67
    sound: Onboard Realtek audio
    hard drive: Tested 2 hard drives, one mechanical, other ssd, clean install of windows on each
    monitor: Acer xb271hu, tested multiple resolutions/refresh rates, same issue occurs.

    I have been able to reproduce the issue in Chrome, so its not solely a Firefox issue. I used Firefox in this example as after lots of testing I found Firefox is more likely to trigger the clockspeed to boost, even if the webpage is identical. It takes quite a few attempts in Chrome and a little bit longer to reproduce the issue.

    TLDR Sometimes the Nvidia card boosts unnecessarily to low level 3d clocks, it temporarily breaks smooth scrolling in the web browser, causing a stutter.
     
    Last edited: Aug 2, 2020
    K.S. and akbaar like this.
  2. mbk1969

    mbk1969 Ancient Guru

    Messages:
    9,705
    Likes Received:
    6,612
    GPU:
    GF RTX 2070 Super
    Have you tried to set "Adaptive" power mode in global profile (instead of "Prefer performance" in browser`s profile)?
     
    fluidz and akbaar like this.
  3. fluidz

    fluidz Master Guru

    Messages:
    219
    Likes Received:
    14
    GPU:
    Msi trio x 2080ti
    Yes, I tested all power plans. First thing I tried. Thanks for the suggestion.
     
  4. akbaar

    akbaar Master Guru

    Messages:
    314
    Likes Received:
    16
    GPU:
    ASUS 2080 STRIX
    very informative diagnoses ! thank you so much for such a great work
     
    fluidz likes this.

  5. Astyanax

    Astyanax Ancient Guru

    Messages:
    7,756
    Likes Received:
    2,601
    GPU:
    GTX 1080ti
    The drivers profiles already set web browsers to adaptive.

    Intel igp's don't have performance states and system memory always runs at max speed.

    fluidz has already raised this topic on reddit and the nvidia forums, and in talking with @ManuelG about it, I believe the current position was it was working as intended, the browser vendors need to optimize their renderers so as not to hit the GPU % that triggers a clock increase.
     
    fluidz likes this.
  6. Mda400

    Mda400 Master Guru

    Messages:
    840
    Likes Received:
    86
    GPU:
    1660 - 2130/10ghz
    Also with Firefox and if you're using Windows 10, it now uses a graphics rendering engine called WebRender that works more like a game rendering engine (rendering everything in one pass) rather than a traditional web browser engine that renders in layers and objects on-screen individually. - The whole web at maximum FPS: How WebRender gets rid of jank

    It has been used by default since Firefox 67 if using an Nvidia graphics card - Platform/GFX/WebRender Where

    The Mozilla graphics team is constantly observing issues with popular websites and how to improve the performance of Webrender with those sites. They sometimes detail the major changes in this blog - Mozilla Gfx Team Blog
     
    Last edited: Jul 21, 2020
    K.S. likes this.
  7. Astyanax

    Astyanax Ancient Guru

    Messages:
    7,756
    Likes Received:
    2,601
    GPU:
    GTX 1080ti
    Webrender is disabled on high refresh displays at the present time.

    bit funny in the process of getting rid of jank they actually cause it by letting the gpu util spike so much XD
     
    K.S. and Mda400 like this.
  8. Mda400

    Mda400 Master Guru

    Messages:
    840
    Likes Received:
    86
    GPU:
    1660 - 2130/10ghz
    Ah, did not know it was not qualified with high refresh rate displays yet!

    Yeah, I think it was in the mozilla gfx team blog or the article of how "webrender gets rid of jank", but they stated that webrender will be an ongoing process of optimizing how different graphics architectures are leveraged with webrender behaving like a 'game' engine, which is new for how websites expect their various HTML/CSS content to be drawn.

    This is likely where most of the reduction in stuttering happens, and some of the features they've added like picture caching and using native desktop composition have improved the situation already.
     
  9. alanm

    alanm Ancient Guru

    Messages:
    9,700
    Likes Received:
    1,890
    GPU:
    Asus 2080 Dual OC
    Weird, doesnt happen to me. Same settings as in OP, but idle clocks remain constant, no spiking, no stuttered scrolling.
     
    fluidz likes this.
  10. Astyanax

    Astyanax Ancient Guru

    Messages:
    7,756
    Likes Received:
    2,601
    GPU:
    GTX 1080ti
    some pages are worse than others.
     

  11. haste

    haste Maha Guru

    Messages:
    1,060
    Likes Received:
    294
    GPU:
    GTX 1080 @ 2.1GHz
    There are many other and much more likely issues causing stutter in FF than GPU frequency changes. What is completely missing from this post is specific monitor refresh rate and settings like VRR, HDR, bit depth etc... You state that Intel iGPU is not suffering from stutters. Do you use the same refresh rate, monitor settings and port (HDMI,DP) with NVIDIA GPU and Intel iGPU? Do you have the same HW acceleration level on both GPUs in FF? Have you tried disabling HW acceleration and profile FF without it?
     
  12. Astyanax

    Astyanax Ancient Guru

    Messages:
    7,756
    Likes Received:
    2,601
    GPU:
    GTX 1080ti
    information that has already been addressed elsewhere, and behavior that has been reproduced on other machines, intel is not affected because intel doesn't do p-states the way nvidia does.

    The clock promotion from 2d to 3d hitch has been known since the day nvidia introduced kepler......

    Pointless question.
     
  13. haste

    haste Maha Guru

    Messages:
    1,060
    Likes Received:
    294
    GPU:
    GTX 1080 @ 2.1GHz
    @Astyanax Once again, your posts are full of baseless assumptions, without any background knowledge. But yeah, welcome to the modern Internet.
     
    -Tj- likes this.
  14. Astyanax

    Astyanax Ancient Guru

    Messages:
    7,756
    Likes Received:
    2,601
    GPU:
    GTX 1080ti
    You're adorable, ignorant though. You should actually do something about that so you're not completely advertising your cluelessness.


    The hitch is due to blocking interrupts that get fired.

    1> the PCIE controller (if LSPM is on) increases the clock generator of the pcie controller, and optionally (if implemented) triggers the renegotiation of lanes for controllers that reduce to 1 lane under low util
    2> the gpu's transition from idle states to full performance.

    Both of these cases demonstrate ISR spikes under performance traces.

    Maybe you should pay attention when someone says the OP has posted elsewhere before, since there may just be information you haven't seen, not to mention you just don't understand IO peculiarities enough.

    The only baseless assumptions in this thread are the ones you founded your fundamentally pointless advice on.

    It's blatantly obvious that if you don't use the gpu it doesn't happen.

    PS: open gpu-z
    Start latencymon
    and press the ? button in gpu-z
     
    Last edited: Jul 30, 2020
  15. Dragondale13

    Dragondale13 Maha Guru

    Messages:
    1,455
    Likes Received:
    143
    GPU:
    GTX 1070 AMP! • H75
    I've noticed random spikes and longer down clocking time, as of 446.14 - 451.85 on WIN10 2004, just using windows but doesn't seem to cause any ill effects, it's just weird.
    Older drivers, the spikes are a lot less and down clocking time is a blink to 139mhz, instead of hitting every single power state down.
    It's like watching molasses roll uphill.
     
    fluidz likes this.

  16. fluidz

    fluidz Master Guru

    Messages:
    219
    Likes Received:
    14
    GPU:
    Msi trio x 2080ti
    Interesting.. may/may not be related.

    On my system, clicking the Windows 10 start button can trigger a clock speed change to low level 3d, and latencymon sometimes reports a 800+ nvlddmkm.sys spike. It happens at both 1440p 144hz and 1080p 60hz. Reproduceable.

    Live tiles are turned off in the start menu.

    [​IMG]

    I have seen this 800+ spike happen when scrolling a webpage after a period of inactivity or scrolling through a reddit page full of images/videos. It seems to occur sometimes when the powerstate boosts to low level 3d, although it doesn't do it every time.

    Steps to reproduce :

    - Download Latencymon, install
    - Close all non essential apps
    - Launch Latencymon, click the green arrow (start monitor)
    - Right click the desktop, click refresh (this step isn't always necessary)
    - Click the Windows Start button
    - Observe the Highest reported DPC routine execution time reading for nvlddmkm.sys


    Is anyone else seeing nvlddmkm.sys spikes when clicking the windows start button?

    Animated gif


    [​IMG]

    Youtube video


     
    Last edited: Aug 2, 2020
    Dragondale13 likes this.
  17. fluidz

    fluidz Master Guru

    Messages:
    219
    Likes Received:
    14
    GPU:
    Msi trio x 2080ti
    Its not only a Firefox issue, it happens in Chrome too. Sorry for any confusion. However, in Chrome I have to turn on smooth scrolling for it to be apparent, Firefox has smooth scrolling turned on by default. I found even when browsing the same webpage on both browsers, Firefox has a tendency to push the Nvidia clockspeed higher, causing a spike to low level 3D much more often, that's why I used Firefox as an example (but I did originally mention Chrome being affected at the bottom of the op).

    I should of mentioned the monitor specs. I tested two different monitors, individually, on both systems. An Acer xb271hu and Asus pb278q. Neither are HDR. Bit depth was set to 32bit on both. I tested both monitors using both old and brand new Displayport and Hdmi cables. I also connected each monitor to different ports at the rear of the graphics cards - to rule out a weak connection.

    The Acer xb271hu was tested at both 144hz and 60hz, with and without gsync enabled. Tested both HDMI and Displayport.

    The Asus pb278q was tested at 60hz and 50hz. (No VRR). Tested both HDMI and Displayport.

    Regardless of monitor connected, the same issue was present when using either the gt710 or 2080ti. The gpu clock speed would spike when scrolling a webpage, and there would be a stutter.

    Once I removed the Nvidia card/s from the system, and connected either of the monitors via displayport to the motherboards iGPU (onboard graphics), I made sure I was using the exact same resolution, refresh rate and bitdepth, but there was no stuttering at all when the iGPU was driving the display. Just to be 100% sure, I reconnected each Nvidia card, individually, and even after a clean install of windows 10, and Nvidia driver updates, the spike/stuttering was there.

    [edited]
     
    Last edited: Aug 2, 2020
  18. tsunami231

    tsunami231 Ancient Guru

    Messages:
    10,693
    Likes Received:
    626
    GPU:
    EVGA 1070Ti Black
    this why I not fan of dynamic clocking
     
    Dragondale13 likes this.
  19. Dragondale13

    Dragondale13 Maha Guru

    Messages:
    1,455
    Likes Received:
    143
    GPU:
    GTX 1070 AMP! • H75
    True, but it is what it is.Remember when it was first introduced? LOL! People flipped at first, then Nvidia ironed out the stutters and all was well again in the universe.Those days I had just discovered Guru3D and others, stalking the forums.
     
  20. Astyanax

    Astyanax Ancient Guru

    Messages:
    7,756
    Likes Received:
    2,601
    GPU:
    GTX 1080ti
    The first time you click the start menu, it triggers the start of process (if it isn't already) startmenuexperiencehost.exe, this is hardware accelerated and like a web browser may trigger the gpu to momentarily jump up in clock profiles.

    The process also has a suspend state that will unload most of its hardware handles and create them new on the next time it gets woken up.
     
    fluidz likes this.

Share This Page