Score:3

Ubuntu 20.04.3 LTS very often freezes randomly and does not recover without force shutdown

br flag

I am running Ubuntu 20.04.3 LTS x86_64 on Intel Core i7-9750H, GTX 1650 (mobile?), 16GB RAM, NVME m.2 SSD and I do not have any other operating systems installed. Since this Wednesday (25 Aug 2021), my computer randomly freezes completely and this happens very often. When it freezes, I cannot move the mouse, toggle keyboard backlight (which usually works in the bios menu even). Combinations with the SysRq key also do not seem to work. If audio is playing during the crash, then the last 1.5 seconds start repeating. I have left my computer to stay like that for over an hour once and nothing improves. It's not an issue with overheating as this sometimes occurs right after a cold boot. My only solution so far is to force shut down the machine by holding the reset power button.

Here is what I tried:

  • System logs from before the crash do not show any important/critical issues and they usually vary
  • Starting from version 18.04, others have experienced the same issue and convicted Chrome. Disabling hardware acceleration from the settings and with the command line flag did not work (it might have even made things worse). Using Wayland instead of Gnome also did not work for me.
  • When a crash occurs, I repeatedly tried using SysRq combinations to more safely shutdown my PC. Namely Alt+SysRq+S (sync), Alt+SysRq+U (unmount), Alt+SysRq+B (shutdown) but this never worked while frozen. I tested during normal operation and it did work.

Other than that, I have noticed no performance spikes or heavy resource utilisation. I have had a crash occur while nothing else but Chrome and in all cases of crashes I've had Chrome running (although this can be coincidental as I run Chrome almost all the time).

I've been using Ubuntu for quite some time and have never had any issues as big as this one. I noticed live-patch must have updated my system to version 20.04.3 from 20.04.2, although I cannot confirm when exactly this has happened, but this is certainly something less than 2 weeks old.

I would really appreciate any info on how I could debug this and even better—fix it altogether. I really do not want to re-install unless there's another option.

Further update:

I have noticed this only occurs when I move my laptop to a different location. What is different when I do that is:

  • not connected to external monitor via HDMI
  • not using ethernet
  • using wifi

I still believe that this bug is introduced after 20.04.2 LTS, although it might be different software causing it (e.g. faulty driver).

David avatar
cn flag
Boot from a live media and let it run for a bit does it crash?
undefined avatar
br flag
@David I'll try that when able and update with the result.
mchid avatar
bo flag
How much swap space do you have, what is your swappiness set to, and have you checked `htop` to see if your swap space is filling up?
undefined avatar
br flag
@mchid I had extended my swap from the default (2 or 4GB) to 9.6GB. It is constantly at 0%. My memory is 16GB and that is normally at 25% (4.5GB) only. I saw that my system updated to 20.04.**3** abought when I started facing this issue. I used Software & Updates to upgrade my PC to Ubuntu 21.04. So far I have not faced this issue, but I've only used the new version for a day. I will update if I encounter this issue again. So far, the problem is something that was changed no earlier than 20.04.3 LTS.
undefined avatar
br flag
I have not encountered this issue any further (including with Chrome GPU acceleration *enabled*). This bug is caused due to changes no earlier than 20.04.3 and no later than 21.04.
Nicolas avatar
tr flag
I think I have the same issue. Intel Core i7 x86_64, 16Go RAM, Intel graphic card, Ubuntu 20.04.3, X11... I don't remember first time I got this (before summer), but now it freezes randomly almost each day. I don't know how to collect data about this crash. I don't see anything in sys logs and it is really unpredictable. no lag, no overheat, no fan noise...
Nicolas avatar
tr flag
Some points I noted: - For some time I thought it was a Firefox bug because I was usually using Firefox when I got frozen. But I'm almost always using Firefox, and I also got the same bug using VSCode, SmartGIT or Slack. - I think it often freezes when I close a window or a Firefox tab (I'm not sure it's always the case). - I think I get more of this when a second screen is connected to my laptop via HDMI. I think I already got freezes without second screen, not sure.... (very helpful all those unprecise details :D )
undefined avatar
br flag
@Nicolas Just to note it here, I'm also using an external monitor via HDMI. I believe it must be a bug after 20.04.3 LTS and before 21.04. Upgrading to 21.04 fixed the issue for me.
undefined avatar
br flag
I might have encountered this on 21.04 as well. It seemed a bit different (could be overheating or something), I'll confirm if it happens again.
undefined avatar
br flag
The issue persists on 21.04 and is not related to overheating. Cpu temperatures at around 40C cause this to happen as well. Last thing I can try is reinstalling to 20.04.02 and 20.04.01 which I know for sure ran fine. If the issue persists on these versions it must be hardware related.
mostafaznv avatar
ru flag
I have freeze issue to. after changing my graphics card from nvidia to amd, this issue occurred. I realized this issue occures when I'm using telegram. but I think it's not about telegram itself. it's a gpu thing. I removed amd drivers and installed them bug bug happens randomly and system completely freezes. anyone can help?
Carles Mateo avatar
cn flag
I used to have problems like that with OBS when it used the hardware acceleration. I would ask if you use any program with GPU hardware acceleration enabled, or proprietary codecs. Also which video driver do you use. When it hangs pressing CTRL + ALT + F2 or F3 may display the text mode terminal were you may be able to troubleshoot (some times). Cheers
undefined avatar
br flag
@CarlesMateo I did not use any such programs at the time. It would occur sometimes with no programs running at all. The system did not react to <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>F2</kbd> or to any other keyboard shortcuts.
in flag
The only thing like this I have experienced was caused by a failing power supply on a desktop computer (or at least fixed by its replacement). I noticed a pattern of app usage led to the failure, but after fixing it I considered that it was just causing a power demand that could not be properly satisfied. Seems like ruling out hardware would be my next step, perhaps a live USB version of 20.04 (or a different drive/partition) would be sufficient to test with.
Adam avatar
lr flag
I have the exact same issue. I have a Dell Precision 3551. Intel Core i7-10750H CPU @ 2.60GHz x12, 16 GB RAM. I am using FIrefox & Chrome and Telegram. Have Ubuntu 20.04.05 yet. Also thought its overheating, but then happend after a boot when laptop was cold and on an additional fan. Also, since it happen on boot, I don't think its related to a browser or browser plugin. Did you find anything out yet?
ng flag
Checkout your storage media health.
Van Tho avatar
cn flag
In my case, it was because of the battery. My battery is installed but not detected. I thought it was because Ubuntu 22 but I've tried to install window 10 from Microsoft but it still happend...
Jeff avatar
mx flag
If your computer keeps rebooting even when on the live media, it seems like it could be an issue with your CPU. If this is a desktop, then it would either be your CPU or your PSU. In the case of the CPU (it would be thermal throttling) check your fans or radiator. If those work fine, get a new CPU or better cooling. If it's the PSU (use a tester), get a new one.
Leo avatar
cn flag
Leo
I have the same issue. At first, I thought it was because of CUDA I have installed. I have reinstalled the Ubuntu completely (It even freezes on the live media while installing and I had to try multiple times to install it) but the issue is still there. I am using Ubuntu 22.04.2 LTS, GeForce RTX 3080 Mobile, and AMD® Ryzen 9. I have checked the logs and have the `htop` open and nothing was wound in the syslogs, kernel logs, and `htop`. This bug is introduced to me for a week (I didn't remember the exact action I did that caused this bug) but the only solution was not using external monitor.
Score:1
cn flag

Your exact hardware is essential to debug this. You've written that your GPU is potentially mobile - if this is a laptop - then the model would be helpful. Then assure in that sequence:

  • If computer doesn't respond to SysRq check if it responds to it when computer it's not in hang state - SysRq + H should display help in your text console. As it might be disabled or work differently on laptop with 'Fn' key modifier or when no Physical SysRq key present.
  • assure that the circumstances arround the issue are not when the computer runs out of memory - on modern faulty websites written by poor js programmers it can eat a lot of GB of RAM quite easilly when you'll left your browser with multiple tabs open.
  • do sudo apt-get install linux-crashdump
  • if you have builtin card and Nvidia one try to lock to one of those (e.g by unloading kernel module) work few days and then try the same with the other card.
Score:0
by flag

First method:

sudo ubuntu-drivers autoinstall
Restart

Second method:

sudo apt-get purge 'nvidia*'
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
Score:0
br flag

I had similar issues when just running chrome.

Make sure to set the nvidia prime profile to 'nvidia'.

I had it on 'on-demand' which seems to frequently freeze my system.

sudo prime-select nvidia

After this change, chrome stills hangs sometimes but seems to restore in a few seconds. Firefox just works without issues.

Score:0
at flag

I know this is quite an old problem. I've searched far and wide for a solution. I've been dealing with this for YEARS! I was once again searching for a solution because my PC was acting up more than usual. I came across a different forum and found what ended up being my solution. But first the problem:

When using my PC, it would freeze and crash randomly but ESPECIALLY when I logged off for the day.

Solution: At first I kept thinking that my Nvidia driver was the source of my troubles. That ended up not being the case. For me, it ended up being a bios configuration that had to do with idle power. Once I turned off the setting, my machine hasn't froze or crashed since.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.