Xorg: High CPU Usage (94%) on Moving Mouse (Ubuntu 18.04)

5,982

You could try changing the mouse polling rate parameter on the usbhid Kernel module. You can modify its value on the fly by running as super user

echo "4" > /sys/module/usbhid/parameters/mousepoll

This changes the polling rate from the default value 0 (i.e. "unlimited") to 4 ms (or 250 Hz).

Note: Afterwards you will have to replug your mouse in order to see any effect.

Provided that helps, you could make this change permanent by appending the parameter to the line GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub like so

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbhid.mousepoll=4"                                                                                                      

Then run

update-grub 

and

reboot 
Share:
5,982

Related videos on Youtube

Zephyr
Author by

Zephyr

Updated on September 18, 2022

Comments

  • Zephyr
    Zephyr over 1 year

    whenever I move my mouse enough it causes high cpu usage. Screenshot provided is on a fresh X session.

    Xorg Taking up a lot of CPU

    This also causes some frequent freeze ups if I'm running some other programs e.g gaming.

    [1075299.085] (II) event4  - Corsair Corsair Vengeance M90 Mouse: SYN_DROPPED event - some input events have been lost.
    [1077813.434] (II) event4  - Corsair Corsair Vengeance M90 Mouse: SYN_DROPPED event - some input events have been lost.
    [1077814.079] (II) event4  - Corsair Corsair Vengeance M90 Mouse: SYN_DROPPED event - some input events have been lost.
    [1077814.246] (II) event4  - Corsair Corsair Vengeance M90 Mouse: SYN_DROPPED event - some input events have been lost.
    [1077814.682] (II) event4  - Corsair Corsair Vengeance M90 Mouse: SYN_DROPPED event - some input events have been lost.
    [1077831.975] (EE) client bug: timer event4 debounce: offset negative (-18ms)
    [1077831.975] (II) event4  - Corsair Corsair Vengeance M90 Mouse: SYN_DROPPED event - some input events have been lost.
    [1077831.975] (II) event4  - Corsair Corsair Vengeance M90 Mouse: WARNING: log rate limit exceeded (5 msgs per 30000ms). Discarding future messages.
    [1120008.128] (II) event4  - Corsair Corsair Vengeance M90 Mouse: SYN_DROPPED event - some input events have been lost.
    

    Is there any way for the CPU usage not to be this high?

    EDIT:

    I tried with other mice. The CPU usage appears to increase with the Mouse DPI or to be exact, a generic mouse will cause a CPU usage spike, but not as much as a gaming mouse.

    I also checked if I have hardware acceleration enabled.

    $ glxinfo | grep "direct rendering"
    direct rendering: Yes
    

    EDIT 2:

    CPU is an AMD FX-6350

    GPU is AMD RX Vega 56

    • WinEunuuchs2Unix
      WinEunuuchs2Unix over 5 years
      Try the Ubuntu Unity Desktop instead of the default Gnome Desktop. I've found the performance much better on my Skylake laptop.
    • Zephyr
      Zephyr over 5 years
      I'm using xfce though.
    • WinEunuuchs2Unix
      WinEunuuchs2Unix over 5 years
      Sorry I missed that tag on my tiny phone :(
    • pbhj
      pbhj over 5 years
      As a comparison I have an AMD Kaveri A8-7600 APU and wiggling my mouse side to side adds about 12% to Xorg (up from 0-0.7 to 12-13% CPU). At the same time Firefox goes up to similar, but I can get above 20% if I wiggle it fast! Curious.
  • Jimmy He
    Jimmy He over 5 years
    In my case the high CPU usage stayed the same. I replugged my mouse.