BOINC freezes Raspberry Pi

Message boards : Questions and problems : BOINC freezes Raspberry Pi
Message board moderation

To post messages, you must log in.

1 · 2 · Next

AuthorMessage
batboio

Send message
Joined: 25 Feb 18
Posts: 8
Bulgaria
Message 84900 - Posted: 25 Feb 2018, 9:58:02 UTC

Hello, everyone!

I am trying to run BOINC on my Raspberry Pi 3 Model B (headless). I have the latest Raspbian and my version of BOINC is 7.6.33. The problem is the raspi freezes after a few hours of work. By "freezes" I mean non-responsive to ssh or even ping with either only red LED on or both red and green LEDs constantly on until I unplug it. Any suggestions why this happens or even where to begin the search will be greatly appreciated. Only things I've installed are xrdp and BOINC. Also I have ssh enabled. So far I've tried:

1. Removing xrdp, as at one point I suspected the crashes occured after a login through it.
2. Removing the project asteroids@home from boinc, as there were a few tasks from it that never got completed.
3. Increasing the swap file size to 1GB.
4. Stopping boinc altogether at which point the Raspberry Pi stops freezing.
5. Checking the temperature multiple times at full loads and at idle. Under load the temp never exceeded ~78 degrees. Idle was about 35-40 I think.
6. I have looked through the logs, but I can't pinpoint any issue. Honestly I don't know what to look for.

In case I am missing something I will post again. Also I am sorry if this has been asked before. I've searched google and the forums, but every solution I've found doesn't help me.
ID: 84900 · Report as offensive
Richard Haselgrove
Volunteer tester
Help desk expert

Send message
Joined: 5 Oct 06
Posts: 5082
United Kingdom
Message 84901 - Posted: 25 Feb 2018, 11:03:35 UTC - in response to Message 84900.  

What's your thermal solution?

Do you have a heatsink?
Do you have a fan on (or directed at) the heatsink?
What's the ambient temperature in your environment?
ID: 84901 · Report as offensive
batboio

Send message
Joined: 25 Feb 18
Posts: 8
Bulgaria
Message 84902 - Posted: 25 Feb 2018, 12:20:02 UTC

I have 3 heatsinks and a fan directed at the CPU one. The ambient temperature is about 19 degrees.
ID: 84902 · Report as offensive
Profile Gary Charpentier
Avatar

Send message
Joined: 23 Feb 08
Posts: 2464
United States
Message 84904 - Posted: 25 Feb 2018, 17:09:20 UTC

Is the Pi just not responding to ssh, or has it crashed? If crashed it won't be reporting work to BOINC and it likely will be cold.

I haven't had that issue with my Pi, over 120 days up, but I do have a HDMI cable plugged in to a TV that is off and keyboard and mouse in the USB. I doubt that makes a difference. I do have VNC server running. Again that shouldn't make a difference.

You might try reinstalling BOINC just to be sure there wasn't corruption. Also check to see that the science applications are running nice.

If that doesn't fix it, it might be a network issue. Try rebooting the router and then see if ssh responds then.
ID: 84904 · Report as offensive
batboio

Send message
Joined: 25 Feb 18
Posts: 8
Bulgaria
Message 84912 - Posted: 26 Feb 2018, 7:30:36 UTC - in response to Message 84904.  

I've tried turning on the computation yesterday evening. The raspi has now crashed again. It seems to be hot. Only the red light is on however (constantly). My router seems to be working fine as there are a few other devices connected, but the raspi is not listed there.

Another thing comes to my mind. When first installing boinc I accidentaly typed just "boinc" in the terminal, which failed and then I started getting "Authorization Failure : -155" messages on most of boinccmd commands. This persisted even after a purge and new install. In order to use boinccmd I need to first cd into /var/lib/boinc-client and then everything works. As a final solution I guess I can try a fresh install of Raspbian.

I will try reinstalling boinc at some point today and see what happens.

Any other suggestions are welcome. Also what should I look for in the log files?
ID: 84912 · Report as offensive
Profile Jord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15480
Netherlands
Message 84914 - Posted: 26 Feb 2018, 12:02:53 UTC - in response to Message 84912.  
Last modified: 26 Feb 2018, 12:06:46 UTC

Only the red light is on however (constantly).
It helps to know what the lights indicate: Raspberry Pi Power / Start-up

And a lot more information about what the ACT light (green) does, and what could be the cause when it's not blinking, in the Is your Pi not booting? thread over on the RaspberryPi forums.
Edit: A lot more people with older models, who had intermittent freeze problems. Perhaps ask on their forums if someone knows?
ID: 84914 · Report as offensive
MarkJ
Volunteer tester
Help desk expert

Send message
Joined: 5 Mar 08
Posts: 272
Australia
Message 84915 - Posted: 26 Feb 2018, 12:06:41 UTC
Last modified: 26 Feb 2018, 12:08:22 UTC

The red led is supposed to be on constantly. Does it blink? If so you have a power supply issue. Is your power supply rated for 2.5A? What other peripherals are connected to the Pi via the USB?

The Pi3 needs active cooling, a heatsink and fan on the Soc. The other chips don't require them.

You didn't say what version of Raspbian. Mine says "Linux *** 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l" which is the Stretch release. I installed Jessie-Lite. If you're running headless then there is no need for the other stuff.

Swap - You shouldn't be using swap at all. When you ran Raspi-Config hopefully you reduced the video memory to the minimum (16). You can check if swap is being used by doing a top command. Press Q to exit. The 3rd and 4th line should say how much memory its using. This is what one of mine looks like while running 4 Einstein BRP4 tasks.

KiB Mem : 1000312 total, 223568 free, 564352 used, 212392 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 373736 avail Mem
MarkJ
ID: 84915 · Report as offensive
batboio

Send message
Joined: 25 Feb 18
Posts: 8
Bulgaria
Message 84921 - Posted: 27 Feb 2018, 9:00:36 UTC
Last modified: 27 Feb 2018, 9:07:00 UTC

@Ageless: I'll check out the links. Thank you! I've tried posting on the raspi forums before coming here, but no replies yet.

@MarkJ: The red light is not blinking and I am using the official power supply from raspberry - it was in a starter kit with the raspi and an SD card preinstalled with NOOBS.

The version of Raspbian is "Linux *** 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux" - the same as yours it seems. I prefer not to use light though as I want to be able to xrdp into the raspi sometimes.

Also what makes me not want to use swap? This shouldn't lead to freezing I think. I guess it will be better for the SD card though.

Edit: I think I saw after one of the crashes in the boinc log files that computation was suspended because computer is in use. This was right before the crash as far as I could tell. Seeing that the raspi is hot a few hours after the freeze is it possible that some other process is requesting cpu time? I've set "<suspend_cpu_usage>90.000000</suspend_cpu_usage>" in the global_prefs_override. I will try reducing this now to see what happens.
ID: 84921 · Report as offensive
MarkJ
Volunteer tester
Help desk expert

Send message
Joined: 5 Mar 08
Posts: 272
Australia
Message 84923 - Posted: 27 Feb 2018, 10:26:27 UTC - in response to Message 84921.  
Last modified: 27 Feb 2018, 10:27:02 UTC

I prefer not to use light though as I want to be able to xrdp into the raspi sometimes.

Raspbian comes with SSH. You need to enable it via Raspi-Config.

All mine run headless, I just use putty to occasionally login to them an apply updates. If you have a windows PC you can use BOINCtasks to manage the BOINC side of things as well so you rarely need to login to them. Hopefully you also have a firewall on it as there is malware that specifically tries to brute-force password attack the Pi user and then installs bitcoin mining software on them.

Also what makes me not want to use swap? This shouldn't lead to freezing I think. I guess it will be better for the SD card though.

Swap is slow, even on a normal PC. Reducing the video ram helps free up some for other tasks to use. The Pi isn't fast with its SD card so if you can reduce disk access that makes it go faster. I have BOINC set to write checkpoint files every 600 (the default is 60) seconds. The SD cards also wear out so you'll need to reflash and/or replace them every now and then.

Have you managed to monitor the memory usage (via top)?

Edit: I think I saw after one of the crashes in the boinc log files that computation was suspended because computer is in use. This was right before the crash as far as I could tell. Seeing that the raspi is hot a few hours after the freeze is it possible that some other process is requesting cpu time? I've set "<suspend_cpu_usage>90.000000</suspend_cpu_usage>" in the global_prefs_override. I will try reducing this now to see what happens.

I have mine set to run always so they don't suspend. Memory usage is set to to 60% when in use and 90% when idle. Checkpoint as above.

What project apps are you running on it when it crashes? There used to be a kernel bug that caused the Seti app to crash but that was fixed almost a year ago.
MarkJ
ID: 84923 · Report as offensive
Profile Jord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15480
Netherlands
Message 84924 - Posted: 27 Feb 2018, 10:40:08 UTC - in response to Message 84923.  
Last modified: 27 Feb 2018, 10:40:49 UTC

Got any advice for the firewall, Mark? My Pi might want one as well once I resurrect it. Or does a NAT router suffice?
ID: 84924 · Report as offensive
Profile Gary Charpentier
Avatar

Send message
Joined: 23 Feb 08
Posts: 2464
United States
Message 84951 - Posted: 27 Feb 2018, 23:29:36 UTC - in response to Message 84924.  
Last modified: 27 Feb 2018, 23:30:32 UTC

Got any advice for the firewall, Mark? My Pi might want one as well once I resurrect it. Or does a NAT router suffice?

Biggest advice is change the default password!
NAT should be fine. Mangle the port numbers to the outside world if you allow anything through. Also you should set up the hosts.deny and hosts.allow files.
ID: 84951 · Report as offensive
Profile Jord
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 15480
Netherlands
Message 84952 - Posted: 27 Feb 2018, 23:52:03 UTC - in response to Message 84951.  

Biggest advice is change the default password!
LOL, changed the login name and password a day after I bought the thing back in 2009. :)
ID: 84952 · Report as offensive
Profile Gary Charpentier
Avatar

Send message
Joined: 23 Feb 08
Posts: 2464
United States
Message 84953 - Posted: 28 Feb 2018, 0:01:10 UTC - in response to Message 84952.  

Biggest advice is change the default password!
LOL, changed the login name and password a day after I bought the thing back in 2009. :)

We all might be surprised how many toasters, baby monitors and thermostats are mining crypto currency. Or maybe not because we know to change passwords.
ID: 84953 · Report as offensive
batboio

Send message
Joined: 25 Feb 18
Posts: 8
Bulgaria
Message 84965 - Posted: 28 Feb 2018, 8:02:11 UTC - in response to Message 84923.  

Lots of things to consider. Thank you.

The active tasks were all from seti. I didn't have much free time yesterday so I decided to try the easiest route and removed the seti project. 16.5 hours later it still hasn't crashed. Hopefully that was the problem. Will report again in a few days if everything is still running (or earlier if not :)).
ID: 84965 · Report as offensive
MarkJ
Volunteer tester
Help desk expert

Send message
Joined: 5 Mar 08
Posts: 272
Australia
Message 84966 - Posted: 28 Feb 2018, 10:46:54 UTC - in response to Message 84924.  
Last modified: 28 Feb 2018, 11:46:50 UTC

Got any advice for the firewall, Mark? My Pi might want one as well once I resurrect it. Or does a NAT router suffice?

I’ll dig out my install notes. Basically there was an iptables one described on the Debian wiki and I took that and added a few things. Will post it later. I use almost the same script on the Raspberry Pi’s as the Debian PC’s.

See Debianfirewall
MarkJ
ID: 84966 · Report as offensive
MarkJ
Volunteer tester
Help desk expert

Send message
Joined: 5 Mar 08
Posts: 272
Australia
Message 84967 - Posted: 28 Feb 2018, 11:29:04 UTC
Last modified: 28 Feb 2018, 11:48:00 UTC

This adds an iptables based firewall that will be executed when Debian starts up.

Note:
xxx is defined in /etc/hosts and is the name of a machine we allow to remote in to this machine via SSH and to connect to the BOINC client. It is recommended that the xxx machine has a static IP address otherwise this won't work. If you don't want to allow any remote access then comment out (by putting a # symbol in front) the last 2 lines of the firewall_example.sh script.

Nano is a text editor. To save your file press Ctrl-O and when prompted for the filename just press the Enter key. To exit press Ctrl-X

Debian iptables firewall
1. sudo nano /etc/systemd/system/firewall.service and paste the following in:

[Unit]
Description=Add Firewall Rules to iptables

[Service]
Type=oneshot
ExecStart=/etc/firewall_example.sh

[Install]
WantedBy=multi-user.target


2. sudo nano /etc/firewall_example.sh and paste the following in:

#!/bin/sh
# A very basic IPtables / Netfilter script
PATH='/sbin'

# Flush the tables to apply changes
iptables -F
ip6tables -F

# Default policy is to drop everything but our output to the internet
iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT

ip6tables -P FORWARD DROP
ip6tables -P INPUT DROP
ip6tables -P OUTPUT ACCEPT

# Allow established connections (the responses to our outgoing traffic)
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
ip6tables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow local programs that use loopback (Unix sockets)
iptables -A INPUT -s 127.0.0.0/8 -d 127.0.0.0/8 -i lo -j ACCEPT
ip6tables -A INPUT -s ::1/128 -d ::1/128 -i lo -j ACCEPT

# Allow xxx to SSH into this machine and to RPC to BOINC
iptables -A INPUT -s xxx -p tcp --dport 22 -m state --state NEW -j ACCEPT
iptables -A INPUT -s xxx -p tcp --dport 31416 -m state --state NEW -j ACCEPT


3. Enable the service by typing: sudo systemctl enable firewall.service

4. Set execute permissions:

sudo chmod +x /etc/firewall_example.sh
sudo chmod +x /etc/systemd/system/firewall.service

5. Reboot the machine (sudo reboot)
MarkJ
ID: 84967 · Report as offensive
MarkJ
Volunteer tester
Help desk expert

Send message
Joined: 5 Mar 08
Posts: 272
Australia
Message 84968 - Posted: 28 Feb 2018, 11:37:34 UTC
Last modified: 28 Feb 2018, 11:41:10 UTC

This adds an iptables based firewall that will be executed when Raspbian starts up. Its basically the same as the above one except in how its started.

Note:
xxx is defined in /etc/hosts and is the name of a machine we allow to remote in to this Rpi via SSH and to connect to the BOINC client. It is recommended that the xxx machine has a static IP address otherwise this won't work. If you don't want to allow any remote access then comment out (by putting a # symbol in front) the last 2 lines of the firewall_example.sh script.

Nano is a text editor. To save your file press Ctrl-O and when prompted for the filename just press the Enter key. To exit press Ctrl-X


Raspbian iptables firewall
1. Type sudo nano /etc/rc.local and paste the following in:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
set –e

# Launch my netfilter rules
if [ -e '/etc/firewall_example.sh' ]
then
/bin/sh '/etc/firewall_example.sh'
fi
exit 0


2. sudo nano /etc/firewall_example.sh and paste the following in:

#!/bin/sh
# A very basic IPtables / Netfilter script
PATH='/sbin'

# Flush the tables to apply changes
iptables -F
ip6tables -F

# Default policy is to drop everything but our output to the internet
iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT

ip6tables -P FORWARD DROP
ip6tables -P INPUT DROP
ip6tables -P OUTPUT ACCEPT

# Allow established connections (the responses to our outgoing traffic)
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
ip6tables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow local programs that use loopback (Unix sockets)
iptables -A INPUT -s 127.0.0.0/8 -d 127.0.0.0/8 -i lo -j ACCEPT
ip6tables -A INPUT -s ::1/128 -d ::1/128 -i lo -j ACCEPT

# Allow xxx to SSH into this machine and to RPC to BOINC
iptables -A INPUT -s xxx -p tcp --dport 22 -m state --state NEW -j ACCEPT
iptables -A INPUT -s xxx -p tcp --dport 31416 -m state --state NEW -j ACCEPT


3. Reboot the Pi (sudo reboot)
MarkJ
ID: 84968 · Report as offensive
batboio

Send message
Joined: 25 Feb 18
Posts: 8
Bulgaria
Message 84995 - Posted: 3 Mar 2018, 8:53:02 UTC

Close to 4 days uptime now, so I guess SETI was the problem. I will try installing XRDP soon to see whether this makes things worse, as somehow I still feel there was a connection. Hopefully not :)
ID: 84995 · Report as offensive
batboio

Send message
Joined: 25 Feb 18
Posts: 8
Bulgaria
Message 85538 - Posted: 29 Mar 2018, 16:39:16 UTC

This is a pretty old thread by now, but I just want to post a small update on my situation since I've had another 2-3 freezes. Current uptime is ~11 days. To manage this I've changed 3 things in the global_prefs_override.xml:

1. <work_buf_min_days>0.000000</work_buf_min_days>;
2. <work_buf_additional_days>0.000000</work_buf_additional_days>;
3. <cpu_usage_limit>90.000000</cpu_usage_limit>.

CPU usage limit was 100 before that and there were some default numbers for the work buffer (not sure buffer is the correct word). I need to add that there doesn't seem to be anything wrong with the SETI project for now, as I've added it again and I am completing work units from it. I will probably try changing the CPU usage back to 100 next to see what happens.
ID: 85538 · Report as offensive
thersites

Send message
Joined: 8 Apr 18
Posts: 2
United States
Message 85794 - Posted: 8 Apr 2018, 17:34:42 UTC - in response to Message 84900.  

I've had crash problems that were cured with a new SD card. Good SD cards don't last forever and cheap ones can be very short lived.
ID: 85794 · Report as offensive
1 · 2 · Next

Message boards : Questions and problems : BOINC freezes Raspberry Pi

Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.