Building seti app for the Raspberry Pi

Message boards : Number crunching : Building seti app for the Raspberry Pi
Message board moderation

To post messages, you must log in.

1 · 2 · Next

AuthorMessage
Tom Rinehart
Volunteer tester

Send message
Joined: 12 Dec 01
Posts: 107
Credit: 1,485,196
RAC: 4,417
United States
Message 1756163 - Posted: 14 Jan 2016, 4:35:28 UTC

I'm trying to build the fastest v8 seti_boinc app I can for the Raspberry Pi - separate apps for the v1 Pi and the v2 Pi.

The Raspbian version is 2015-11-21-raspbian-jessie-lite, so it is using gcc 4.9.2. My first question is what are the optimum CFLAGS? I'm using the following:

Raspberry Pi v1 (A, B, A+, B+, Zero)

nano ~/.bashrc

At the end of the file add:

CC=gcc
export CC

CFLAGS="-march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -O3"
export CFLAGS

CXXFLAGS="$CFLAGS"
export CXXFLAGS

On the Raspberry Pi v2

nano ~/.bashrc

At the end of the file add:

CC=gcc
export CC

CFLAGS="-march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -ffast-math -funsafe-math-optimizations -O3"
export CFLAGS

CXXFLAGS="$CFLAGS"
export CXXFLAGS
ID: 1756163 · Report as offensive
Profile [FI] OIKARINEN
Volunteer tester

Send message
Joined: 7 Nov 13
Posts: 12
Credit: 469,849
RAC: 23
Finland
Message 1756882 - Posted: 16 Jan 2016, 15:58:25 UTC

Good luck !
I have 2 Pi devices and can't wait to see them crunching for SETI.

If you make a successful build , Me (and other users) would be really grateful if you share it :)
ID: 1756882 · Report as offensive
ShootY
Avatar

Send message
Joined: 15 Jan 11
Posts: 58
Credit: 9,935,847
RAC: 17,141
Germany
Message 1757297 - Posted: 18 Jan 2016, 9:29:05 UTC - in response to Message 1756882.  

AFAIK there is a SETI version for Raspberry Pi 2 already.
I used this but cancelled it because 1 WU would take over 80 hours to crunch. Therefor my Smartphone is more efficient and only takes 9 to 12 hours.
But a friend told me he was using the same version on his Raspberry Pi but it's not working anymore. Maybe because of an upgrade or so.

If you want to try it by your own - here is the link:
http://www.element14.com/community/community/raspberry-pi/raspberrypi2/blog/2015/05/20/setihome-boinc-on-raspbian-for-raspberry-pi-2
ID: 1757297 · Report as offensive
Tom Rinehart
Volunteer tester

Send message
Joined: 12 Dec 01
Posts: 107
Credit: 1,485,196
RAC: 4,417
United States
Message 1757566 - Posted: 20 Jan 2016, 2:56:41 UTC

From the research I've done so far, it looks like the fastest app for the Raspberry Pi is to have the best CFLAGS/CXXFLAGS and to compile FFTW directly instead of installing it with apt-get. On the Raspberry Pi v2, both FFTW and the SETI apps have optimized code for the NEON instruction set.

FFTW compiles fine on both my v1 and v2 Pis. I struggle getting the SETI app to compile on either. I'm using the 3304 code as suggested by Claggy in a different post. I was able to get it to compile once, but now I can't. I keep getting a can't find the lboinc error part way through the compilation.

I'm going to start with a clean install and see how it goes.
ID: 1757566 · Report as offensive
Tom Rinehart
Volunteer tester

Send message
Joined: 12 Dec 01
Posts: 107
Credit: 1,485,196
RAC: 4,417
United States
Message 1757567 - Posted: 20 Jan 2016, 3:05:19 UTC - in response to Message 1757297.  

AFAIK there is a SETI version for Raspberry Pi 2 already.
I used this but cancelled it because 1 WU would take over 80 hours to crunch. Therefor my Smartphone is more efficient and only takes 9 to 12 hours.
But a friend told me he was using the same version on his Raspberry Pi but it's not working anymore. Maybe because of an upgrade or so.

If you want to try it by your own - here is the link:
http://www.element14.com/community/community/raspberry-pi/raspberrypi2/blog/2015/05/20/setihome-boinc-on-raspbian-for-raspberry-pi-2


There was a SETI version 7 app on beta which your friend must have been using. There isn't a version 8 one yet. I'm trying to build a version 8 app. I've been running a v8 app on one of my Raspberry Pi v2s for a few weeks. It has FFTW from apt-get and I don't think it is properly using the NEON code in the SETI app. It takes a few days per WU. My goal it to improve this some.
ID: 1757567 · Report as offensive
ShootY
Avatar

Send message
Joined: 15 Jan 11
Posts: 58
Credit: 9,935,847
RAC: 17,141
Germany
Message 1757636 - Posted: 20 Jan 2016, 12:08:48 UTC - in response to Message 1757567.  

I don't know exactly but I think he and me were using the same app (see my link I posted). But I deinstalled it a few month ago. He was trying to install it but now it's not working anymore.
ID: 1757636 · Report as offensive
Profile Andy Mitchell
Volunteer tester

Send message
Joined: 15 May 99
Posts: 1
Credit: 1,276,248
RAC: 292
United Kingdom
Message 1757897 - Posted: 21 Jan 2016, 18:15:52 UTC - in response to Message 1756882.  

Good luck !
I have 2 Pi devices and can't wait to see them crunching for SETI.

If you make a successful build , Me (and other users) would be really grateful if you share it :)


I'm one of the other users who'd be very grateful :)
ID: 1757897 · Report as offensive
Tom Rinehart
Volunteer tester

Send message
Joined: 12 Dec 01
Posts: 107
Credit: 1,485,196
RAC: 4,417
United States
Message 1758320 - Posted: 22 Jan 2016, 21:31:22 UTC

I've had success in building seti_boinc for both the Raspberry Pi v1 (A, B, A+, B+, Zero) and the Raspberry Pi v2. The following are my build notes. Please let me if you have other ideas on configuration options or CFLAGS.

Start with a fresh installation of Raspbian version: 2015-11-21-raspbian-jessie-lite on a SD card.

sudo apt-get update
sudo apt-get dist-upgrade


Setup up build environment

Raspberry Pi v1 (A, B, A+, B+, Zero)

nano ~/.bashrc


At the end of the file add:

CC=gcc
export CC

CFLAGS="-march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -O3"
export CFLAGS

CXXFLAGS="$CFLAGS"
export CXXFLAGS



Raspberry Pi v2

nano ~/.bashrc


At the end of the file add:

CC=gcc
export CC

CFLAGS="-march=armv7-a —mfloat-abi=hard -mfpu=neon-vfpv4 -ffast-math -funsafe-math-optimizations -O3"
export CFLAGS

CXXFLAGS="$CFLAGS"
export CXXFLAGS


Logout and log back in to activate the updated .bashrc file.


Get prerequisites

sudo apt-get update
sudo apt-get install git make m4 libtool autoconf pkg-config automake subversion libcurl4-openssl-dev libssl-dev gettext docbook2x docbook-xml libxml2-utils zlib1g-dev libsm-dev libice-dev libxmu-dev libxi-dev libx11-dev libnotify-dev freeglut3-dev libfcgi-dev libjpeg8-dev libxss-dev libxcb-util0-dev libxcb-dpms0-dev libxext-dev libstdc++6-4.7-dev


Get and build the FFTW libraries

wget http://www.fftw.org/fftw-3.3.4.tar.gz
tar zxvf fftw-3.3.4.tar.gz
cd fftw-3.3.4


Pi v1
./configure --enable-float


Pi v2
./configure --enable-float --enable-neon


make
sudo make install
cd ~


Get and build the Boinc libraries - Version 7.4.42 - Raspbian Jessie has Boinc version 7.4.23 available.
git clone https://github.com/BOINC/boinc boinc
cd boinc
git checkout client_release/7.4/7.4.42; git status
./_autosetup
./configure --disable-server --disable-manager LDFLAGS=-static-libgcc --with-boinc-alt-platform=arm-unknown-linux-gnueabihf
make
cd ~


Now get the Seti_boinc source, and build the app:

svn checkout https://setisvn.ssl.berkeley.edu/svn/seti_boinc@3304 seti_boinc

(Currently revisions after 3304 don’t compile, so get 3304)

cd seti_boinc 

./_autosetup

./configure BOINCDIR=/home/pi/boinc --enable-client --enable-static --disable-shared --disable-server --enable-dependency-tracking --with-gnu-ld --disable-altivec --enable-fast-math

make

ls -l client


On Pi v1: if setiathome-8.0.armv6l-unknown-linux-gnueabihf exists, compilation has been successful.
On Pi v2: if setiathome-8.0.armv7l-unknown-linux-gnueabihf exists, compilation has been successful.


Pi v1 App Setup:

cp ~/seti_boinc/client/setiathome-8.0.armv6l-unknown-linux-gnueabihf ~/
cd ~
nano app_info.xml


Copy and paste the following into the file:

<app_info>
    <app>
        <name>setiathome_v8</name>
        <user_friendly_name>SETI@home v8</user_friendly_name>
    </app>
    <file_info>
        <name>setiathome-8.0.armv6l-unknown-linux-gnueabihf</name>
        <executable/>
    </file_info>
    <app_version>
        <app_name>setiathome_v8</app_name>
        <version_num>800</version_num>
        <file_ref>
           <file_name>setiathome-8.0.armv6l-unknown-linux-gnueabihf</file_name>
           <main_program/>
        </file_ref>
    </app_version>
</app_info>


To build a tar.gz to move to another computer:

tar cvzf setiathome-8.0.armv6l-unknown-linux-gnueabihf.tar.gz setiathome-8.0.armv6l-unknown-linux-gnueabihf app_info.xml


To install and run the app you just built on a Raspberry Pi, first install boinc-client:

sudo apt-get install boinc-client


Next attach to the Seti project:

boinccmd --project_attach http://setiathome.berkeley.edu [YOUR KEY GOES HERE]


Copy the app and the app_info.xml files to the project folder:

sudo cp setiathome-8.0.armv6l-unknown-linux-gnueabihf /var/lib/boinc-client/projects/setiathome.berkeley.edu/
sudo cp app_info.xml /var/lib/boinc-client/projects/setiathome.berkeley.edu/


Change the file permissions to boinc:boinc:

sudo chown boinc:boinc /var/lib/boinc-client/projects/setiathome.berkeley.edu/setiathome-8.0.armv6l-unknown-linux-gnueabihf
sudo chown boinc:boinc /var/lib/boinc-client/projects/setiathome.berkeley.edu/app_info.xml


Finally, restart boinc-client so it will use the new app:

sudo /etc/init.d/boinc-client restart


You can check the boinc-client log using:

cat /var/lib/boinc-client/stdoutdae.txt


And you can view the tasks with:

boinccmd --get_tasks



Pi v2 App Setup:

cp ~/seti_boinc/client/setiathome-8.0.armv7l-unknown-linux-gnueabihf ~/
cd ~
nano app_info.xml


Copy and paste the following into the file:

<app_info>
    <app>
        <name>setiathome_v8</name>
        <user_friendly_name>SETI@home v8</user_friendly_name>
    </app>
    <file_info>
        <name>setiathome-8.0.armv7l-unknown-linux-gnueabihf</name>
        <executable/>
    </file_info>
    <app_version>
        <app_name>setiathome_v8</app_name>
        <version_num>800</version_num>
        <file_ref>
           <file_name>setiathome-8.0.armv7l-unknown-linux-gnueabihf</file_name>
           <main_program/>
        </file_ref>
    </app_version>
</app_info>


To build a tar.gz to move to another computer:

tar cvzf setiathome-8.0.armv7l-unknown-linux-gnueabihf.tar.gz setiathome-8.0.armv7l-unknown-linux-gnueabihf app_info.xml


To install and run the app you just built on a Raspberry Pi, first install boinc-client:

sudo apt-get install boinc-client


Next attach to the Seti project:

boinccmd --project_attach http://setiathome.berkeley.edu [YOUR KEY GOES HERE]


Copy the app and the app_info.xml files to the project folder:

sudo cp setiathome-8.0.armv7l-unknown-linux-gnueabihf /var/lib/boinc-client/projects/setiathome.berkeley.edu/
sudo cp app_info.xml /var/lib/boinc-client/projects/setiathome.berkeley.edu/


Change the file permissions to boinc:boinc:

sudo chown boinc:boinc /var/lib/boinc-client/projects/setiathome.berkeley.edu/setiathome-8.0.armv7l-unknown-linux-gnueabihf
sudo chown boinc:boinc /var/lib/boinc-client/projects/setiathome.berkeley.edu/app_info.xml


Finally, restart boinc-client so it will use the new app:

sudo /etc/init.d/boinc-client restart


You can check the boinc-client log using:

cat /var/lib/boinc-client/stdoutdae.txt


And you can view the tasks with:

boinccmd --get_tasks
ID: 1758320 · Report as offensive
Juha
Volunteer tester

Send message
Joined: 7 Mar 04
Posts: 350
Credit: 960,708
RAC: 2,273
Finland
Message 1758347 - Posted: 22 Jan 2016, 22:04:17 UTC - in response to Message 1758320.  

Get and build the Boinc libraries - Version 7.4.42 - Raspbian Jessie has Boinc version 7.4.23 available.


When building science apps you usually should use master branch. API code in client_release branch is not updated once the branch is created. 7.3/7.4 was branched a long time ago.

As for compiler flags, I usually use -march=native when building for myself. At least on x86 GCC replaces that with more flags than just the CPU type.
ID: 1758347 · Report as offensive
BitShock
Volunteer tester

Send message
Joined: 9 Feb 04
Posts: 7
Credit: 1,214,114
RAC: 119
Germany
Message 1758361 - Posted: 22 Jan 2016, 22:43:37 UTC - in response to Message 1757567.  

[quote].... I've been running a v8 app on one of my Raspberry Pi v2s for a few weeks. It has FFTW from apt-get and I don't think it is properly using the NEON code in the SETI app. It takes a few days per WU. My goal it to improve this some.


What was the initial v8 app you had been using for the rasp? Which one could you compile without any error? Was it the native version provided for UNIX system by BOINC?

BTW: Crunching a WU in 80 hours on the raspberry is fine... On my old raspberry B+ v1 sometimes it took about 2 weeks ;)
ID: 1758361 · Report as offensive
Tom Rinehart
Volunteer tester

Send message
Joined: 12 Dec 01
Posts: 107
Credit: 1,485,196
RAC: 4,417
United States
Message 1761375 - Posted: 1 Feb 2016, 19:24:23 UTC

Thanks for the advice some of you have given. Simple seems to provide the best results. The debian-based version of libfftw3-dev has run-time detection of NEON, so you don't need to compile FFTW. Looking through the configuration files and makefiles for seti, it looks like seti adds the appropriate CFLAGS for ARM processors. I've found the following build instructions create the fastest and most stable seti client:


Start with a fresh installation of Raspbian version: 2015-11-21-raspbian-jessie-lite on a SD card.

sudo apt-get update
sudo apt-get dist-upgrade


Get prerequisites

sudo apt-get update
sudo apt-get install git make m4 libtool autoconf pkg-config automake subversion libcurl4-openssl-dev libssl-dev gettext docbook2x docbook-xml
sudo apt-get install libxml2-utils zlib1g-dev libsm-dev libice-dev libxmu-dev libxi-dev libx11-dev libnotify-dev freeglut3-dev libfcgi-dev
sudo apt-get install libjpeg8-dev libxss-dev libxcb-util0-dev libxcb-dpms0-dev libxext-dev libstdc++6-4.7-dev libfftw3-dev



Get and build the Boinc libraries - Current Version

git clone https://github.com/BOINC/boinc boinc
cd boinc
./_autosetup
./configure --disable-server --disable-manager LDFLAGS=-static-libgcc --with-boinc-platform=arm-unknown-linux-gnueabihf
make  (“make -j 4” on the Pi2 to make with all 4 cores)
cd ~


Now get the Seti_boinc source, and build the app:

svn checkout https://setisvn.ssl.berkeley.edu/svn/seti_boinc@3304 seti_boinc
(Currently revisions after 3304 don’t compile, so get 3304)
cd seti_boinc 
./_autosetup
./configure CFLAGS="-O3" CXXFLAGS="-O3" BOINCDIR=/home/pi/boinc --enable-client --enable-static --disable-shared --disable-server --enable-fast-math
make  (“make -j 4” on the Pi2 to make with all 4 cores)


ls -l client


On Pi v1: if setiathome-8.0.armv6l-unknown-linux-gnueabihf exists, compilation has been successful.
On Pi v2: if setiathome-8.0.armv7l-unknown-linux-gnueabihf exists, compilation has been successful.
ID: 1761375 · Report as offensive
SidewinderProject Donor
Volunteer tester
Avatar

Send message
Joined: 15 Nov 09
Posts: 99
Credit: 56,236,281
RAC: 115,548
United States
Message 1762419 - Posted: 5 Feb 2016, 9:47:51 UTC - in response to Message 1761375.  

Thanks for the detailed steps Tom. I just configured my Pi 2 and it's working great.

One issue that came up for me was that compilation failed while running make for the seti_boinc steps:

readwu.cpp:47:20: fatal error: export.h: No such file or directory
#include "export.h"
^
compilation terminated.


Fortunately, another user had the same issue (https://setiathome.berkeley.edu/forum_thread.php?id=78593&postid=1747556#1747556) and after applying his two workarounds the compilation succeeded.

Just a heads up in case anyone else encounters this issue.
ID: 1762419 · Report as offensive
Tom Rinehart
Volunteer tester

Send message
Joined: 12 Dec 01
Posts: 107
Credit: 1,485,196
RAC: 4,417
United States
Message 1762588 - Posted: 5 Feb 2016, 18:41:49 UTC - in response to Message 1762419.  

Thanks for the detailed steps Tom. I just configured my Pi 2 and it's working great.

One issue that came up for me was that compilation failed while running make for the seti_boinc steps:

readwu.cpp:47:20: fatal error: export.h: No such file or directory
#include "export.h"
^
compilation terminated.


Fortunately, another user had the same issue (https://setiathome.berkeley.edu/forum_thread.php?id=78593&postid=1747556#1747556) and after applying his two workarounds the compilation succeeded.

Just a heads up in case anyone else encounters this issue.


I also get the same error, but the app is already built by then.

BTW - Apps for both the Pi1 and Pi2 are now being tested on Beta. These should also work with other Linux armhf computers. We need more testers so please join Beta with your Linux armhf computer: http://setiweb.ssl.berkeley.edu/beta/.
ID: 1762588 · Report as offensive
Profile Eddie CottongimProject Donor
Volunteer tester

Send message
Joined: 15 Sep 01
Posts: 19
Credit: 3,912,506
RAC: 1,753
United States
Message 1763009 - Posted: 7 Feb 2016, 0:25:58 UTC - in response to Message 1762588.  

Joined up with a Pi2/Raspian. Hope that helps! Would be great if support was semi-official so it's easier to keep up to date. I know you can only chase so many platforms, though. Live long and crunch!
ID: 1763009 · Report as offensive
Profile BQL_FFMProject Donor
Volunteer tester
Avatar

Send message
Joined: 25 Jan 04
Posts: 11
Credit: 1,079,627
RAC: 123
Germany
Message 1764871 - Posted: 14 Feb 2016, 14:43:35 UTC - in response to Message 1758320.  

Did the long version with "make -j4". It's now running with 4 cores. Thanks for your post !
ID: 1764871 · Report as offensive
DJStarfox

Send message
Joined: 23 May 01
Posts: 1058
Credit: 918,235
RAC: 261
United States
Message 1765962 - Posted: 18 Feb 2016, 6:37:47 UTC

I read somewhere, long ago, that SETI cannot run when compiled with "-ffast-math" so this option should be removed for accuracy of the calculations. This may still apply.
ID: 1765962 · Report as offensive
Profile Raistmer
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 16 Jun 01
Posts: 5804
Credit: 75,929,553
RAC: 50,671
Russia
Message 1766025 - Posted: 18 Feb 2016, 13:37:46 UTC - in response to Message 1765962.  
Last modified: 18 Feb 2016, 13:38:16 UTC

I read somewhere, long ago, that SETI cannot run when compiled with "-ffast-math" so this option should be removed for accuracy of the calculations. This may still apply.

All opt Windows CPU builds and all Windows OpenCL GPU builds are done with fast math enabled.
ID: 1766025 · Report as offensive
Bowie Xu
Volunteer tester
Avatar

Send message
Joined: 25 Mar 16
Posts: 6
Credit: 5,456,318
RAC: 3,794
China
Message 1774450 - Posted: 27 Mar 2016, 15:13:22 UTC

Hi guys.
Sorry about my dumb question. I am newbie of SETI, just got my pi2 and followed this thread to get setiathome-8.0.armv7l-unknown-linux-gnueab. But how to install this new project into BOINC Manager so I can get work started? This there any post I can check?

Thanks!
ID: 1774450 · Report as offensive
Bowie Xu
Volunteer tester
Avatar

Send message
Joined: 25 Mar 16
Posts: 6
Credit: 5,456,318
RAC: 3,794
China
Message 1774476 - Posted: 27 Mar 2016, 17:22:16 UTC

Ok, I followed the link:
http://boinc.berkeley.edu/trac/wiki/CoreClient
and got my client running but BOINC Manager gives me a Notices says:
"This project doesn't support computers of type arm-unknown-linux-gnueabihf"
ID: 1774476 · Report as offensive
Bowie Xu
Volunteer tester
Avatar

Send message
Joined: 25 Mar 16
Posts: 6
Credit: 5,456,318
RAC: 3,794
China
Message 1774490 - Posted: 27 Mar 2016, 18:00:58 UTC

Me again....
I managed get it working.

Following this link:
https://github.com/dcarrion87/boinc-rpi/raw/master/bin/setiathomev7-armv6l.tar.gz
I download v7 package and extract it to boinc_client folder and copy new v8 executable into that folder and modify app_info.xml, adding all v8 section and it worked!

Because I used "make -j 4" for pi2, it seems BOINC Manager gives me a 4 tasks at a time. And each tasks costs about 116 hours (almost 5 days) to complete.
Is that normal for a pi device?
ID: 1774490 · Report as offensive
1 · 2 · Next

Message boards : Number crunching : Building seti app for the Raspberry Pi


 
©2017 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.