How to Diagnose and Fix Freezing For A few Seconds Every Few Minutes

Every few minutes my Ubuntu desktop freezes for a few seconds. I can move my mouse but clicking and the keyboard have no obvious effect.

While this is happening I see the following in my logs:

May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) AIGLX: Suspending AIGLX clients for VT switch
May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) NOUVEAU(0): NVLeaveVT is called.
May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got pause for 13:75
May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got pause for 226:0
May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got pause for 13:69
May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got pause for 13:66
May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got pause for 13:68
May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got pause for 13:67
May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got pause for 13:65
May 11 15:04:07 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got pause for 13:64
May 11 15:04:39 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got resume for 13:75
May 11 15:04:39 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) systemd-logind: got resume for 226:0
May 11 15:04:39 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) AIGLX: Resuming AIGLX clients after VT switch
May 11 15:04:39 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) NOUVEAU(0): NVEnterVT is called.
May 11 15:04:39 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) NOUVEAU(0): EDID vendor "DEL", prod id 40976
May 11 15:04:39 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) NOUVEAU(0): Using hsync ranges from config file
May 11 15:04:39 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) NOUVEAU(0): Using vrefresh ranges from config file
May 11 15:04:39 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) NOUVEAU(0): Printing DDC gathered Modelines:
May 11 15:04:39 bb8 /usr/lib/gdm3/gdm-x-session[29416]: (II) NOUVEAU(0): Modeline "1920x1200"x0.0  154.00  1920 1968 2000 2080  1200 1203 1209 1235 +hsync -vsync (74.0 kHz eP)

I installed Ubuntu 18.04 LTS a couple days ago and this has been happening since then -- this was not occurring when I was running Ubuntu 14.04 on the same PC.


Solution 1:

When your desktop freezes, write down the exact time.

Either wait for the desktop to unfreeze or ssh into the machine, and then view /var/log/syslog for the time that you wrote down it freezing.

In the my case the logs had NOUVEAU lines around the time of the freeze, I replaced the Nouveau display driver with the NVIDIA binary driver, and that resolved the intermittent freezes.

Solution 2:

For me there was nothing showing in /var/log/syslog, however I noticed it happened every time I copied to the clipboard. Turned out to be a clipboard manager called copyq. Ran apt purge copyq && apt install copyq and the problem went away. This probably isn't helpful to know my solution, but it may be helpful to know the problem isn't always output to the syslog.