6

I'm running Ubuntu 20.04 on my Acer swift 3 laptop for a few months. In overall, system is performing well, but sometimes my laptop becomes totally unresponsive. In such cases, my only solution is shutdown (pressing and holding power button for a few seconds) and restart the computer. I simply can't understand and debug this problem. Screenshot of important system logs (logged before one of crashes) from GNOME logs app is attached here:

enter image description here

I want to mention that system freeze happens when watching media files in browsers, such as video on facebook, youtube. It always happened both on firefox and chromium browsers. I can provide you with additional related system info/logs. Please help me to identify the issue.

EDIT

free -h:

enter image description here

grep -i swap /etc/fstab:

enter image description here

sysctl vm.swappiness:

vm.swappiness = 60

EDIT 2

ls -al /var/crash

enter image description here

lshw -c video

enter image description here

lsmod | grep amd

enter image description here

EDIT 3

dpkg -l *amd* | grep ii

enter image description here

dpkg -l *ati* | grep ii

enter image description here

  • Edit your question and show me free -h and grep -i swap /etc/fstab and sysctl vm.swappiness. What video card and driver version? Start comments to me with @heynnema or I'll miss them. – heynnema Mar 08 '21 at 20:03
  • @heynnema edited as requested. – Elgin Cahangirov Mar 09 '21 at 05:35
  • @karel I didn't try solutions offered in that question. I can do it only in the next crash, since this problem is not reproducible. – Elgin Cahangirov Mar 09 '21 at 05:59
  • Thanks for the info. If you look at the image of grep -i swap /etc/fstab I notice some video glitches. Do you see them? What video card do you have? What version driver? – heynnema Mar 09 '21 at 13:00
  • Also see my initial answer. – heynnema Mar 09 '21 at 13:01
  • @heynnema grep -i swap /etc/fstab outputted just one line as I attached. As for my video card (lspci | grep VGA): 03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c2) – Elgin Cahangirov Mar 09 '21 at 13:52
  • Do you have the latest AMD/ATI video drivers installed? Have you increased your /swapfile yet... and if yes... have you seen any improvement? – heynnema Mar 10 '21 at 02:22
  • @karel actions suggested in the link didn't help me yesterday at at the time of crash. My laptop was totally unresponsive. – Elgin Cahangirov Mar 13 '21 at 08:08
  • @ElginCahangirov, did you solve the issue? I am experiencing the same problem. – desmond13 Oct 05 '21 at 12:04
  • 1
    @desmond13 it was solved on its own. I couldn't find what caused that issue and what solved the problem. I suggest to install latest system updates. Maybe those updated solved the problem. – Elgin Cahangirov Oct 06 '21 at 12:17
  • Ok, thanks for your answer – desmond13 Oct 06 '21 at 16:09

4 Answers4

2

Let's increase your /swapfile from 2G to 4G and see if that helps.

Note: Incorrect use of the dd command can cause data loss. Suggest copy/paste.

In the terminal...

sudo swapoff -a           # turn off swap
sudo rm -i /swapfile      # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile # set proper file protections sudo mkswap /swapfile # init /swapfile sudo swapon /swapfile # turn on swap free -h # confirm 8G RAM and 4G swap

Edit /dev/fstab, using sudo -H gedit /etc/fstab or sudo pico /etc/fstab.

Confirm this /swapfile line in /etc/fstab... and confirm no other “swap” lines... use SPACES in this line... confirm NO TABS...

/swapfile  none  swap  sw  0  0

reboot                    # reboot and verify operation

Update #1:

Remove nomodeset from your /etc/default/grub and then sudo update-grub.

You have an older version of the AMD video driver. Download and install version 20.20 at https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-20 or https://drivers.amd.com/drivers/linux/amdgpu-pro-20.20-1098277-ubuntu-20.04.tar.xz.

Installation instructions are at https://amdgpu-install.readthedocs.io/en/latest/.

Reboot your computer.

heynnema
  • 70,711
  • 1
    thanks for your answer! I've updated swap as per your guide. Let's see what future will show :) – Elgin Cahangirov Mar 09 '21 at 16:58
  • 1
    @ElginCahangirov Status please. If my answer resolved the problem, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks! – heynnema Mar 13 '21 at 00:06
  • 1
    @heynema unfortunately, the problem happened again yesterday. At the time of crash I was watching youtube video about 2 hours. Actions suggested in this link didn't help also. – Elgin Cahangirov Mar 13 '21 at 08:06
  • 1
    @ElginCahangirov Edit your question and show me ls -al /var/crash. Also, you didn't answer my question "Do you have the latest AMD/ATI video drivers installed?"? Do you know how to edit GRUB commands from the GRUB menu? If so, find "quiet splash" and change it to "quiet splash nomodeset" and let's see if you still have the problem... note that monitor resolutions may be off during this temporary setting. – heynnema Mar 13 '21 at 13:14
  • 1
    I edited question as you requested. I'm not sure how to check status of amd/ati video drivers. So I attached results of two related command (supposedly) also. – Elgin Cahangirov Mar 13 '21 at 21:48
  • @ElginCahangirov You need to know the model # of your video card. To get the software version, try dpkg -l *amd* | grep ii or dpkg -l *ati* | grep ii. Then go to the AMD/ATI web site and check what versions they have there. You didn't answer my question about GRUB. – heynnema Mar 13 '21 at 22:02
  • @ElginCahangirov Status please... – heynnema Mar 26 '21 at 14:04
  • re-edited question and added results of video driver related commands. As for quiet splash nomodeset, I didn't change it from GRUB menu yet. I'll try to update that as soon as possible and let you know the "result" (apostrophed because I really can't measure, crashes are random and not reproducible). – Elgin Cahangirov Mar 26 '21 at 14:20
  • @ElginCahangirov Are you still having problems? Did you increase the /swapfile? Show me sysctl vm.swappiness. – heynnema Apr 10 '21 at 01:05
  • yes, unfortunately. I'm now observing that watching high resolution videos cause more frequent crashes rather than low resolution. For example, watching 1080p videos on youtube about 15-20 minutes results in crash, but in 480p it takes a few hours. sysctl vm.swappiness is vm.swappiness = 60. As for quiet splash nomodeset, I am not sure how to do that. Is it enough to add GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset" this line to /etc/default/grub and run sudo update-grub? – Elgin Cahangirov Apr 10 '21 at 05:57
  • @ElginCahangirov Yes. Understand that adding nomodeset is just a temporary adjustment, and you'll have to remove it later. Video resolution may limited. You must reboot after the sudo update-grub. Then retest your high-res videos. Also, please edit your question and show me a screenshot of the Software & Updates Additional Drivers tab before doing the nomodeset change. – heynnema Apr 10 '21 at 14:00
  • @ElginCahangirov Depending on the nomodeset results, we may end up increasing your /swapfile even more with count=8192. – heynnema Apr 10 '21 at 14:03
  • @ElginCahangirov AFTER the nomodeset testing, download the latest video driver from AMD at https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-20 or https://drivers.amd.com/drivers/linux/amdgpu-pro-20.20-1098277-ubuntu-20.04.tar.xz – heynnema Apr 10 '21 at 14:09
  • @ElginCahangirov Updated my answer. – heynnema Apr 10 '21 at 14:16
  • additional drivers tab says no additional drivers available – Elgin Cahangirov Apr 10 '21 at 14:22
  • @ElginCahangirov We'll do the nomodeset test, then Update #1, then increase /swapfile, in that order. – heynnema Apr 10 '21 at 14:23
  • you said adding nomodeset is just a temporary adjustment How long should I wait before reverting the change? – Elgin Cahangirov Apr 10 '21 at 14:36
  • @ElginCahangirov Long enough to test high-res videos and see if it crashes/freezes. nomodeset eliminates the possibility of video driver problems. – heynnema Apr 10 '21 at 14:38
  • nomodeset didn't result in absolute solution, although it caused improvement I clould watch 1080p about 4-5 hours. But, at the same same crash happened – Elgin Cahangirov Apr 11 '21 at 19:14
  • ./amdgpu-pro-install --px resulted in this error. Then I go to /usr/bin and run amdgpu-pro-uninstall executable there and tried to reinstall amdgpu drivers again with ./amdgpu-pro-install --px. Error for this time is this. Now, supposedly I am where I started, since dpkg -l *amd* | grep ii results are the same with previous one (attached in question edit 3). Thank you for all your efforts! – Elgin Cahangirov Apr 11 '21 at 19:21
  • @ElginCahangirov It's a bug with their installer... believe it or not! px isn't supported any more... but the install instructions would have you believe otherwise. See https://bugs.freedesktop.org/show_bug.cgi?id=107826. Install without the --px option, or do ./amdgpu-install. Also, you can now remove nomodeset and do sudo update-grub. – heynnema Apr 11 '21 at 19:38
1

sorry for posting as an answer (I just recently joined and cannot comment yet)

@ Elgin Cahangirov: I also experience these random freezes, and most of the time there is an update waiting for me when I restart my computer... Have you run Software Updater after your crash?

Here is the full story:

I have the same problem (I just restarted my machine after this annoying freeze-of-death) and also tried resolving it via swap-settings:

My swap settings before the crash were:

  • manually changed swappiness to 95 or 100 (default is 60, haven't yet figured out how to change swappiness permanently)

  • 8 GB RAM

  • 2 GB swap (during installation, on "hard drive 1", dual boot with windows)

  • a second swap partition of almost 20 GB (on "hard drive 2" (created and activated with disk and gparted ))

  • set these priorities to my swaps: * -1 for the 2 GB swap (system default) * 3 for the 20 GB swap (chanced manually, permanent setting)

What was running?

  • some firefox windows (no videos, just plain texts (how-tos for R) and google sheets)

  • R (luckily I had saved everything)

  • system monitor (cause these crashes happen all the time & I'm trying to figure out why... (however, it was in the background, so I couldn't see what caused the crash))

What did I do?

Actually nothing... I was AFK, R was just open (no calculation running or anything), firefox was just open (no page loading)

=> no apparent reason for crashing... (and this happens all the time, totally random... e.g. :

  • when the machine is idle (just left switched on when I went to bed),
  • when I'm running R
  • when I'm running salmon
  • when I'm watching a youtube tutorial (with the extra annoying special effect that the last seconds of whatever was playing are stuck on repeat -.- )
  • when I had some programs open but was doing nothing at the moment (I notice the freeze when I come back to resume my work after a short break)
  • ...)

However, after I restarted my computer, I checked whether Software Updater had any updates or something like that and there was yet another update (ubuntu base) I have disabled livepatch (because I thought it might be the reason for those freezes). My settings in Software Updater say: "subscribe to all updates" (for other packages), "check for updates weekly", security updates immediately, other updates weekly, notify about other LTS ubuntu versions.

Is there anything I can do to fix that?

It reminds me of my Windows 10: Whenever there is an update the PC will be really slow, proudly announce that there's an update and ask for a restart, restarting will take forever, and most of the time it needs a second restart until everything is back to normal... However, in Win 10 I can pause updates for a week if I want to make sure that my machine will not be slow or crash (e.g. during an important project) Can I pause my Software Updater updates, too? (checking weekly didn't work, it caught 2 updates (& two freezes) yesterday and caught another update just now... or is ubuntu base one of the security updates?)

Sorry for rambling, I'm new to Ubuntu and wanted to give all the information that might be important :)

Dobby
  • 31
  • 2
    thanks for your sincere answer :). After increasing swapfile from 2Gb to 4Gb system is not crashing for a few days. Let's see what future will show). – Elgin Cahangirov Mar 11 '21 at 21:36
  • 1
    Hello again :) Did your video card settings change anything about your crashes? I still experience random crashes (my latest crash was with just 2 or 3 firefox windows, the program that is equal to "explorer" in windows, and libre office calc trying to compare 2 documents -.- ) – Dobby Mar 18 '21 at 16:08
  • 1
    BTW if your system is completely unresponsive try holding ALT and the key that makes a screenshot and type R E I S U B (I found this in some forum discussion, see the link for detailed information: https://askubuntu.com/questions/4408/what-should-i-do-when-ubuntu-freezes/36717#36717 ) – Dobby Mar 18 '21 at 16:15
  • However, after restarting with REISUB (the 2 crashes immediately before that last one with the update) didn't show an update... So I don't know if it is because of an update or because my system just felt like crashing again... or maybe updates don't show after the "soft reboot" with REISUB (no live patch at the moment, I'm trying to "pause" random updates (which doesn't work too well)) @heynnema Do you have any suggestions, what I could try? – Dobby Mar 18 '21 at 16:20
  • 1
    same thing I am still experiencing random crashes – Elgin Cahangirov Mar 19 '21 at 13:33
  • Please start a new question for your problem. – heynnema Apr 10 '21 at 14:47
  • Hello again (I'm still too low level for adding comments), @ElginCahangirov: Do you happen to have an NVIDIA graphics card? I think my random crashes got cured by choosing the "Using NVIDIA driver metapackage from nvidia-driver-460 (proprietary, tested)" option in Software & Updates > Additional Drivers (I think the default was the open-source version). Maybe that helps... or maybe it was one of the updates that fixed it (or maybe I'm just lucky at the moment) – Dobby Apr 17 '21 at 13:07
  • @Dobby no, mine is amd radeon graphics card – Elgin Cahangirov Apr 19 '21 at 06:47
0

FYI, I had a freezing issue on Zorin OS - a Ubuntu flavor. While there are many software fixes recommended, I focused on Hardware.

Disassembled the machine to the CPU-fan, cleaned up dust that blocks air-flow. Now the problem is gone.

The machine was on Windows and I blamed the OS for freezing up. I installed Zorin OS and I was surprised to see Ubuntu freezes up more frequently than Windows did.

Jae An
  • 1
0

I also experienced the same problem with the ubuntu 20.04 on my dual boot computer. Previously it worked fine, and never freezed. Since yesterday, it occasionally freezes while I am using the computer or when I try to login the system after a long suspension. I recall that I installed a few remote desk apps a few days ago. So I remove/purge them all. Also I install the system updates. I will come back and update this post if the problem harrows me again.

jhuai
  • 1