Difference between revisions of "Folding@home"

From ArchWiki
Jump to navigation Jump to search
(fah-config uses /var/lib/fah and not /var/opt/fah; modify directions to reflect correct working directory)
 
(35 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[Category:Mathematics and science]]
+
[[Category:Volunteer computing]]
From the [https://aur.archlinux.org/packages.php?do_Details=1&ID=11852&O=0&L=&C=&K=folding&SB=&SO=&PP=&do_MyPackages=&do_Orphans=&SeB= AUR package page]: "''Folding@home is a distributed computing project which studies protein folding, misfolding, aggregation, and related diseases.''"
+
[[ja:Folding@home]]
 +
From the project [http://folding.stanford.edu/ home page]:
 +
:Help Stanford University scientists studying Alzheimer's, Huntington's, Parkinson's, and many cancers by simply running a piece of software on your computer. The problems we are trying to solve require so many calculations, we ask people to donate their unused computer power to crunch some of the numbers. In just 5 minutes... Add your computer to over 333,684 others around the world to form the world's largest distributed supercomputer.
  
Please see the [http://folding.stanford.edu/ Folding@home site] for a fuller description.
 
 
== Installation ==
 
== Installation ==
  
Just install "foldingathome" from the AUR.
+
[[Install]] the {{AUR|foldingathome}} package.  In order to use your GPU for folding (highly recommended), you'll need the appropriate [[GPGPU#OpenCL|OpenCL]] package for your GPU.  Nvidia users can also use [[CUDA]].
  
  $ yaourt -S foldingathome
+
== Configuration ==
 +
 
 +
Run {{ic|/opt/fah/FAHClient --configure}} as root to generate a configuration file at {{ic|/opt/fah/config.xml}} (the Arch Linux team number is 45032). Alternately, you can write {{ic|/opt/fah/config.xml}} by hand and use {{ic|/opt/fah/sample-config.xml}} as a reference. With a config file in place, you can start the daemon, check its status, and make the daemon automatically start at boot time.
 +
 
 +
  $ cd /opt/fah
 +
# ./FAHClient --configure
 +
 
 +
Then [[start/enable]] the {{ic|foldingathome.service}} systemd unit.
  
== Configuration ==
+
=== The graphical way ===
  
===The graphical way===
+
You can manage the daemon by opening a web browser and heading to http://localhost:7396/. Alternately, you can install {{AUR|fahcontrol}} and use the FAHControl program.
  
Simply run {{ic|./FAHClient --configure}} in {{ic|/opt/fah/}} to configure your client for the first time. Afterwards you can use a webbrowser or FAHControl on the same machine to set slots.
+
The daemon can also be controlled remotely. Instructions for doing so are listed in {{ic|/opt/fah/sample-config.xml}}. Remember to open firewall ports if necessary.
If you want to control it from a remote host, you have to remove the proxy line {{ic|<nowiki><proxy v=':8080'/></nowiki>}} and perhaps add an "allow" entry and password entry.  
 
<allow v='<ip of the host supposed to be controling the machine>'/>
 
<password v='password'/>
 
  
You can also allow a remote host to connect to the python web server.
+
=== The terminal way ===
Just add a line like this:
 
<web-allow v='ip of the remote host'/>
 
  
===The terminal way===
+
To see the current progress of foldingathome, simply {{ic|$ tail /opt/fah/log.txt}}.
In order to edit the configuration, edit the file "client.xml" in {{ic|/opt/fah}} with the editor of your choice.
 
  
The most important settings here are:
+
The behaviour of foldingathome can be customized by editing {{ic|/opt/fah/config.xml}}. Some options that can be specified:
  
*username, username associated to the work-units you return (not related to the User variable in {{ic|/etc/systemd/system/foldingathome.service}}).
+
* bigpackets, defines whether you will accept memory intensive work loads. If you have no problem with Folding@home using up more of your RAM, then set this to big. Other settings are normal and small.
<user v='your username'/>
+
* passkey, to uniquely identify you. Though not needed, it provides some measure of security. For details, see [http://folding.stanford.edu/English/FAQ-passkey]
*team, the team number you wish to contribute points to (earned for work units returned), you will of course want to fill in 45032, the arch-linux team number.
 
<team v='your team number'/>
 
*bigpackets, defines whether you will accept memory intensive work loads. If you have no problem with Folding@home using up more of your RAM, then set this to big. Other settings are normal and small.
 
*passkey to identify your machine. You can get one of these on the homepage. They are used to distinguish different users and/or clients.
 
{{note|A passkey is not actually needed. It is only used to preserve your other stats, if a client running under your own username is going nuts and is sending wrong results!}}
 
 
  <passkey v='passkey'/>
 
  <passkey v='passkey'/>
 +
* Slots for CPU or GPU
 +
<slot id='0' type='CPU'/>
  
*Slots for CPU or GPU
+
=== Run f@h with limited privileges ===
  <slot id='0' type='CPU'/>
+
It's not necessary to run folding with root privileges.  The easy way is to use {{AUR|foldingathome-noroot}}, which makes use of {{ic|systemd}}'s {{ic|DynamicUser}} feature.  Note that certain files are in different locations, and there is a script {{ic|/opt/fah/fah-config}} to generate the {{ic|config.xml}}.  To set it up manually, read on.
  
After editing that, run
+
----  
  # systemctl start foldingathome
 
  
to start Folding@home up.
+
Create a dedicated user {{ic|fah}} for folding without critical privileges:
 +
# useradd -u 999 -s /sbin/nologin fah
  
Assuming it all ran correctly, you will want to start it when the system boots:
+
{{Note|If -u 999 is already taken, choose another number below 1000 to make login managers hide the user.}}
# systemctl enable foldingathome
 
  
Folding@home is now installed and running.
+
Now [[edit]] the {{ic|foldingathome.service}} to use the new user:
  
== Multi-Core CPUs and Folding@home ==
+
{{hc|# systemctl edit foldingathome.service|2=
 +
[Service]
 +
User=fah
 +
WorkingDirectory=/var/lib/fah
 +
ExecStart=
 +
ExecStart=/opt/fah/FAHClient --config /var/lib/fah/config.xml --exec-directory=/opt/fah --data-directory=/var/lib/fah
 +
}}
  
=== A Quick Note On Hyperthreading ===
+
Make the user {{ic|fah}} own it:
If you have a single-core hyperthreading CPU, you may be tempted to follow the multi-core instructions. It is highly recommenced that you '''''do not''''' do this as the Folding@home team prefers fewer results quickly, than more results slowly. There is also a time-limit on work-units, so if it runs slower, your work-units may not be returned in time, and so distributed to another user. If you have one core, run one folding process.
+
# chown -R fah:fah /var/lib/fah
  
=== Multiple  Folding@home Installs ===
+
[[Start]] {{ic|foldingathome.service}}.
  
Multiple installations of FAH on a single machine are useless, as in v7, you can use slots for every workload. The software is uniform now for gpu and cpu.
+
== Monitoring work-unit progress ==
  
== Monitoring Work-Unit Progress ==
+
There are several ways of monitoring the progress of your FAH clients, both on the command line and by GUI.
There are several ways of monitoring the progress of your FAH client/s, both on the command line and by GUI.  
 
  
 
The FAHControl software distributed by folding at home provides you with efficient means to control remote hosts.
 
The FAHControl software distributed by folding at home provides you with efficient means to control remote hosts.
Line 65: Line 68:
 
a connection to the remote host and show you the progress in a seperate client tab.
 
a connection to the remote host and show you the progress in a seperate client tab.
  
In AUR there is silent blades [https://aur.archlinux.org/packages.php?do_Details=1&ID=7788&O=0&L=&C=&K=folding&SB=&SO=&PP=&do_MyPackages=&do_Orphans=&SeB= fahmon], which provides a GUI with the ability to watch multiple clients and get info on the work-unit itself. Fahmon has a dedicated site at [http://www.fahmon.net/ http://www.fahmon.net/]
+
In AUR there is {{AUR|fahmon}}{{Broken package link|{{aur-mirror|fahmon}}}}, which provides a GUI with the ability to watch multiple clients and get info on the work-unit itself. Fahmon has a dedicated site at [http://www.fahmon.net/ http://www.fahmon.net/]
  
On the CLI, you can add a command to your .bashrc , .zshrc or .whateverrc :
+
On the CLI, you can add a command to your shell configuration file (e.g: ''.bashrc'' or ''.zshrc''). Replace ''fah_user'' with the actual user first.
  
fahstat() {
+
{{bc|
echo
+
fahstat() {
echo `date`
+
        echo
echo
+
        echo $(date)
cat /opt/fah/FAH_USER/unitinfo.txt   #(replacing FAH_USER first)
+
        echo
}
+
        cat /opt/fah/''fah_user''/unitinfo.txt
 +
}
 +
}}
  
 
Or for multiple clients :
 
Or for multiple clients :
  
 +
{{bc|
 
  fahstat() {
 
  fahstat() {
 
         echo
 
         echo
         echo `date`
+
         echo $(date)
 
         echo
 
         echo
         echo "Core 1:";cat /opt/fah/FAH_USER/unitinfo.txt     #(replace FAH_USER first)
+
         echo "Core 1:";cat /opt/fah/''fah_user''/unitinfo.txt
 
         echo
 
         echo
         echo "Core 2:";cat /opt/fah2/FAH_USER/unitinfo.txt     #(replace FAH_USER first)
+
         echo "Core 2:";cat /opt/fah2/''fah_user''/unitinfo.txt
 
  }
 
  }
 +
}}
 +
 +
Also, replacing {{ic|cat}} with {{ic|tail -n1}} will give just the percentage of work unit complete.
  
Also, replacing cat with tail -n1 will give just the percentage of work unit complete.
+
On foldingathome-smp 6.43, the ''unitinfo.txt'' file is not placed inside the user folder. The correct directory would be {{ic|/opt/fah-smp/unitinfo.txt}}.
  
On foldingathome-smp 6.43, the unitinfo.txt file is not placed inside the user folder. The correct directory would be {{ic|/opt/fah-smp/unitinfo.txt}}.
+
== See also ==
  
== External Resources ==
+
* Folding@home [http://folding.stanford.edu/ site]  
*Folding@home [http://folding.stanford.edu/ Site]  
+
* Folding@home [http://folding.stanford.edu/home/faq/ FAQ]  
*Folding@home [http://folding.stanford.edu/English/FAQ FAQ]  
+
* Folding@home [http://folding.stanford.edu/home/guide/configuration-guide/ Configuration Guide]
*Folding@home [http://folding.stanford.edu/English/FAQ-Configure Configuration FAQ]
+
* Folding@home [http://folding.stanford.edu/home/faq/faq-smp SMP Client FAQ]
*Folding@home Client in the [https://aur.archlinux.org/packages/foldingathome/ AUR]  
+
* Arch Folding@home [http://fah-web.stanford.edu/cgi-bin/main.py?qtype=teampage&teamnum=45032 team page]
*Folding@home [http://folding.stanford.edu/English/FAQ-SMP SMP Client FAQ]
+
* Extended Arch team statistics in [http://folding.extremeoverclocking.com/team_summary.php?s=&t=45032 extremeoverclocking.com]
*Arch Folding@home [http://vspx27.stanford.edu/cgi-bin/main.py?qtype=teampage&teamnum=45032 team page]
 
*Extended Arch team statistics in [http://folding.extremeoverclocking.com/team_summary.php?s=&t=45032 extremeoverclocking.com]
 

Latest revision as of 18:12, 11 January 2020

From the project home page:

Help Stanford University scientists studying Alzheimer's, Huntington's, Parkinson's, and many cancers by simply running a piece of software on your computer. The problems we are trying to solve require so many calculations, we ask people to donate their unused computer power to crunch some of the numbers. In just 5 minutes... Add your computer to over 333,684 others around the world to form the world's largest distributed supercomputer.

Installation

Install the foldingathomeAUR package. In order to use your GPU for folding (highly recommended), you'll need the appropriate OpenCL package for your GPU. Nvidia users can also use CUDA.

Configuration

Run /opt/fah/FAHClient --configure as root to generate a configuration file at /opt/fah/config.xml (the Arch Linux team number is 45032). Alternately, you can write /opt/fah/config.xml by hand and use /opt/fah/sample-config.xml as a reference. With a config file in place, you can start the daemon, check its status, and make the daemon automatically start at boot time.

$ cd /opt/fah
# ./FAHClient --configure

Then start/enable the foldingathome.service systemd unit.

The graphical way

You can manage the daemon by opening a web browser and heading to http://localhost:7396/. Alternately, you can install fahcontrolAUR and use the FAHControl program.

The daemon can also be controlled remotely. Instructions for doing so are listed in /opt/fah/sample-config.xml. Remember to open firewall ports if necessary.

The terminal way

To see the current progress of foldingathome, simply $ tail /opt/fah/log.txt.

The behaviour of foldingathome can be customized by editing /opt/fah/config.xml. Some options that can be specified:

  • bigpackets, defines whether you will accept memory intensive work loads. If you have no problem with Folding@home using up more of your RAM, then set this to big. Other settings are normal and small.
  • passkey, to uniquely identify you. Though not needed, it provides some measure of security. For details, see [1]
<passkey v='passkey'/>
  • Slots for CPU or GPU
<slot id='0' type='CPU'/>

Run f@h with limited privileges

It's not necessary to run folding with root privileges. The easy way is to use foldingathome-norootAUR, which makes use of systemd's DynamicUser feature. Note that certain files are in different locations, and there is a script /opt/fah/fah-config to generate the config.xml. To set it up manually, read on.


Create a dedicated user fah for folding without critical privileges:

# useradd -u 999 -s /sbin/nologin fah
Note: If -u 999 is already taken, choose another number below 1000 to make login managers hide the user.

Now edit the foldingathome.service to use the new user:

# systemctl edit foldingathome.service
[Service]
User=fah
WorkingDirectory=/var/lib/fah
ExecStart=
ExecStart=/opt/fah/FAHClient --config /var/lib/fah/config.xml --exec-directory=/opt/fah --data-directory=/var/lib/fah

Make the user fah own it:

# chown -R fah:fah /var/lib/fah

Start foldingathome.service.

Monitoring work-unit progress

There are several ways of monitoring the progress of your FAH clients, both on the command line and by GUI.

The FAHControl software distributed by folding at home provides you with efficient means to control remote hosts. Just add another client with the corresponding button "Add" and enter the name, ip address, port and password (if you set one) and hit save. The software should now try to establish a connection to the remote host and show you the progress in a seperate client tab.

In AUR there is fahmonAUR[broken link: archived in aur-mirror], which provides a GUI with the ability to watch multiple clients and get info on the work-unit itself. Fahmon has a dedicated site at http://www.fahmon.net/

On the CLI, you can add a command to your shell configuration file (e.g: .bashrc or .zshrc). Replace fah_user with the actual user first.

fahstat() {
        echo
        echo $(date)
        echo
        cat /opt/fah/fah_user/unitinfo.txt
}

Or for multiple clients :

 fahstat() {
         echo
         echo $(date)
         echo
         echo "Core 1:";cat /opt/fah/fah_user/unitinfo.txt
         echo
         echo "Core 2:";cat /opt/fah2/fah_user/unitinfo.txt
 }

Also, replacing cat with tail -n1 will give just the percentage of work unit complete.

On foldingathome-smp 6.43, the unitinfo.txt file is not placed inside the user folder. The correct directory would be /opt/fah-smp/unitinfo.txt.

See also