48

Since I upgraded to Ubuntu 19.10 my system freezes/lags regularly. The mouse, keyboard and screen are completely stuck, after a few seconds it "unfreezes" again. Sometimes it repeats the input I did. For example if I type "F" in a text field it shows "FFFFFFFF" afterwards.

I seems like a lag is triggered every time the system has to read and write a larger amount of data (e.g. start new program, load new firefox tab).

I completely reinstalled Ubuntu 19.10 again on my machine but it is still the same. It runs on a Dell XPS 13.

The same problem is described but not answered in this posts:

Ubuntu 19.10 cursor freezes randomly

Mouse and Keyboard Freeze

Because it was asked in the other posts here are may gnome extensions: enter image description here

EDIT: Thanks for the comment!

  1. I do not use a PS/2 mouse or keyboard.
  2. The model: Dell XPS 13 9360 (2016 version). On the label it says: Reg Mode: P54G Reg Type No: P54G002

EDIT2: Turning off all extension does unfortunately not solve the problem.

Edit 3: Here is what it looks like in the system monitor when I reload a website. The Network manager

Edit 4: Thank you for your comments! Before I reinstalled Ubuntu 19.10 my swap had 8 GB.

enter image description here

Edit: 6 Increasing the swap to 8GB (I have 8GB of RAM) and setting the swappines to 10 seems to have done something. I will have a further look into it.

Edit: 7 My Bios version is 2.10.0. I'll check of updates.

The Disk utility does not show the SMART data for my ssd.

Philipp
  • 767
  • 1
  • 5
  • 16
  • 1
    1) Do you use a PS/2 mouse or keyboard? 2) Please flip the laptop over and look for the serial number sticker. There's a model number there. What is that model number? There are thirteen different XPS 13 models https://www.dell.com/support/search/us/en/19#q=XPS%2013&sort=relevancy&f:langFacet=[en] made by Dell, knowing the right one could help... Please click [edit] and put answers to 1 and 2 in your question. Please do not use Add Comment; use [edit] instead. – K7AAY Nov 01 '19 at 15:28
  • 1
    One thing you could try is to disable all GNOME extensions, see https://askubuntu.com/q/1029376/874649 -- does the problem still appear when they are disabled? – Elias Nov 01 '19 at 15:42
  • 1
    Edit your question and show me `free -h` and `cat /etc/fstab` and `sudo sysctl vm.swappiness`. **Your swap is too small**. Start comments to me with @heynnema or I'll probably miss them. – heynnema Nov 01 '19 at 16:09
  • 1
    Testing with all extensions disabled indeed is one of the first things to do. Also, run "top" to see which processes are loading the system. Swap indeed is small, but will not be the cause why the system with 8 GB is lagging. – vanadium Nov 01 '19 at 19:39
  • 1
    Setting vm.swappiness=10 is wrong for 8G RAM and 1-8G swap. Set swap to 4G, and try vm.swappiness=70 or 80. Check BIOS version with `sudo dmidecode -s bios-version` and then check dell.com for an updated BIOS. Report back. – heynnema Nov 02 '19 at 14:02
  • 2
    @vanadium re: "It seems like a lag is triggered every time the system has to read and write a larger amount of data"... is a clue that ram vs swap vs vm.swappiness may be a problem. There may also be a HDD problem. – heynnema Nov 02 '19 at 14:08
  • 1
    Edit your question and show me a screenshot(s) of the `Disks` app, showing the SMART Data (may take two screenshots to show all of the data. I want to eliminate a possible HDD problem. – heynnema Nov 02 '19 at 14:09
  • 2
    I have the same issue on a dell desktop. with Ubuntu 19.04 there were no probs. It seems to be triggered when I focus on a window containing not trivial js code eg a chrome window showing a js heavy site, the slack application. I only have dastodock extension enabled. – Nikos Tsagkas Nov 02 '19 at 22:18
  • @NikosTsagkas please start a new question, and we can try and help you there. – heynnema Nov 03 '19 at 02:34
  • Your list of two similar unanswered questions as of November 1 has grown considerably now.... – WinEunuuchs2Unix Nov 20 '19 at 03:03
  • @WinEunuuchs2Unix who are you addressing in your last comment? It's unclear. – heynnema Nov 21 '19 at 01:30
  • @heynnema That comment was written before I VTC the question you answered :) – WinEunuuchs2Unix Nov 21 '19 at 01:56
  • @WinEunuuchs2Unix you still lost me. Please explain further. – heynnema Nov 21 '19 at 03:51
  • @heynnema Sorry I was reading too much into your question. My comment was addressed to the OP: Phillipp. Had I been talking to you I would have put @ Yourname in the comment. When responding under the answer or question it is not necessary which is why it was omitted. Sorry for the confusion. – WinEunuuchs2Unix Nov 21 '19 at 03:56
  • @WinEunuuchs2Unix What exactly do you man? – Philipp Nov 21 '19 at 08:35
  • 1
    @Philipp When you said: *"The same problem is described but not answered in this posts: Ubuntu 19.10 cursor freezes randomly Mouse and Keyboard Freeze "* - this list has grown to 5 at least by now. – WinEunuuchs2Unix Nov 21 '19 at 11:24
  • @WinEunuuchs2Unix Thank you for the clarification. Feel free to add the other posts to my question. – Philipp Nov 21 '19 at 11:27
  • 1
    @Philipp What I have been doing is voting to close two new ones to your question. There is also one I answered and was accepted: [Lagging after update to 19.10 from 19.04](https://askubuntu.com/questions/1184366/lagging-after-update-to-19-10-from-19-04/1184571#1184571) – WinEunuuchs2Unix Nov 21 '19 at 11:34
  • Possible duplicate of [Lagging after update to 19.10 from 19.04](https://askubuntu.com/questions/1184366/lagging-after-update-to-19-10-from-19-04) – Elder Geek Dec 01 '19 at 22:36
  • 1
    problem solved by downgrade kernel to 5.2.21-050221-generic – reza Dec 08 '19 at 22:03
  • I have upgraded to 5.4.2 but lagging is still there – Future King Dec 14 '19 at 21:51
  • Today, the update of Linux kernel 5.3 has been released. I noticed in update logs that the problem with armv8 and i965 has been solved. I hope no more lags. – Ján Яabčan Jan 28 '20 at 09:25
  • That's just Ubuntu for ya. 20.04 freezes all 8 CPU cores on my 16GB RAM when I resize an image in [Squoosh](https://squoosh.app/) in Chromium a few times. – Dan Dascalescu Jun 08 '20 at 07:00

9 Answers9

22

This is a regression that happened from Kernel from Kernel 5.0 to 5.3. This may be a problem in the recent changes that the 5.3 kernel introduced with the deprecated deadline, cfq and noop, which according to the Ubuntu wiki "prior to Ubuntu 19.04 with Linux 5.0 or Ubuntu 18.04.3 with Linux 4.15, the multiqueue I/O scheduling was not enabled by default and just the deadline, cfq and noop I /O schedulers were available by default". It has also been reported that some bugs have been introduced for those who have an intel and use the i965 driver.

To get around the problem i changed the swappiness kernel parameter to 10, and use bfq for IOSchedulers, by default Ubuntu uses mq-deadline.

  • 1
    I changed this to the new accepted answer because it makes sense that this is the underlying reason. I think updating the video drivers will work as well. – Philipp Nov 18 '19 at 09:43
  • I've updated to kernel 5.4RC8 and it seems the freezes are less/gone. – localhost Nov 21 '19 at 16:06
  • 1
    It’s not just the Xserver, I was getting freezes on Wayland also. – darksky Nov 21 '19 at 19:44
  • Upgrading kernel from 5.3.0-23-generic to 5.4.1-050401-generic helped. Looks like freezes are gone. – Justas Dec 05 '19 at 07:34
  • 1
    Upgrading to kernel 5.4.0 didn't help. I'm upgrading to 5.4.12, will come back in a couple of days reporting whether it helped or not. – Patryk Cieszkowski Jan 16 '20 at 01:36
  • As promised, I come back with my exp - upgrading to 5.4.12 solved the issue only partially. Prior to the upgrade, the inputs would freeze every couple of minutes. After the upgrade, it doesn't happen no longer, but swap doesn't work either - once RAM gets filled up, everything freezes and finally shuts down. Every couple of hours. [huwawei matebook x pro, 13"] – Patryk Cieszkowski Jan 19 '20 at 02:54
  • I updated with more information for the problem. –  Jan 21 '20 at 22:11
  • Today the update for kernel 5.3 announced the fix for a bug related to i965 driver. So kernel 5.3.0-29.31 should work without these freezes. I will test it. – Ján Яabčan Jan 28 '20 at 09:28
  • Changing scheduler to BFQ made no difference for me. – darksky Mar 15 '20 at 08:56
  • I've tried to install kernel 5.4 from [kernel-ppa](https://kernel.ubuntu.com/~kernel-ppa/mainline/), but still had this regression with laggy mouse and graphics. But after upgrading to **Linux 5.5.9**, it seems completely resolved. Finally able to use this PC again... – darksky Mar 17 '20 at 19:00
  • Upgraded to 5.5.11, no improvement – dez93_2000 Mar 21 '20 at 23:29
  • changed swappiness & used bfq, no change. – dez93_2000 Mar 22 '20 at 00:13
  • Are you using swap partition or swapfile? With Kernel 5.5 this bug is practically gone and you don't need to do any intervention or change the default settings from Ubuntu. @dez93_2000 –  Mar 23 '20 at 00:08
  • If you still have problems, try disabling swap and using zram (sudo apt install zram-config) instead. –  Mar 23 '20 at 00:10
  • cheers, just tried both but no change. full thread now here https://askubuntu.com/questions/1219696/video-lag-after-updating-to-19-10-from-19-04 – dez93_2000 Mar 24 '20 at 03:46
  • I've installed kernel 5.6.3. It just freezes and does not recover. I've switched back to 5.3.0-46. It freezes for a few seconds and then works again. Annoying, but working. – estibordo Apr 12 '20 at 21:56
4

I had a similar issue. I get temporary relief from turning swap off with sudo swapoff -a. It may be related to the usage of swap in the new kernel.

It seems this is a confirmed bug and is being investigated here https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1833281


I managed to significantly reduce this problem in Ubuntu 19.10 by upgrading my kernel to 5.5.9. What I did:

  • I went to https://kernel.ubuntu.com/~kernel-ppa/mainline/ and found the latest release of 5.5 after sorting by Last Modified.

  • Under Build for amd64 succeeded, I downloaded four files: linux-headers-...-all.deb, linux-headers-...generic, linux-image-...generic, and linux-modules-...generic.

  • Then I put them in a directory, went to terminal, cd'd to that directory, and ran sudo dpkg -i *.deb

That's all it took. It automatically installed the latest 5.5 kernel and created a grub entry that became the default. After a restart, no more lags or freezing mouse, at least they became more rare. Swap works normally again.

darksky
  • 952
  • 1
  • 8
  • 18
3

After update to ubuntu 19.10 I also get lags and freeze. Not sure this helps you, but my problem was in graphics drivers. I update drivers from https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers and it works again.

First time i also think this was ssd problem because lags frequently occur when start new application or switch firefox tab.

daa
  • 31
  • 1
  • Is it easy to uninstall 100% and go back to default drivers if wanted? Like to have as clean installation as possible but if this helps I might give it a try. – Pal Bergstrom Nov 14 '19 at 12:15
  • @PalBergstrom As indicated on the Launchpad page : "=== Revert to original drivers === To revert to standard Ubuntu drivers type the following in a prompt shell: $ sudo apt-get install ppa-purge $ sudo ppa-purge ppa:oibaf/graphics-drivers" – mhr Nov 18 '19 at 16:25
2

I had the same issue (also with a Dell XPS13). Updating the graphics drivers with the ones from https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers like @daa did resolved the issue for me too.

  • 7
    I feel weird about installing third party drivers. Who is oibaf and why is his driver not in the main release or from an official site like Intel? – darksky Nov 15 '19 at 02:21
  • I have the same question as darksky – Pal Bergstrom Nov 15 '19 at 13:42
  • Oglaf's been around quite a long time. I've used it several times with good results. In one case, due to bugs in stock driver; in a few cases becasue "slightly newer mesa3d than ubuntu comes with" had some huge speedups. Ubuntu is very conservative in updating their drivers, problems like this stuttering are very unusual on it. Why isn't oglaf default? It's bleeding edge; in this case, bleeding edge solves problems but in other cases, bleeding edge adds bugs and problems. – hwertz Feb 28 '20 at 03:14
2

I migrated to ubuntu 19.10 and got : - mouse lags and freeze, frequently around 12 seconds ! - 100% cpu usage on one core - click on web browser's tab = freeze

I have an Assus SonicMaster computer, Core i5, Nvdia Gforce 940M.

Solution: I went for : Softwares & Updates > Additional drivers It shows : X.org activated.

enter image description here

Then changed to activate proprietary drivers.

enter image description here

So far so good. No more lags.

Hugolpz
  • 221
  • 3
  • 13
  • 4
    Hmm. I don't see any additional drivers. Could be because I only have UHD Graphics 620. – Pal Bergstrom Nov 15 '19 at 13:22
  • Hey @Hugoplz, Can you please take a look at my problem https://askubuntu.com/questions/1199130/my-ubuntu-machine-freezes?noredirect=1#comment2010426_1199130. I followed your step and the screen is showing some kind of issues on the screen and some small pixels come and go quite often. – Baradwaj Aryasomayajula Apr 19 '20 at 18:28
  • Hello @BaradwajAryasomayajula, I have no idea. – Hugolpz Apr 28 '20 at 20:18
1

Kubuntu 19.10 also has this problem. Periodic freezes of the system for 1-2 seconds. This is observed during i/o operations. When swap is disabled, freezes is significantly reduced.

1

Same issue on a Dell XPS 13 9343 (see this post).

One way to make things better was to reduce swap size to 4 GB (for 8 GB of RAM) and set vm.swappiness to 80.

mhr
  • 93
  • 8
1

I had similar issue after upgrading to 19.10 on my Dell XPS 13 9350

Since @stickway helpfully identified this is a kernel bug I purchased this tool to manage kernels in Ubuntu and upgraded to 5.4.1 https://teejeetech.in/ukuu/

I am not affiliated in any way with this tool or it's author, however it seems to work well for me so I wanted to share in case it may be of help to anyone else.

MASSIVE WARNING: Obviously newer kernels are not yet officially supported, if you want to be safer you should downgrade to a previous kernel instead.

Josh
  • 11
  • 1
0

Problem still persist with recent kernel 5.3.0-40.

I downgraded to 5.2.21 from https://kernel.ubuntu.com/~kernel-ppa/mainline/ and lagging and microfreezes are gone, system is running fine and generally is more responsive. Did not try upgraded kernel though.

Microfreezes are caused by swapping and general during disk write operation. Fiddling with swappiness and swaps size helps just a little, it is not a solution.