How to find out why Ubuntu 20.04 freezes?

5,729

Solution 1

BIOS

MSI B350 Tomahawk

You have BIOS version 1.L0, dated 12/28/2018.

There's a newer BIOS available here. The numbering/naming convention is different than what you have now, and that's unusual. Contact MSI Support and ask about this.

enter image description here

Note: Confirm that I have the correct web page for your model motherboard.

Note: DON'T download/use/install the most current BETA version.

Note: Have good backups before updating the BIOS.


Swap

Let's increase your /swapfile from 2G to 4G.

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

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 16G RAM and 4G swap
reboot                    # reboot and verify operation

Add this line to /etc/fstab...

/swapfile    none    swap    sw      0   0

Nvidia

You have Nvidia version 440.100.

Software & Updates shows that this is the current version. However, there's a newer version 450.57 which can be downloaded here.

enter image description here enter image description here

Note: Have good backups before updating the Nvidia drivers.

Update #1:

Since you've had to forcefully power OFF your computer, let's check your file system...

  • boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode
  • open a terminal window by pressing Ctrl+Alt+T
  • type sudo fdisk -l
  • identify the /dev/sdXX device name for your "Linux Filesystem"
  • type sudo fsck -f /dev/sdXX, replacing sdXX with the number you found earlier
  • repeat the fsck command if there were errors
  • type reboot

Update #2:

Install the BIOS update... but contact MSI Support first, to confirm which BIOS update file version you need... as their naming convention seems to have changed.

You have installed a number of GNOME Shell extensions, any of which can cause freezing, and they're installed in the "wrong" place, in so far as they're installed system wide, as apposed to user-specific. You can see them in the /usr/share/gnome-shell/extensions directory listing, and they all end in gcampax.github.com.

The safest way to remove them is to go to https://extensions.gnome.org/local/ and delete all but these three extensions...

drwxr-xr-x 2 root root 4.0K Jun 11 08:20 'desktop-icons@csoriano'/
drwxr-xr-x 3 root root 4.0K May 12 15:17 '[email protected]'/
drwxr-xr-x 3 root root 4.0K Jun 18 09:12 '[email protected]'/

If the system runs ok without freezing for some period of time, then manually reinstall any single favorites, one extension at a time, rather than installing extension packs/zip files.

Solution 2

What fixed this problem for me on a similar system (Ryzen 5 1600X, Asus B350 Plus) was to disable "Automatic C-State management" in BIOS. It may be named slightly differently in your BIOS.

Share:
5,729
Nicolas Cordova
Author by

Nicolas Cordova

I like to learn about new technologies and develop stuff.

Updated on September 18, 2022

Comments

  • Nicolas Cordova
    Nicolas Cordova over 1 year

    I installed Ubuntu 20.04 on my Amd Ryzen 5 1600 / Nvidia Gtx 1070 two weeks ago but Ubuntu completely freezes from time to time.

    Keyboard and screen stop working completely, mouse sometimes is able to keep moving. I've tried using the magic SysRq key but didn't work. Also tried alt+F1 but didn't get any response from the system either. Basically I'm left with pressing the power button in order to restart.

    I'm suspecting Nvidia but I don't know how to verify.

    nvidia-smi shows driver version 440.100.

    Found these logs in /var/log/Xorg.1.log.old that showed the time around my computer crashed.

    [  1223.234] (EE) client bug: timer event2 debounce: scheduled expiry is in the past (-22ms), your system is too slow  
    [  1223.234] (EE) client bug: timer event2 debounce short: scheduled expiry is in the past (-35ms), your system is too slow  
    [  1488.529] (EE) client bug: timer event2 debounce: scheduled expiry is in the past (-0ms), your system is too slow  
    [  1488.529] (EE) client bug: timer event2 debounce short: scheduled expiry is in the past (-13ms), your system is too slow  
    [  5125.223] (EE) client bug: timer event2 debounce: scheduled expiry is in the past (-14ms), your system is too slow  
    [  5125.223] (EE) client bug: timer event2 debounce short: scheduled expiry is in the past (-27ms), your system is too slow  
    [  6038.321] (EE) client bug: timer event2 debounce short: scheduled expiry is in the past (-9ms), your system is too slow  
    [  6206.894] (EE) client bug: timer event2 debounce: scheduled expiry is in the past (-3ms), your system is too slow  
    [  6206.894] (EE) client bug: timer event2 debounce short: scheduled expiry is in the past (-16ms), your system is too slow  
    [  6409.650] (EE) client bug: timer event2 debounce: scheduled expiry is in the past (-9ms), your system is too slow  
    [  6409.650] (EE) client bug: timer event2 debounce short: scheduled expiry is in the past (-22ms), your system is too slow  
    [ 10930.426] (EE) client bug: timer event2 debounce: scheduled expiry is in the past (-7ms), your system is too slow  
    [ 10930.426] (EE) client bug: timer event2 debounce short: scheduled expiry is in the past (-20ms), your system is too slow  
    

    free -h result:

                  total        used        free      shared  buff/cache   available
    Mem:           15Gi       2.5Gi        11Gi       393Mi       1.9Gi        12Gi
    Swap:         2.0Gi          0B       2.0Gi
    

    sysctl vm.swappiness result:

    vm.swappiness = 60
    

    sudo lshw -C memory result:

      *-firmware                
           description: BIOS
           vendor: American Megatrends Inc.
           physical id: 0
           version: 1.L0
           date: 12/28/2018
           size: 64KiB
           capacity: 16MiB
           capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb biosbootspecification uefi
      *-memory
           description: System Memory
           physical id: f
           slot: System board or motherboard
           size: 16GiB
         *-bank:0
              description: 2933 MHz (0.3 ns) [empty]
              product: Unknown
              vendor: Unknown
              physical id: 0
              serial: Unknown
              slot: DIMM 0
              clock: 2933MHz (0.3ns)
         *-bank:1
              description: DIMM DDR4 Synchronous Unbuffered (Unregistered) 2933 MHz (0.3 ns)
              product: CMK16GX4M2B3200C16
              vendor: Unknown
              physical id: 1
              serial: 00000000
              slot: DIMM 1
              size: 8GiB
              width: 64 bits
              clock: 2933MHz (0.3ns)
         *-bank:2
              description: 2933 MHz (0.3 ns) [empty]
              product: Unknown
              vendor: Unknown
              physical id: 2
              serial: Unknown
              slot: DIMM 0
              clock: 2933MHz (0.3ns)
         *-bank:3
              description: DIMM DDR4 Synchronous Unbuffered (Unregistered) 2933 MHz (0.3 ns)
              product: CMK16GX4M2B3200C16
              vendor: Unknown
              physical id: 3
              serial: 00000000
              slot: DIMM 1
              size: 8GiB
              width: 64 bits
              clock: 2933MHz (0.3ns)
      *-cache:0
           description: L1 cache
           physical id: 11
           slot: L1 - Cache
           size: 576KiB
           capacity: 576KiB
           clock: 1GHz (1.0ns)
           capabilities: pipeline-burst internal write-back unified
           configuration: level=1
      *-cache:1
           description: L2 cache
           physical id: 12
           slot: L2 - Cache
           size: 3MiB
           capacity: 3MiB
           clock: 1GHz (1.0ns)
           capabilities: pipeline-burst internal write-back unified
           configuration: level=2
      *-cache:2
           description: L3 cache
           physical id: 13
           slot: L3 - Cache
           size: 16MiB
           capacity: 16MiB
           clock: 1GHz (1.0ns)
           capabilities: pipeline-burst internal write-back unified
           configuration: level=3
    

    grep -i swap /etc/fstab result:

    /swapfile                                 none            swap    sw              0       0
    

    sudo dmidecode -s bios-version result:

    1.L0
    

    Adding Software & Updates screenshot

    Software & Updates

    Aug 6 Update:

    crash files, gnome shell extensions listed in terminal

    • Boris Hamanov
      Boris Hamanov almost 4 years
      Thanks for the info. Now I need to know your motherboard make/model #. And grep -i swap /etc/fstab. Look in Software & Updates and see what version Nvidia driver is available there. Version 450.57 is at nvidia.com/en-us/geforce/drivers
    • Nicolas Cordova
      Nicolas Cordova almost 4 years
      @heynnema Motherboard model is MSI B350 Tomahawk, Software updates shows no updates, I've executed sudo apt update && sudo apt upgrade last week. I thought about upgrading the driver but haven't done so yet. Should I install Version 450.57?
    • Boris Hamanov
      Boris Hamanov almost 4 years
      Not Software Updater, but Software & Updates app. Something doesn't match at the web site. Show me sudo dmidecode -s bios-version and confirm that your memory is in slots A2/B2. Wait with the Nvidia update, until I can put together an answer for you. Thanks!
    • Nicolas Cordova
      Nicolas Cordova almost 4 years
      @heynnema Added screenshot for Software & Updates, and result for bios version. I can confirm that both ram sticks are on A2 and B2.
    • Will K
      Will K over 3 years
      I have this issue as well. I have a Ryzen 7 3700X on an Asus X-370 Prime motherboard with a GTX 1080. I have been investigating and have narrowed it down based on observations of what I have running when the freeze / crash occurs. About 30-60 minutes into a Discord video call, my system will freeze. I have Discord on my second monitor with the video in full screen or Discord maximized itself. I have also had my system freeze while playing YouTube videos in Firefox on my second monitor. But, if I do not have any videos playing at all, I never experience this behavior.
  • Nicolas Cordova
    Nicolas Cordova almost 4 years
    Is there a process to follow when installing a new nvidia driver. I mean, some default proper process?
  • Boris Hamanov
    Boris Hamanov almost 4 years
    @CristianCordova Some users switch to the nouveau driver in Software & Updates, then uninstall the current Nvidia using the Nvidia utility for that, install the new, re-enable the new. Other users just install over the top of the existing driver. I don't know if one is any better than the other. Have good backups either way.
  • Nicolas Cordova
    Nicolas Cordova almost 4 years
    I have successfully installed nvidia driver version 450.57 and also configured swap to use 4gb. I'll wait on the bios update until the last version goes out of beta. For now I will see if I get a crash during the following days and I'll notify problem. Thanks for your help.
  • Boris Hamanov
    Boris Hamanov almost 4 years
    @CristianCordova Good job! Go ahead and contact MSI Support and ask about the BIOS update naming/numbering. Don't wait for the beta to get bumped, as that might never happen. Keep me posted, ok? Remember to use "@heynnema" in comments to me (unless you comment to my answer), or I'll miss them.
  • Boris Hamanov
    Boris Hamanov almost 4 years
    @CristianCordova See Update #1 in my answer.
  • Nicolas Cordova
    Nicolas Cordova almost 4 years
    I'm still testing the update I did to swap/nvidia drivers, if I get a freeze I'll try this. Thanks for your input.
  • Nicolas Cordova
    Nicolas Cordova almost 4 years
    Just did the fsck, no errors were thrown. Thanks for pointing out these steps. Might be useful in the future.
  • Nicolas Cordova
    Nicolas Cordova almost 4 years
    Have not had any freeze since I updated the nvidia driver and made swap use more gb. I'll mark your answer as the solution. Might be useful to add the ppa nvidia repository in order to update the drivers without much trouble.
  • Nicolas Cordova
    Nicolas Cordova almost 4 years
    Just froze again :(
  • Boris Hamanov
    Boris Hamanov almost 4 years
    @CristianCordova Do the BIOS update, but contact MSI Support first. Edit your question and show me ls -al /var/crash and ls -al ~/.local/share/gnome-shell/extensions and ls -al /usr/share/gnome-shell/extensions.
  • Nicolas Cordova
    Nicolas Cordova almost 4 years
    I have added the result for the commands, I just installed the bluetooth extension today.
  • Boris Hamanov
    Boris Hamanov almost 4 years
    @CristianCordova Please see Update #2 in my answer. Report back.
  • Nicolas Cordova
    Nicolas Cordova almost 4 years
    I'll still wait for an answer from MSI to get this done. Will report back as soon as I can.