high cpu usage from systemd-udev, tracker and modprobe after 21.10 upgrade
I see high cpu usage after upgrading to 21.10
top
indicates that tracker
, systemd-udev
and modprobe
are running continuously
I also see mouse problems. I my mouse moves jerkily and I get spurious clicks while I "mouseover" a control.
running udevadm monitor
produces the following output, suggesting an nvidia problem (I have nvidia-470)
KERNEL[204.407566] add /bus/pci/drivers/nvidia-nvswitch (drivers)
UDEV [204.408283] add /bus/pci/drivers/nvidia-nvswitch (drivers)
KERNEL[204.555200] add /bus/pci/drivers/nvidia (drivers)
KERNEL[204.555217] remove /bus/pci/drivers/nvidia (drivers)
KERNEL[204.555419] remove /bus/pci/drivers/nvidia-nvswitch (drivers)
UDEV [204.556010] remove /bus/pci/drivers/nvidia-nvswitch (drivers)
My workaround is to stop and restart with
sudo systemctl restart systemd-udevd systemd-udevd-kernel.socket systemd-udevd-control.socket
(reference https://unix.stackexchange.com/questions/233247/why-is-systemd-udev-pegging-my-cpu)
This fixes the problems, but does not seem to be a general fix. In particular, logging out and logging in again causes the problem to restart.
Running nvidia-smi
gives an error:
NVIDIA-SMI has failed because it couldn't communicate with the
NVIDIA driver. Make sure that the latest NVIDIA driver is
installed and running.
I usually run Ubuntu-gnome on xorg, but get the same with vanilla ubuntu wayland.
I recall having that problem before. I did that same upgrade (with a mistake) and I had that problem 10 times worse. (See Half-Rendered update window) I had to reinstall, but it still had terrible performance. I turned up my gpu memory and that made it better- not perfect, but better. Here's how.
Fist go open a terminal window and enter sudo nano /boot/firmware/config.txt
. Then, scroll down until you see a lie that starts with gpu_mem
like so:
Raise your curent number, that is printed there, about 50. As in if mine is 280, I raise it to 330. That sould stop the lock-up part. If that fails, you can try overclocking a bit. (I do not recommend overclocking if your computer is already very powerful; make sure your cooling system is sufficient.) Research how high your cpu can be turned to and raise it to the desired frequency like so.
In that same file, config.txt, there MAY BE another line that starts with cpu_freq
like this
My cpu is running at 2 ghz, but yours may run higher or lower depending on the pc model. (If the line that starts with cpu_freq
does not exist, feel free to make it anywhere in the file you want; it will toggle the frequency.) There is one more line that must be discussed. This line starts with over_voltage
like this.
For every 800 to 900 mhz that you raise the cpu frequency, you will need to raise this line 1 number. This line also probably does not exist. If so, you will need to make it. Do it just like the cpu_freq
line. Push ctrl + x to exit. Then push y to save changes. (WARNING turning the over voltage too high or turning the cpu_freq too high may damage your computer, Make sure you look up the overclock specs for your pc model before doing any of that. If your processor is not overclockable, do not even try this.)
There may be other parameters that may need to be toggled depending on the pc model; they may need to be adjusted as well.