How can I debug frequent unrecoverable freezes?

My new XPS 13 (9360 with KabyLake processor) with Ubuntu 16.04 pre-installed frequently freezes completely without any apparent reason.

The freezes occur seemingly randomly. Sometimes the mouse pointer can still be moved for few seconds but eventually the system completely locks up. I am unable to switch to virtual terminals and not even SysRq codes seem to have any effect. All I can do is long press the power button for a hard power off after which the system boots normally.

User processes running are mostly several Chrome tabs and a terminal.

Things I have checked and tried include:

  • Verify latest BIOS is installed
  • Run diagnostics included in DELL BIOS without any results
  • Reinstall the system from the recovery image
  • Check for latest ath10 firmware
  • Install Intel graphics drivers
  • Disable wifi and bluetooth

After doing so the freezes still occur. Now I am at a loss. My question thus is:

What are ways to find the cause of the issue?


Solution 1:

Disable intel_cstates (power saving states meant to reduce CPU waste heat and power usage) by editing /etc/default/grub:

sudo nano /etc/default/grub

Find the line containing GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Add intel_idle.max_cstate=1 directly following splash.

Alternatively, if your BIOS supports doing so, disable said C-states from there.

Note: this is not a long-term fix. Disabling C-states heavily increases power-draw and waste heat. Only try this if there are no other solutions and updating your kernel does not solve anything!

Solution 2:

How to install Kernel 4.8.5

Although 4.8.7 is the latest kernel, in this 500-post, 1 years long, bug log (Bug 109051 - intel_idle.max_cstate=1 required on baytrail to prevent crashes) it is reported not to work. Just yesterday someone posted they tried 4.8.7, it crashed so they went back to 4.8.6.

Although the bug log title is for "Bay Trail" the solutions presented apply to other Intel platforms as users report. Because there are 582 posts spanning almost one year, I recommend pressing the End key after opening the link and scroll up from there.

I've been running 4.8.5 off and on again alongside with 4.4.0-47 for a couple of weeks and feel comfortable using either one. These are the instructions for installing kernel version 4.8.5:

cd /tmp
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/linux-headers-4.8.5-040805_4.8.5-040805.201610280434_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/linux-headers-4.8.5-040805-generic_4.8.5-040805.201610280434_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/linux-image-4.8.5-040805-generic_4.8.5-040805.201610280434_amd64.deb
sudo dpkg -i *.deb
sudo reboot

You can install any kernel by visiting the site: (http://kernel.ubuntu.com/~kernel-ppa/mainline/) and adapting the links there to the instructions above.