Mouse pointer corrupt after sleep

Hi, I’m a relative noob to Linux, though I’ve messed with it a few times over the last few decades, it’s only now that I am actually trying to make it my primary operating system. So I have some experience, but not a lot. At first I tried Mint but when I couldn’t get SteamPlay working right on it, I looked into an alternative, and settled upon Garuda Dr460nized Gaming. That works pretty well; the only thing I haven’t yet gotten sorted out is Battle.net games, but that’s a separate topic for another day if I can’t figure that one out.

Anyway, the issue that brings me here today is the behavior of my mouse cursor after the PC resumes from sleep mode. It is garbled and corrupted. It still works, it changes the pointer based on context in the little square that it needs, but it has a huge (256x256, I’d guess) “flag” of partially-transparent (mostly not) white/red garbage trailing to the right and bottom. It gets in the way of tooltips (and everything else) being visible and is highly annoying. I think logging out and back in might fix it though I’m not sure and I’m not going to try that at this moment while I’m trying to post. Certainly a reboot fixes everything, but that’s not a solution.

I’m amendable to disabling or limiting sleep modes for the GPU in order to fix this issue; I just don’t know how. I’ve looked through the settings and didn’t see anything that looked like it would help.

Something that the garuda-inxi did not mention that I think I should, is the fact that my GTX 1050 is a bit of an odd duck; it has 4GB of VRAM (like a 1050Ti) instead of the usual 2GB. I don’t know if that could cause an issue with memory being cleared or whatever.

System:
Kernel: 6.8.7-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
clocksource: tsc avail: hpet,acpi_pm
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=823c0f2f-a027-4365-bde5-08ba70813ea9 rw rootflags=subvol=@
quiet loglevel=3 ibt=off
Desktop: KDE Plasma v: 6.0.4 tk: Qt v: N/A info: frameworks v: 6.1.0
wm: kwin_x11 with: krunner vt: 2 dm: SDDM Distro: Garuda base: Arch Linux
Machine:
Type: Desktop System: Dell product: OptiPlex 3020 v: 00
serial: <superuser required> Chassis: type: 15 serial: <superuser required>
Mobo: Dell model: 0WMJ54 v: A01 serial: <superuser required> part-nu: 0612
uuid: <superuser required> UEFI: Dell v: A20 date: 05/27/2019
CPU:
Info: model: Intel Core i5-4590 bits: 64 type: MCP arch: Haswell gen: core 4
level: v3 note: check built: 2013-15 process: Intel 22nm family: 6
model-id: 0x3C (60) stepping: 3 microcode: 0x28
Topology: cpus: 1x cores: 4 smt: <unsupported> cache: L1: 256 KiB
desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB L3: 6 MiB
desc: 1x6 MiB
Speed (MHz): avg: 3293 min/max: 800/3700 scaling: driver: intel_cpufreq
governor: performance cores: 1: 3293 2: 3293 3: 3293 4: 3293 bogomips: 26340
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities: <filter>
Graphics:
Device-1: NVIDIA GP107 [GeForce GTX 1050] driver: nvidia v: 550.76
alternate: nouveau,nvidia_drm non-free: 545.xx+ status: current (as of
2024-04; EOL~2026-12-xx) arch: Pascal code: GP10x process: TSMC 16nm
built: 2016-2021 pcie: gen: 2 speed: 5 GT/s lanes: 16 ports: active: none
off: HDMI-A-1 empty: DP-1,DVI-D-1 bus-ID: 01:00.0 chip-ID: 10de:1c81
class-ID: 0300
Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 23.2.6
compositor: kwin_x11 driver: X: loaded: nvidia unloaded: modesetting
alternate: fbdev,nouveau,nv,vesa gpu: nvidia,nvidia-nvswitch
display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 90 s-size: 542x301mm (21.34x11.85")
s-diag: 620mm (24.41")
Monitor-1: HDMI-A-1 mapped: HDMI-0 note: disabled model: Acer XF251Q
serial: <filter> built: 2019 res: 1920x1080 hz: 60 dpi: 90 gamma: 1.2
size: 544x303mm (21.42x11.93") diag: 623mm (24.5") ratio: 16:9 modes:
max: 1920x1080 min: 640x480
API: EGL v: 1.5 hw: drv: nvidia platforms: device: 0 drv: nvidia device: 2
drv: swrast gbm: drv: nvidia surfaceless: drv: nvidia x11: drv: nvidia
inactive: wayland,device-1
API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 550.76
glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
memory: 3.91 GiB
API: Vulkan v: 1.3.279 layers: 11 device: 0 type: discrete-gpu
name: NVIDIA GeForce GTX 1050 driver: nvidia v: 550.76 device-ID: 10de:1c81
surfaces: xcb,xlib
Audio:
Device-1: Intel 8 Series/C220 Series High Definition Audio vendor: Dell
driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20
class-ID: 0403
Device-2: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel
v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 16 bus-ID: 01:00.1
chip-ID: 10de:0fb9 class-ID: 0403
API: ALSA v: k6.8.7-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: N/A
Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
Server-2: PipeWire v: 1.0.5 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
vendor: Dell driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
port: c000 bus-ID: 04:00.0 chip-ID: 10ec:8168 class-ID: 0200
IF: enp4s0 state: down mac: <filter>
Device-2: Edimax EW-7822ULC 802.11ac Wireless Adapter [Realtek RTL8812AU]
driver: rtw_8822bu type: USB rev: 2.1 speed: 480 Mb/s lanes: 1 mode: 2.0
bus-ID: 3-5:2 chip-ID: 7392:b822 class-ID: 0000 serial: <filter>
IF: wlp0s20u5 state: up mac: <filter>
Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant
Drives:
Local Storage: total: 4.79 TiB used: 4.32 TiB (90.3%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/sda maj-min: 8:0 vendor: KLEVV model: NEO N610 SSD 1TB
size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 7D scheme: MBR
ID-2: /dev/sdb maj-min: 8:16 vendor: Seagate model: ST4000DM005-2DP166
size: 3.64 TiB block-size: physical: 4096 B logical: 512 B speed: 3.0 Gb/s
tech: HDD rpm: 5980 serial: <filter> fw-rev: 0001 scheme: GPT
ID-3: /dev/sdc maj-min: 8:32 vendor: TeamGroup model: T-FORCE 240GB
size: 223.57 GiB block-size: physical: 512 B logical: 512 B type: USB
rev: 3.1 spd: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 tech: SSD serial: <filter>
scheme: GPT
Partition:
ID-1: / raw-size: 30 GiB size: 30 GiB (100.00%) used: 19.83 GiB (66.1%)
fs: btrfs dev: /dev/sdc4 maj-min: 8:36
ID-2: /boot/efi raw-size: 513 MiB size: 512 MiB (99.80%)
used: 584 KiB (0.1%) fs: vfat dev: /dev/sdc2 maj-min: 8:34
ID-3: /home raw-size: 193.07 GiB size: 189.85 GiB (98.34%)
used: 143.79 GiB (75.7%) fs: ext4 dev: /dev/sdc3 maj-min: 8:35
ID-4: /var/log raw-size: 30 GiB size: 30 GiB (100.00%)
used: 19.83 GiB (66.1%) fs: btrfs dev: /dev/sdc4 maj-min: 8:36
ID-5: /var/tmp raw-size: 30 GiB size: 30 GiB (100.00%)
used: 19.83 GiB (66.1%) fs: btrfs dev: /dev/sdc4 maj-min: 8:36
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: zram size: 15.57 GiB used: 1.18 GiB (7.6%)
priority: 100 comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 4
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 51.0 C mobo: N/A gpu: nvidia temp: 45 C
Fan Speeds (rpm): N/A gpu: nvidia fan: 20%
Info:
Memory: total: 16 GiB available: 15.57 GiB used: 6.48 GiB (41.6%)
Processes: 313 Power: uptime: 21h 59m states: freeze,mem,disk
suspend: deep avail: s2idle wakeups: 1 hibernate: platform avail: shutdown,
reboot, suspend, test_resume image: 6.19 GiB services: org_kde_powerdevil,
power-profiles-daemon, upowerd Init: systemd v: 255 default: graphical
tool: systemctl
Packages: 2092 pm: pacman pkgs: 2081 libs: 563 tools: octopi,paru
pm: flatpak pkgs: 11 Compilers: clang: 17.0.6 gcc: 13.2.1 Shell: garuda-inxi
default: fish v: 3.7.1 running-in: konsole inxi: 3.3.34
Garuda (2.6.26-1):
System install date:     2024-04-22
Last full system update: 2024-04-25
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut nvidia-dkms
Windows dual boot:       No/Undetected
Failed units:

Try env

export WLR_NO_HARDWARE_CURSORS=1

also

sudo cp /etc/default/grub /etc/default/grub.bak && sudo sed '/^GRUB_CMDLINE_LINUX_DEFAULT=/s/"$/ nvidia-drm.modeset=1 "/g' -i /etc/default/grub && sudo update-grub

Firstly, welcome to the Garuda community @aleax804.

The easeast thing you might want to try is testing out alternate cursors, along with alternate cursor size settings.

Bit of a longshot, but no one ever considers hardware as a potential factor in cases like these. Test another mouse just in case there is something strange about your model in use. If using a wireless mouse test a wired USB version. If you have a PS/2 mouse it is definitely a good idea to test one of these old but reliable devices. This will eliminate any possibility that the USB bus is part of your issue.

Another thing you might want to try is removing as many USB devices as possible before putting your computer to sleep. Often USB devices can cause strange problems when resuming from sleep. While you’re at it, be sure to check all USB cables for damage especially if you have pets that like to chew on things.

Be sure to try changing your C state setting in your bios if multiple options are available to you.

You should also check your journal logs for entries immediately before and after entering sleep. There is a chance you might spot something in your logs that might offer a clue about what could possibly be causing this.

As usual, testing alternate kernels is also a good troubleshooting step even if it seems unlikely to be a cause.

Good luck, and welcome to the Garuda forum.

Try setting up " Preserve video memory after suspend" as described here: NVIDIA/Tips and tricks - ArchWiki

You can add a kernel module parameter by creating a config in etc/modprobe.d/ with an editor, for example with Micro:

sudo micro /etc/modprobe.d/nvidia-preserve-memory.conf

Paste in the options for the kernel module parameter:

options nvidia NVreg_PreserveVideoMemoryAllocations=1

Save and exit out of the file. Then rebuild the initramfs.

sudo dracut-rebuild

Finally, enable the services mentioned in the article.

sudo systemctl enable --now nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service
1 Like

Nice post. I actually thought it might help me, so I tried what you said and (of course) something went wrong. Great.

Super, now my initramfs is borked and it won’t simply boot. Well, not initially. With prodding, perhaps. It will boot, and I eventually get into X, but I have to get it to load the kernel which it’s screwing up trying to do, and rebuilding the initramfs says it’s working but clearly it’s not. And enabling the nvidia-suspend.service makes it so it goes into suspend, never to be awakened again. This is FRUSTRATING. I see why people complain about Linux and the command line. I’m about to just simply disable any form of power saving whatsoever at the nearest GUI buttons I can find. This is a desktop, and saving power is not of the utmost concern. It’s nice, but it’s not a laptop, so fuggit.

I understand your frustration, but saving electricity is never nonsense.
It’s normal for things to go possibly wrong when you propose solutions. Especially if the person helping you doesn’t have the problem themselves.
This has nothing to do with the command line itself.
A previously created backup is often unnecessary but very helpfull in such cases.

Delete the modprobe config or move it to a backup, then regenerate the initramfs again.

sudo mv /etc/modprobe.d/nvidia-preserve-memory.conf /etc/modprobe.d/nvidia-preserve-memory.conf_backup
sudo dracut-rebuild

If this restores your normal boot behavior, then most likely there is some issue with the modprobe file.

Try switching to the s2idle suspend mode. It is less energy efficient since it is a relatively shallow suspend state, but like you mentioned that is more of an issue for folks running a laptop off the battery.

You can switch to using s2idle suspend by adding the mem_sleep_default=s2idle kernel parameter to /etc/default/grub and regenerate the Grub configuration file, or just add it on the kernel parameters line in Garuda Boot Options and click Apply:

1 Like

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