Go Back   Overclockers Forums > Teams > Folding Team > Folding in linux
Reply

Welcome to the Overclockers Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

 
Thread Tools
Old 03-11-05, 10:04 PM   #1
aeiou
Member



Join Date: Oct 2004
Location: Madison, WI
 
Folding in linux

I'm having some dificulties folding in linux. I downloaded the 5.02 linux file from stanford, but it was an exe and it wouldn't start. I know I have gotten it to work before in linux, but I don't remember. Also, how do you set it up to restart after a reboot?

__________________
20" iMac 2.4Ghz C2D 4GB ram
aeiou is offline   Reply With Quote
Old 03-11-05, 10:17 PM   #2
{PMS}fishy
Senior A64 Killer

 
{PMS}fishy's Avatar 

Join Date: Dec 2001
Location: Boston, MA
 
chmod +x filename.exe

./filename.exe

As far as auto starting it, you can write a cron job, or a script. There are some option posted in the stickies.

__________________
Pick 2: Speed -- Reliability -- Cost

Trouble Shooting 101:
1. RTFM
2. Repeat Step 1

6ghz Club Member.


cw823 Fan Club Founding Member, are you?
{PMS}fishy is offline   Reply With Quote
Old 03-11-05, 10:31 PM   #3
aeiou
Member



Join Date: Oct 2004
Location: Madison, WI
 
Wait a sec... Can you explain a little more please? I'm kind of a newbee to linux.

__________________
20" iMac 2.4Ghz C2D 4GB ram
aeiou is offline   Reply With Quote
Old 03-11-05, 11:03 PM   #4
samuraisam
Member



Join Date: Nov 2004
 
Are you using a Window Manager?

If so, open the terminal.

cd ~/where/ever/your/exe/is/located
chmod +x FAH502-Linux.exe
./FAH502-Linux.exe -advmethods -verbosity 9 -forceasm

First, you're getting to your dir
Second, you're making it so you can execute it
Third you're executing it

-Sam
samuraisam is offline   Reply With Quote
Old 03-11-05, 11:39 PM   #5
penquissciguy
Member

 
penquissciguy's Avatar 

Join Date: May 2003
Location: Maine
 
If you're running gentoo, you can "emerge foldingathome" and it will install the client and allow you to configure it as a startup service. Works great for me.

Ken

__________________
Is this a holdup?
It's a science experiment!


---------------------------------------------------------------------------------------------
New Project Log: Hack to the Future

My Heatware
penquissciguy is offline   Reply With Quote
Old 03-11-05, 11:40 PM   #6
samuraisam
Member



Join Date: Nov 2004
 
Quote:
Originally Posted by penquissciguy
If you're running gentoo, you can "emerge foldingathome" and it will install the client and allow you to configure it as a startup service. Works great for me.
Woohooo!!

-Sam
samuraisam is offline   Reply With Quote
Old 03-11-05, 11:55 PM   #7
aeiou
Member



Join Date: Oct 2004
Location: Madison, WI
 
nope, running elx (everyone's linux). My brother uses gentoo, but I'm too much of a noob for it.

__________________
20" iMac 2.4Ghz C2D 4GB ram
aeiou is offline   Reply With Quote
Old 03-12-05, 01:01 AM   #8
samuraisam
Member



Join Date: Nov 2004
 
Did you get it figured out?

-Sam
samuraisam is offline   Reply With Quote
Old 03-12-05, 01:31 PM   #9
aeiou
Member



Join Date: Oct 2004
Location: Madison, WI
 
I got it running, but I don't think its going to restart on boot. I don't have any programing skills at all, so I'm not sure what to do.

__________________
20" iMac 2.4Ghz C2D 4GB ram
aeiou is offline   Reply With Quote
Old 03-12-05, 02:18 PM   #10
Arkaine23
Senior Evil Genius

 
Arkaine23's Avatar 

Join Date: Nov 2001
Location: Folding in Houston, Tx
 
From my post in the Ultimate FAH install Guide sticky-

If you follow these instructions, folding will run as a service on your linux box. It will start at boot-time. You will also create a few custom commands that will make it easy to stop, start, reconfigure user/team, and view the folding logfile with simple one-word commands. So this goes a bit beyond just a service install.


Part 1. Shell scripting

These scripts will make managing your folding a little easier and will be step one in setting it up as an automatic service. Only a very slight familiarity with linux is assumed.

Create some new text files by right-clicking your desktop and choosing create new text file. Paste the following scripts into these new text files. For all of these scripts, change the FoldDir variable so that it points to your actual folding directory. For the purposes of this guide, you will also want to make sure to rename your folding client .exe file to FAH502-Linux.exe. If you have not already, you need to make FAH502-Linux.exe executable.

cd /your/folding/directory
(I suggest /home/your_username/fold for the folding directory)
chmod +x FAH502-Linux.exe


Note: I use -advmethods and -forceasm as examples throughout these scripts because I fold big packets. Be sure you know which flags are best for your CPU when using this guide to write your own scripts. At this time, enabling big packets in client.cfg and -advmethods -forceasm is best if you have at least 256mb ram and an SSE-capable CPU.

Script I (I usually name this one foldon)

#!/bin/sh
#This script starts folding@home as a background service
# it uses gromacs flags
# Change your FoldDir variable to refelct your actual folding directory's location
# your folding client's .exe should be named FAH502-Linux.exe
FoldDir=/path/to/your/folding
cd $FoldDir
./FAH502-Linux.exe -advmethods -forceasm > /dev/null &
echo "Starting F@H service..."

Script II (I call this one viewfold)

#!/bin/sh
# This script displays a portion of the folding log file
# tail -20 can be set to any number you want, just not too large
# that will be the number of lines displayed
# Change your FoldDir variable to refelct your actual folding directory's location
FoldDir=/path/to/your/folding
more $FoldDir/FAHlog.txt | tail -20


Script III ( I call this one foldoff)

#!/bin/sh
# This script safely kills folding@home
killall -15 FAH502-Linux.exe


Script IV (this one's optional. Its an easy way to reset the client.cfg file)

#!/bin/sh
#This script starts folding@home and uses gromacs flags
# It also runs the -config option to let you enter new user information
# Change your FoldDir variable to reflect your actual folding directory's location
# your folding client's .exe should be named FAH502-Linux.exe
FoldDir=/path/to/your/folding
cd $FoldDir
./FAH502-Linux.exe -configonly



Part 2. Preparing the scripts for use.

Now, hopefully you've got some new text files and have saved them and named them. The name will also be the command to launch the script from a terminal.

Now you'll want to move them to a location where other executables are kept. I suggest /usr/local/bin. You might need to be root in order to write to that directory, so become root by using the su command. Replace your_user_name in the commands below with your normal username. I assume these files are on your desktop.

su
(enter root's password)

mv /home/your_username_here/Desktop/foldon /usr/local/bin
mv /home/your_username_here/Desktop/foldoff /usr/local/bin
mv /home/your_username_here/Desktop/cfgfold /usr/local/bin
mv /home/your_username_here/Desktop/viewfold /usr/local/bin


Now you need to make these scripts executable.


cd /usr/local/bin
chmod +x foldon
chmod +x foldoff
chmod +x viewfold
chmod +x cfgfold

(That can probably all be done as one command, but for new linux users, repetition of common commands is a good thing. )


Part 3. Making it start when the system boots

This procedure can vary depending on the distro you have. You will either be entering a command into a file (rc.local method), or you will be creating a link to your script in a startup folder (rc5.d method). You should still be root, but if not, become root with the su command.

su
(enter root's password)


Look at your system's /etc directory for some specific files.

cd /etc
ls

You want to find rc.local if it exists. Or if it doesn't, then rc5.d, rc3.d, and rc2.d.


For rc.local:


Open rc.local with a text editor. If you have one you like, good. My example uses vi.

vi rc.local


(press the i key to insert text and type the following line, but replace "your_username" with your normal username)

su -c "/usr/local/bin/foldon" your_username

(To save in vi, press the escape key followed by a :wq and then press enter.)



For rc5.d, rc3.d, and rc2.d:

These folders contain shortcuts to system services (also called init scripts because these scripts can be issued to start, stop, or restart system services). Rc5.d is run control 5 which means the stuff isnside it runs when you boot straight to graphical mode (default from many distros and especially preferred by newbies). Rc3.d and rc2.d are both run levels that go to a text prompt, aka text mode. The difference between them is that rc3.d starts more networking services than rc2.d. If you are unsure you can edit all three of these, though you actually only boot into one of these run levels by default.

ln -s /usr/local/bin/foldon /etc/rc5.d/S99foldon



Step 4. Optional, and only needed if you modified the rc#.d file(s). If you edited rc.local, skip this section.


One problem is that folding will be run by root instead of by an ordinary user. This is not a big deal, but you should run it as a normal user for the sake of this paranoid administrator.


You can leave it as is, or you can do this one last step:

cd /usr/local/bin
cp foldon fold
vi foldon

(press the i key to insert text. Here's what you're looking at. The text in red is what you need to add.)

#!/bin/sh
#This script starts folding@home as a background service
# it uses gromacs flags
# Change your FoldDir variable to refelct your actual folding directory's location
# your folding client's .exe should be named FAH4Console.exe
FoldDir=/path/to/your/folding
cd $FoldDir
su -c "./FAH502-Linux.exe -advmethods -forceasm > /dev/null & " your_username_here


(Make sure to replace your_username_here with your normal username. Save the file by pressing escape and then :wq and enter)

Run this command as root to make sure the permissions for everything are set correctly:
chown -R username:username /your/folding/directory
(where username is the user who will be running folding@home)
Launch the client for the first time as the regular folding user with the cfgfold script and configure it.

Part 5. Congratulations!!


It's not very hard to make desktop icon shortcuts to your scripts or to place shortcuts in a "quick launch bar" in the same style as a windows system. Tune in next time for more Linux tweaking tips....


Please report any errors in this how-to so that they can be corrected ASAP. Updated for v5.02 folding@home.

__________________
Folding.for.team.32.as.OC3d!..The.official.OC3dmark.folding.subteam.
Farm status: C2Dx1 Ati 2600 x1 Borging: C2D's @ 1866-2400 40/46

Last edited by Arkaine23; 03-12-05 at 02:32 PM.
Arkaine23 is offline   Reply With Quote
Old 03-12-05, 02:42 PM   #11
samuraisam
Member



Join Date: Nov 2004
 
Talking Oh Nooos!

For Linux Command Line Install

1. Create a directory reserved for the Folding@Home Client, if you do not have one already. This can be accomplished by typing `mkdir [path-to-directory]` in the terminal. For example, I keep my client /home/fah1 so I would type `mkdir /home/fah1`.

2. Change permissions on that directory to full permissions for the owner, and read/execute permissions for everybody else. This can be accomplished by typing `chmod 755 [path-to-directory]` in the terminal. In my case, this would be `chmod 755 /home/fah1`.

3. Change permissions on your Folding@Home Client next. Do this by typing `chmod 755 [path-to-client]/FAH502-Linux.exe` in the terminal. In my case, `chmod 755 /home/samuraisam/FAH502-Linux.exe`, because I downloaded it to /home/samuraisam.

4. Move your Folding@Home Client to the directory you created earlier. Do this by typing `mv [path-to-client]/FAH502-Linux.exe [path-to-directory]` in the terminal. For me, this would be `mv /home/hpxchan/FAH502-Linux.exe /home/fah1/`.

5. Change the current directory to the Folding@Home Client's new directory by typing `cd [path-to-directory]` in the terminal. In my case, I would type `cd /home/fah1`.

6. Run the Folding@Home Client with the -configonly flag to configure it for the first time. Do this by typing `./FAH502-Linux.exe -configonly` in the terminal. Enter your desired username and 32 for the team number when prompted.

7. To run the Folding@Home Client silently (after you have configured it in step 6), change the current directory to the Folding@Home Client's directory by typing `cd [path-to-client]` in the terminal (again, in my case, this would be `cd /home/fah1`). Next, run the client silently by typing in the terminal `./FAH502-Linux.exe [flags] [your-shell's-method-of-output-redirection]`. In the following code example, I run the Folding@Home Client with my desired flags (flags are out of the scope of this tutorial), and silence it, using the bash shell (it should work just as well on sh, among a few others):
bash: `./FAH502-Linux.exe -forceasm -advmethods -verbosity 9 >/dev/null 2>&1 &`

If you don't want to type those commands every time to start the Folding@Home client, you could create a simple script to do it for you. In my example, this script is named startfah, and it runs on the sh shell (for ultimate compatibility).

startfah:
Code:
         #!/bin/sh
         cd /home/fah1
         ./FAH502-Linux.exe -forceasm -advmethods -verbosity 9 >/dev/null 2>&1 &
         echo "FAH502-Linux started!"

To make F@H Automagically start at startup

You have many options available to you, but it is often easiest simply to make use of Cron. Assuming your startup script resides at /usr/sbin/startfah and you want to run it as root, add this line to the end of the crontab (usually /etc/crontab), and you're set:
Code:
@reboot  root  exec /usr/sbin/startfah
Alternatively, you could run `crontab -e` to invoke an editor on your user's crontab, and enter in:
Code:
@reboot exec /usr/sbin/startfah


-Sam
samuraisam is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 09:59 AM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.