Cursor flickering/jerks when changing states

Since the very same day I installed Manjaro KDE on a Ryzen/Nvidia desktop PC last year, my mouse cursor would randomly and sporadically flicker (i.e. nudge a few pixels out of place and realign itself) every time its state changes. For example, if I hover a link on Firefox, the normal cursor to a pointer would change but in a motion that looks like it flicks on its own.

This appears to be most noticable in pages with links appear close to each other, such as a list of GitHub issues or even posts in this forum, on any web browser, especially Firefox. This flickering also affects virtually any program I use, even ones that use Qt (initially thinking GTK apps are more likely to cause the unwanted flickering), are bundled with the Plasma desktop environment, or running under Wine.

But in the last few days, this effect has become more consistent everywhere. And now, it has gone to the point where using a mouse is basically unusable. I think I kept getting the effect a lot more often after the proprietary Nvidia driver was upgraded to 460.56.

I thought I was alone dealing with it the whole time, but it turns out this same annoyance was already reported in the old Manjaro forums at least twice and more recently on the KDE subreddit, but it frustrates me that no effective solution can be found in any of the posts.

The closest bug tickets I can find in the KDE bug tracker related to my experience are 398273 – Unwanted cursor frames during hovering over links and 431084 – Cursor flickers when hovering text in Chromium/Falkon. The former was closed in the past month with the reason being a “NVIDIA-related graphical corruption.” Again, I was unable to find any useful solution or workaround in those and similar tickets.

I also took a slow motion video of the flickering effect with my phone earlier today, as all of the videos I’ve seen with the posts above were shot in normal speed:

I’ve tried and done many workarounds I could think of and that are mentioned in the above linked posts, including:

  • Turning on Force (Full) Composition Pipeline in Nvidia X Server Settings
  • Toggling that same setting off and back on, after which the flickering effect resumes within a minute or two
  • Adding Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On}" under Section "Screen" to /etc/X11/mhwd.d/nvidia.conf
  • Turning off or restarting the compositor or KWin itself
  • Using a different cursor theme — KDE Classic causes the least flickering with most states including the link pointer, but it is ugly and doesn’t fit well to my desktop theme

Also, out of curiosity, I tried using my system with KWin killed using pkill -KILL kwin on the terminal, and the same flickering effect still occurs, so it turns out it’s not KDE to blame.

Other costly workarounds I can think of, but would like to avoid, are:

  • Upgrading my CPU to a newer Ryzen CPU with integrated graphics, ditching Nvidia entirely
  • Replacing Manjaro KDE with another edition (such as XFCE) while keeping my Nvidia GPU

There are a few notes to consider with my setup/use case:

  • I only use one monitor, and most of the search results I get are irrelevant to my issue because they involve dual/multi-monitor setups.
  • Since Plasma 5.21 was released (and with it kwin-lowlatency was removed from my system), I ran into stuttering and stability issues with the compositor turned on, so I had to turn it off and leave it that way.
  • Using Wayland is not an option for me, given that Nvidia’s proprietary drivers run poorly on it and Plasma is still unusable in some use cases under Wayland. But either way, I doubt that this same flickering effect won’t be reproducible there.
  • Running Manjaro with the nouveau driver is a possibility, but it doesn’t support power management, fan control, and video acceleration for my GTX 1060 6GB GPU.

I’m completely stuck having to constantly deal with seeing the cursor flicker every time I use a mouse, but I hope that my above analysis helps anyone who is having this same exact problem. Does anyone here have ran into this annoyance or are experiencing it right now, or have solutions/workarounds?

TL;DR: I keep seeing the mouse cursor flicking when it changes states since the day Manjaro was installed, and it has gotten worse and more consistent recently. I’m stuck on how to work around or get rid of it.

Here is my inxi output
System:    Kernel: 5.10.23-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 root=UUID=0428519d-a16b-4103-bdda-c83d853f7601 rw idle=nomwait 
           processor.max_cstate=5 rcu_nocbs=0-11 nvidia_drm.modeset=1 spectre_v2=off mds=off nowatchdog fbcon=scrollback:1024k 
           sysrq_always_enabled=1 apparmor=1 security=apparmor udev.log_priority=3 
           Desktop: KDE Plasma 5.21.3 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM Distro: Manjaro Linux base: Arch Linux 
Machine:   Type: Desktop Mobo: ASRock model: X370 Killer SLI/ac serial: <filter> UEFI: American Megatrends v: P5.10 
           date: 12/17/2018 
CPU:       Info: 6-Core model: AMD Ryzen 5 1600 bits: 64 type: MT MCP arch: Zen family: 17 (23) model-id: 1 stepping: 1 
           microcode: 8001137 cache: L2: 3 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 76684 
           Speed: 2794 MHz min/max: 1550/2800 MHz boost: enabled Core speeds (MHz): 1: 2794 2: 2788 3: 2795 4: 2789 5: 2793 
           6: 2788 7: 2799 8: 2788 9: 2795 10: 2795 11: 2794 12: 2783 
           Vulnerabilities: Type: itlb_multihit status: Not affected 
           Type: l1tf status: Not affected 
           Type: mds status: Not affected 
           Type: meltdown status: Not affected 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 status: Vulnerable, IBPB: disabled, STIBP: disabled 
           Type: srbds status: Not affected 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: NVIDIA GP106 [GeForce GTX 1060 6GB] vendor: eVga.com. driver: nvidia v: 460.56 
           alternate: nouveau,nvidia_drm bus-ID: 26:00.0 chip-ID: 10de:1c03 class-ID: 0300 
           Display: x11 server: X.Org 1.20.10 compositor: kwin_x11 driver: loaded: nvidia display-ID: :0 screens: 1 
           Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") s-diag: 582mm (22.9") 
           Monitor-1: HDMI-0 res: 1920x1080 hz: 60 dpi: 93 size: 527x296mm (20.7x11.7") diag: 604mm (23.8") 
           OpenGL: renderer: GeForce GTX 1060 6GB/PCIe/SSE2 v: 4.6.0 NVIDIA 460.56 direct render: Yes 
Audio:     Device-1: NVIDIA GP106 High Definition Audio vendor: eVga.com. driver: N/A alternate: snd_hda_intel bus-ID: 26:00.1 
           chip-ID: 10de:10f1 class-ID: 0403 
           Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: ASRock driver: snd_hda_intel v: kernel 
           bus-ID: 28:00.3 chip-ID: 1022:1457 class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.23-1-MANJARO running: yes
           Sound Server-2: JACK v: 0.125.0 running: no
           Sound Server-3: PulseAudio v: 14.2 running: yes
           Sound Server-4: PipeWire v: 0.3.23 running: yes
Network:   Device-1: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi v: kernel bus-ID: 1e:00.0
           chip-ID: 8086:24fb class-ID: 0280
           IF: wlp30s0 state: up mac: <filter>
           Device-2: Intel I211 Gigabit Network vendor: ASRock driver: igb v: kernel port: f000 bus-ID: 1f:00.0
           chip-ID: 8086:1539 class-ID: 0200
           IF: enp31s0 state: down mac: <filter>
Drives:    Local Storage: total: 1.14 TiB used: 635.02 GiB (54.5%)
           SMART Message: Unable to run smartctl. Root privileges required.
           ID-1: /dev/sda maj-min: 8:0 vendor: Crucial model: CT250MX500SSD1 size: 232.89 GiB block-size: physical: 512 B
           logical: 512 B speed: 6.0 Gb/s rotation: SSD serial: <filter> rev: 023 scheme: GPT
           ID-2: /dev/sdb maj-min: 8:16 vendor: Seagate model: ST1000DM010-2EP102 size: 931.51 GiB block-size:
           physical: 4096 B logical: 512 B speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> rev: CC43 scheme: MBR
Partition: ID-1: / raw-size: 64 GiB size: 62.75 GiB (98.04%) used: 50.79 GiB (80.9%) fs: ext4 dev: /dev/sda5 maj-min: 8:5
           ID-2: /boot/efi raw-size: 99 MiB size: 95 MiB (95.96%) used: 26.4 MiB (27.8%) fs: vfat dev: /dev/sda2 maj-min: 8:2
Swap:      Kernel: swappiness: 1 (default 60) cache-pressure: 75 (default 100)
           ID-1: swap-1 type: file size: 1024 MiB used: 0 KiB (0.0%) priority: -2 file: /swapfile
Sensors:   System Temperatures: cpu: 34.5 C mobo: 29.0 C gpu: nvidia temp: 37 C
           Fan Speeds (RPM): fan-1: 0 fan-2: 2125 fan-3: 0 fan-4: 1310 fan-5: 1032 gpu: nvidia fan: 0%
           Power: 12v: N/A 5v: N/A 3.3v: 3.38 vbat: 3.26
Info:      Processes: 344 Uptime: 6h 22m wakeups: 0 Memory: 15.63 GiB used: 3.97 GiB (25.4%) Init: systemd v: 247
           tool: systemctl Compilers: gcc: 10.2.0 clang: 11.1.0 Packages: 1776 pacman: 1764 lib: 461 flatpak: 12 Shell: Zsh
           v: 5.8 running-in: yakuake inxi: 3.3.03

Does it happen with a less cartoony cursor theme ?

Turning off the compositor in KDE Plasma is not a solution. Have you tried this kwin.sh tweak ?

1 Like

Yes — every single cursor theme I have installed (Breeze, Oxygen, Adwaita, etc.) exhibit flickering at state change, with some producing more noticeable/worse flicker than others.

The cursor theme I used in the video is Material Cursors Light. It looks cartoony because black outlines are used for better contrast. It’s the only cursor theme I have manually installed.

I forgot to mention about kwin.sh in my initial post, but in fact I’ve already done that a long time ago. None of the options seem to get rid of the cursor flickering effect. Again, I already mentioned the nvidia.conf part above exactly like in the post you shared.

By the way, I see you’re the same guy who helped me with a related issue in the old forums (it was about desktop and cursor stuttering with Aurorae window decorations on the same exact system if you don’t recall), so hello again and kindly please don’t suggest me other solutions mentioned in that post.

I didn’t recall … but it seems was not much help back then either.

I will not do that :slight_smile:

Just one question remaining: Does this happen also on live media with the latest ISO ?

Yes. The same cursor flickering bug occurs in the latest (21.0 Ornara) ISO image out of the box. I tested all three official editions (KDE, XFCE, and Gnome) as well as both proprietary and nouveau drivers in each of them. I made no changes to appearance settings during testing.

On nouveau, the effect appears to be more sporadic than with the proprietary drivers, i.e., the flickering effect stops for a while and continues. In some instances of changing states under the open-source driver, the cursor image would tear like a monitor with no v-sync.

I took slow motion videos for all three editions and drivers in each edition. I can upload them if you’d like to see them.

In conclusion, either Nvidia or X11 are likely candidates for what’s causing the annoying bug, as it’s easily reproducible across DEs and different window managers. As such, please feel free to move my topic to the appropriate subcategory.

Big update: I swapped my GTX 1060 with a friend’s Radeon RX 570 about two months ago (because he wants better gaming performance on Windows), and I’m now using the built-in open source AMDGPU Mesa driver. Unfortunately, the cursor flickering effect persisted, which makes me think this is actually a problem with X11, although using an Nvidia card might have made the effect worse.

I’ll update back after turning on the SWcursor setting on xorg.conf and testing on the three Manjaro ISOs I have.

On the upside, I can finally use the KWin compositor as I know that KWin works best with Mesa drivers. Outside of the rare glitches when opening a new Firefox window, I haven’t had KWin crash since getting the AMD card so far.

Same issue here, both on a laptop with a discrete Nvidia card and on a laptop with an integrated intel card