GPU3 client - automatic start on login

Moderators: slegrand, Site Moderators, PandeGroup

GPU3 client - automatic start on login

Postby art_l_j_PlanetAMD64 » Mon Feb 11, 2013 1:38 am

Here is a way to have the GPU3 client start automatically when you login. I can't remember how many times I forgot to do this, until an hour or two later. :oops:

There are 2 files in your home directory (~):
  • .profile starts an xterm window with the GPU3 client running in it
  • startgpu3 executes in the xterm window
There are 4 or 5 files in the ~/fahgpu3 directory:
  • The fahgpu script starts wine and the GPU client
  • .nice has the nice value
  • .verbosity has the verbosity value
  • .gpu has the gpu type (nvidia_g80|nvidia_fermi)
  • The optional .extra_args contains anything else that may be necessary (like -gpu 0)
Here is ~/.profile:
Code: Select all
# ~/.profile
#

# If fahgpu3 has not been started, start it
if [ fahgpu_started != "true" ]; then
    export fahgpu_started="true"
    stty cols 144
    xterm -bg white -fg black -T "Folding@home GPU3 client" -e ./startgpu3 &
fi

Here is ~/startgpu3:
Code: Select all
# ~/startgpu3
#

cd ~/fahgpu3
./fahgpu

Here is ~/fahgpu3/fahgpu:
Code: Select all
#!/bin/bash
#
# Folding@home GPU3 Linux/Wine Client
#
# fahgpu - Starts the Folding@home GPU3 Linux/Wine Client
#
#

NAME=fahgpu3
HOME=~/$NAME
EXEC=$HOME/Folding@home-Win32-GPU.exe
LOG=$HOME/FAHlog.txt
NICE=$HOME/.nice
VERBOSITY=$HOME/.verbosity
GPU=$HOME/.gpu
EXTRA_ARGS=$HOME/.extra_args



get_gpu() {
    cat $GPU
}


get_nice() {
    cat $NICE
}


get_verbosity() {
    cat $VERBOSITY
}


get_extra_args() {
    if [ -f $EXTRA_ARGS ]; then
        cat $EXTRA_ARGS
    fi
}


echo -n "Starting $NAME ... "

if [ ! -d $HOME ]; then
  echo "FAILED"
  echo "Directory $HOME does not exist"
  exit 1
fi

if [ ! -f $GPU ]; then
  echo "FAILED"
  echo "File $GPU does not exist"
  exit 1
fi

if [ ! -f $NICE ]; then
  echo "FAILED"
  echo "File $NICE does not exist"
  exit 1
fi
   
if [ ! -f $VERBOSITY ]; then
  echo "FAILED"
  echo "File $VERBOSITY does not exist"
  exit 1
fi
   
# Now execute the command line to run the program
nice -n $(get_nice) wine $EXEC -verbosity $(get_verbosity) -forcegpu $(get_gpu) $(get_extra_args)

Here is ~/fahgpu3/.nice:
Code: Select all
0

Here is ~/fahgpu3/.verbosity:
Code: Select all
9

Here is ~/fahgpu3/.gpu:
Code: Select all
nvidia_g80

The files ~/.profile, ~/startgpu3, and ~/fahgpu3/fahgpu must be made executable, by using chmod +x <file>.

It's all pretty simple, if you want to look through it. If you already have a ~/.profile file, just add the lines from this file to the end of it.
art_l_j_PlanetAMD64
Over 1.04 Billion Total Points
Over 185,000 Work Units
Over 3,800,000 PPD
Overall rank (if points are combined) 20 of 1721690
In memory of my Mother May 12th 1923 - February 10th 2012
art_l_j_PlanetAMD64
 
Posts: 741
Joined: Sun May 30, 2010 2:28 pm

Return to unOfficial Linux GPU (WINE wrapper) (3rd party support)

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron