bamarni / pi64

A 64-bit OS for the Raspberry Pi 3
712 stars 128 forks source link

Pi freezes up regularly #66

Open Schwambo opened 6 years ago

Schwambo commented 6 years ago

I built the 64 bit desktop OS on a fresh SD card and set it up, connected it to wi-fi and installed various basic packages. During that the pi randomly froze and was not responding at all. After a hard reset I tried again and everything went fine. I am now at a point where I try to build another package from source via “make“ and I can't make it through the whole process without the pi freezing again. I tried several times, the issue occurs at different places during the build and I noticed that the yellow arrow sometimes flashes in the top right corner before the pi locks up. The process is also very slow, the longest it run was 8 minutes before the pi froze. I use a pi3 with the “official“ 2.5A power supply. No issues with other builds / SD cards.

Schwambo commented 6 years ago

While trying various ways to decrease the "stress" on the pi one of my solutions was creating a swap file. This fixed the problem, maybe consider creating a swap file natively with the build due to the pi's restricted memory?

ether-btc commented 6 years ago

@Schwambo how did you manually create a swap file?

Crazyhead90 commented 6 years ago

Could you share the entire process of how you got it to work, the swapfile etc

ThomasKaiser commented 6 years ago

I noticed that the yellow arrow sometimes flashes in the top right corner before the pi locks up.

https://www.raspberrypi.org/forums/viewtopic.php?t=177477

You run into a hardware issue called under-voltage. There's no software fix available for this only mitigations. The so called 'firmware' controlling the hardware monitors available voltage and as soon it drops below 4.65V the symbol will be shown and all subsystems are underclocked. Sometimes to no avail and you experience a brownout.

If you use the official RPi power supply you should check the Micro USB receptacle since then it's either the Micro USB jack (contact resistance) or the PSU dying. The cable between PSU and board is 18AWG rated so should not be an issue.

Seriously: yellow lightning bolt --> under-voltage that can only be fixed with a hardware change.

ThomasKaiser commented 6 years ago

With most recent kernel (hoping for @bamarni to provide a new release soon) we can now check for this problem on our own and without using vcgencmd get_throttled. All that's needed then is dmesg | grep -i voltage. See https://github.com/raspberrypi/linux/issues/2367 for details!

jlong777 commented 6 years ago

Create a swap file:

$ sudo dd if=/dev/zero of=/swap bs=512M count=1
$ sudo chown root:root /swap
$ sudo chmod 0600 /swap
$ sudo mkswap /swap
$ sudo swapon /swap

and add to /etc/fstab:

/swap   none    swap    sw  0   0
ThomasKaiser commented 6 years ago

Create a swap file

Swap on SD card is a horrible idea. In general and especially when the real problem is freezes/instabilities caused by under-voltage. @Schwambo clearly wrote he's suffering from this common hardware problem: 'I noticed that the yellow arrow sometimes flashes in the top right corner before the pi locks up'

jlong777 commented 6 years ago

True, it's not a great idea; implementation depends on what trade-offs you are willing to consider. raspian creates a 100M swap file by default at /var/swap, controlled by /etc/dphys-swapfile, and managed as a service. Personally, I turn it off, and run everything off of a USB hard drive w/swap partition.