Xorg:移动鼠标(Ubuntu 18.04)上的CPU使用率很高(94%)


10

每当我移动鼠标足够多时,都会导致CPU使用率过高。提供的屏幕截图在全新的X会话中。

Xorg占用大量CPU

如果我运行其他程序(例如游戏),这也会导致频繁冻结。

[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.

有什么办法可以使CPU使用率不那么高?

编辑:

我尝试了其他老鼠。CPU使用率似乎随鼠标DPI的增加而增加,或者确切地说,通用鼠标将引起CPU使用率的峰值,但不如游戏鼠标那么大。

我还检查了是否启用了硬件加速。

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

编辑2:

CPU是AMD FX-6350

GPU是AMD RX Vega 56


尝试使用Ubuntu Unity Desktop而不是默认的Gnome桌面。我发现Skylake笔记本电脑的性能要好得多。
WinEunuuchs2Unix

我虽然在用xfce。
Zephyr

抱歉,我在我的小电话上错过了这个标签:(
WinEunuuchs2Unix

1
作为比较,我有一个AMD Kaveri A8-7600 APU,并且左右摆动使Xorg的性能提高了约12%(CPU的使用率从0-0.7提高到12-13%)。同时Firefox达到了类似的水平,但是如果快速摆动它,我的效率可以达到20%以上!好奇。
pbhj

Answers:


3

您可以尝试更改usbhid内核模块上的鼠标轮询速率参数。您可以通过以超级用户身份运行来即时修改其值

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

这会将轮询速率从默认值0(即“无限”)更改为4 ms(或250 Hz)。

注意:之后,您必须重新插入鼠标才能看到任何效果。

只要有帮助,您可以像这样将参数附加到行GRUB_CMDLINE_LINUX_DEFAULT中,以使此更改永久生效/etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbhid.mousepoll=4"                                                                                                      

然后跑

update-grub 

reboot 

1
就我而言,高CPU使用率保持不变。我重新插了鼠标。
Jimmy He
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.