RX 5700 XT and Mouse Cursor Issues

[ Preface ]

So… after upgrading to a 5700 XT from a dead 980Ti I entered the world of AMD GPU woes. I consider myself lucky since with the latest Adrenaline drivers I honestly had very few issues, and I must say even less driver crashes compared to my weekly average on Nvidia (aside from the fact that Nvidia drivers at least recover gracefully, while AMD’s tend to cause hard locks).

I faced an issue where everything using GPU accelerated rendering caused stuttering, and since I’m in the process of developing an OpenGL accelerated tool I had plenty of metrics I could debug.

Long story short, I noticed I was having a frame time loss of about 3ms, and that’s what caused the perceivable stutter in my application. What puzzled me was that it only occurred while I was dragging elements of the UI around.

My frame time is 0.2ms for the application main loop, and it did not make a difference if I completely avoided processing all inputs or not, whether vsync was enabled or not and regardless of the APIs used to render the surface.

All fancy options disabled in the drivers, I started investigating my findings, armed with new keywords to feed into google.

[ Windows (Fix found) ]

After some more research and testing with various other media (including videogames) I had a 100% reproducible way to introduce the issue, by simply waving the mouse cursor over any window that used Vulkan / OpenGL (2.0 to 4.6) / DX (9c to 12).

What I did not expect was ultimately finding out that by disabling Hardware Cursor support in Windows 10 would make my 5700 XT provide silky smooth rendering, similar to what I used to enjoy with the 980Ti.

Such thing is possible by editing the following registry key:

Computer\HKEY_CURRENT_USER\Control Panel\Mouse\MouseTrails

and setting its value to “-1”, which technically tells windows that you don’t want to have mouse trails (same as setting it to “0”), but also has the side effect of leaving Hardware Cursor support disabled, effectively forcing the OS to render the cursor itself instead of using the GPU facilities offered for such purpose.

Lo and behold, waving the cursor around didn’t have any effect whatsoever on applications anymore. I proceeded to submit a bug report to the AMD GPU driver guys and moved on with my life.

[ Linux ]

With the coming of a new wave of Ubuntu LTS derivatives I wanted to check out the status of the Linux desktop in 2020, and I was absolutely impressed by the advances made in desktop compositing, both Gnome and KDE offered an amazingly solid experience out of the box, steady framerates, no tearing, little input lag, and most importantly now my GPU was fully supported out of the box by the linux kernel. Fantastic!

But wait, why is it that all animations are super smooth except when dragging windows around? They stutter constantly, often lagging behind by a significant amount.

Could it be the mouse again?

Changing polling rates and DPIs did not effect any change, neither was trying what worked on windows and forcing a software cursor (Xorg). The problem affected all DEs and compositors (Kwin, Xorg, Wayland).

[ Questions ]

Due to the generic nature of the keywords involved in this topic it’s proven quite a challenge to find discussions around it, and I would like to gather some additional feedback from the community here:

  • Have you experienced anything similar to this?
  • Does disabling Hardware Cursor make a difference for you as well?
  • Do you have any more insight on why only AMD has this issue in the first place? as far as I can tell Hardware Cursor is just a tiny dedicated memory area in the GPU whose only job is rendering the cursor.

Here’s my system hardware specs for reference, I’m at the end of my rope and don’t have hardware permutations that I can try to see if different mice, chipsets, cpus, usb controllers offer different outcomes:

  • Motherboard: Z170 Asus Maximus Gene VIII
  • CPU: Intel i7 6700k
  • OS: Windows 10 64bit (1909)
  • GPU: XFX 5700 XT Thicc III Ultra (they finally fixed all the thermal issues, fantastic product)
  • RAM: 4x8 GB DDR4 3000mhz
  • Mouse: Logitech G502 Proteus

Thanks in advance to anyone who can share some more light on this issue!

Cheers

Follow up on this: the issue is in the drivers core and affects both Windows and Linux, a patch has emerged in the open source drivers, for those interested in the details here’s the link to the issue:

This should resolve the general known issue flagged as “random stuttering” that many people have experienced in some games, which doesn’t seem to affect most FPS games (most FPS engines simply disable the cursor and lock its position, and this might be why the pipeline stalls don’t occur there).

This topic was automatically closed 273 days after the last reply. New replies are no longer allowed.