New RX 9070 XT causes drunk mouse cursor? Might be PCIe 5 problem?

Hello!

I need help from some sort of wizard I think. My computer feels cursed.

I upgraded from an RX 6600 to an RX 9070 XT and now my mouse occasionally slows down and speeds up. I noticed my push-to-talk on my keyboard seems to be affected too while it’s acting up. I won’t hear the Discord “bloop” noise confirming that the push-to-talk key is pressed until after the drunkenness subsides. It usually lasts a few seconds and goes away, but sometimes it lingers for minutes at a time.

My system is a Ryzen 5 7600X + RX 9070 XT on a Gigabyte B650 EAGLE AX AM5 motherboard. I’m running Gentoo on X11 with the 6.17.7-gentoo-dist Kernel and Mesa 25.2.6. According to the Gentoo wiki 6.15 and Mesa 25.1 are recommended for the RDNA 4 cards, so my software should be up to date enough.

Now for my PCIe hypothesis.

My B650 Eagle AX motherboard says it “supports PCIe 4.0 X16 mode” on the top slot. Notably not PCIe gen 5.

When I check with lspci it appears that my GPU is running at PCIe 5.0 speeds:

LnkCap: Port 0, Speed 32GT/s, Width x16, ASPM L1, Exit Latency L1 <1us
        ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
LnkSta: Speed 32GT/s, Width x16
        TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

In my bios (which I updated yesterday to the latest version: f36d) I changed every PCIe port I could find from Gen 5 to Gen 4 and in the System Info section in the bios it says the top slot is Gen 5 x16 running at Gen 4 x16.

Despite changing that setting in my bios and rebooting (even shutting down and disconnecting power and then booting again) lspci still reports that the link states is still 32GT/s, which in theory my motherboard doesn’t support.

I’ve contacted Amazon and they’re sending me a new GPU, but I can’t help but think that the drunkenness is caused by my motherboard and/or linux not respecting my PCIe 4 speed setting.

Does anybody have any ideas what’s going on here? ;-;

Do you have PCIe AER related errors on dmesg? I believe that setpci command can be used runtime to change things like link speed so you can cap the card at PCIe 4 assuming it is really running at PCIe 5 speeds, but no idea on parameters.

UPDATE!

So it appears that lspci was lying to me. I also found a tool called inxi (inxi -Gxx) which also lied to me.

I installed amdgpu_top and ran it and lo and behold, it WAS running at PCIe Gen 4 speeds. Perfect.

I also noticed though that the GPU was running at like 5MHz when the lag was happening. I set /sys/class/drm/card0/device/power_dpm_force_performance_level to high and the problem went away!

I guess mesa is a little too aggressive to throttle down or something? Odd. Luckily it’s cold in my room so the extra power draw and heat doesn’t bother me a whole lot.

2 Likes

Writing this down so that I don’t forget how I fixed this. If anyone knows a better fix or, better yet, who to talk to to get this bug fixed upstream, please let me know!

Created a new systemd service (a Gentoo user with systemd? Crazy, I know):

[Unit]
Description=Set GPU power performance level to high to prevent lag.
After=graphical.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo 'high' > /sys/class/drm/card0/device/power_dpm_force_performance_level"
User=root
RemainAfterExit=yes
ConditionPathExists=/sys/class/drm/card0/device/power_dpm_force_performance_level

[Install]
WantedBy=graphical.target

Added some kernel parameters to my /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="quiet amdgpu.dpm=1 amdgpu.pcie_gen_cap=0x80000 amdgpu.ppfeaturemask=0xfff7ffff"

pcie_gen_cap forces PCIe gen 4 (probably not necessary)
ppfeaturemask allows fiddling with sysfs GPU stuff. See the configuration section of the AMDGPU Gentoo Wiki
dpm is on by default I believe but I set it explicitly just in case. It’s required for the service to do it’s thing.
quiet because if you put tape over the dash lights in your car they don’t exist. :slight_smile:

Then I do the normal sudo grub-mkconfig -o $GRUB_CFG and reboot into a more sober GUI experience!

Hope this helps somebody. It’ll at least help me if this isn’t solved by the time I reinstall gentoo.

1 Like