Author

Topic: Multiple POCLBM instances from one all black ubuntu console window? (Read 2822 times)

legendary
Activity: 1162
Merit: 1000
DiabloMiner author
Is it possible to run 4 seperate miners for my 4 x 5870 setup WITHOUT the ubuntu desktop running?

For example, right now when I run 4 GPUs mining at once on one machine, I open up 4 terminals and enter the appropriate d 1, d 2, d 3, etc commands....

How would I open up multiple terminals or run multiple instances when only running the all black console screen?

Why not just use DiabloMiner then? DiabloMiner already uses all GPUs available by default.
newbie
Activity: 37
Merit: 0
use 'terminator', yup it's a software name  Grin, you can split & divide per console  horizontally or vertically as many as you want.

Site : http://www.tenshu.net/terminator/

Screenshot : http://www.tenshu.net/wp-content/uploads/2008/08/2008-08-17-terminator.png
                  http://www.tenshu.net/wp-content/uploads/2008/02/terminator-mad.png
sr. member
Activity: 286
Merit: 251
Can I offer the following script? I use with momchils poclbm miner.  The script is written in perl and you use from your name space as follows:
./mine.pl start  
./mine.pl stop

You need to set your user and password, and also the directory containing the miner, (whichever version) and logs. Other than that usage should be simple.
It will seek out as many GPU's as you have, and fire them all up. It can also be used to switch on an off at idle although I havnt used this functionality recently. Chang options for the miner as you need.

Script is intended to be run as user not as root.

#!/usr/bin/perl
# usage:
# mine.pl  start
#    start mining now
# mine.pl stop
#    stop mining now
# mine.pl idle start
#    start mining when screen saver activates, stop it when it deactivates.
#    this means if you started by hand it will stop when screen saver deactivates.
# mine.pl idle stop
#    do not do anything on screen saver activate/ deactivate.
#
# Note that for this functionality you must be using xscreensaver, it will not work
# otherwise.
#
# mine.pl logsort
#      sort log files into 1 per day files. Must be done only while miner is stopped.
#

$dir="/home/mark/poclbm20110311";
# $dir='/home/mark/poclbm20110311/poclbm-mod.03.24.2011';
#$dir='/home/mark/poc/m0mchil-poclbm-b981138';
$logdir="/home/mark/poclbm20110311";
use POSIX qw(strftime);

if ($ARGV[0] eq 'logsort')
{
  logsort();
  exit;
}


# idle stop means uncouple. Next time computer becomes idle
# nothing will happen.
if ($ARGV[0] eq 'idle'  and $ARGV[1] eq 'stop')
{
   chdir($dir);
   my $f="$0.idle.pid";
   if ( -e $f)
   {
     $pid=`cat $f`;
     print "kill $pid\n";
      system("kill $pid");
     sleep 1;
     -e $f and  unlink $f;
   }
   exit 0;
}
# idle start means next time computer becomes idle
# start mining.
if ($ARGV[0] eq 'idle'  and $ARGV[1] eq 'start')
{
#  BLANK Wed Mar 16 17:06:30 2011
#  RUN 176
#  UNBLANK Wed Mar 16 17:06:43 2011

   chdir($dir);
      $chi=fork;
      if ($chi==0)
      { open (IN, "xscreensaver-command -watch |");
      while () {
       if (m/^(BLANK|LOCK)/) {
        if (!$blanked) {
            system("$0 start");
            $blanked = 1;
        }
       } elsif (m/^UNBLANK/) {
        system("$0 stop");
        $blanked = 0;
       }
      }
      }
      else
      {
#         print "child is $chi\n";
        open(P,">$0.idle.pid") or die "Y";
       $chi=$chi+1;
        print  P "$chi";
       close P;
      }

exit 0;
}

if ( $ARGV[0] eq 'stop' or $ARGV[0] eq 'start' )
{
   system("killall poclbm.py > /dev/null 2&>1 ");
}
$sdk="/home/mark/src/bitcoin/ati/ati-stream-sdk-v2.3-lnx32/lib/x86";
$sdk="/home/mark/src/bitcoin/ati/ati-stream-sdk-v2.3-lnx32/lib/gpu";
# $sdk="/home/mark/src/bitcoin/ati/ati-stream-sdk-v2.1-lnx32/lib/x86";
$poclbm="cd $dir ; export GPU_USE_SYNC_OBJECTS=1 ; export LD_LIBRARY_PATH=$sdk ; export DISPLAY=:0 ; ./poclbm.py";
if ($ARGV[0] eq 'start')
{
  open(X, "$poclbm |") or die "Cannot open miner to determine GPUs";
  # example output expected:
  #
  •    Cypress
 # [1]   Cypress
  # [2]   Intel(R) Core(TM) i7 CPU         950  @ 3.07GHz

  while ()
  {
    chomp;
     m/Cypress/ and m/^.([0-9]+)/ and push(@d,$1);
  }
  close X;
  for my $d (@d)
  {
    start($d);
  }  
  exit 0;
}

sub start
{
  my ($d)=@_;
  my $chi;
  open(F,">>$logdir/poclbm$d.log") or die("X");
  $chi=fork();
  if (!$chi)
  {
    $v=`cd $dir ; export GPU_USE_SYNC_OBJECTS=1 ; export LD_LIBRARY_PATH=$sdk ; export DISPLAY=:0 ; ./poclbm.py --version 2>&1 `;
    $v=~s/\n//;
    print F strftime("%d/%m/%Y %H:%M:%S, ",localtime());
    print F "*** $v started $d \n";
    close F;
     system("cd $dir ; export GPU_USE_SYNC_OBJECTS=1 ; export LD_LIBRARY_PATH=$sdk ; export DISPLAY=:0 ; ./poclbm.py -f 20 --verbose -w 128 -r 60 -v -d$d --user ... --pass ...  >> $logdir/poclbm$d.log 2>&1");
     open(F,">>$logdir/poclbm$d.log") or die("X");
    print F strftime("%d/%m/%Y %H:%M:%S, ",localtime());
    print F "*** stopped $d \n";
    close F;
    exit;
  }
}
sub logsort
{
  my $d=0;
  my %devices;  
  my $l="$logdir/poclbm$d.log";
  $devices{$l}=$d;
  # 1) List all the log files in existence.
  while ( -e $l)
  {
    push(@loglist,$l);
   $d++;
    $l="$logdir/poclbm$d.log";
    $devices{$l}=$d;
  }

  # 2) Make an exhaustive list of days, by an initial pass of all files.

  my %days;  
  for $l (@loglist)
  {
     print "Opening $l\n";
     open(L,$l) or next;
    while ()
    {
      chomp;
      my @a=split(/[ ,]+/,$_);
      $a[0]=~m:^[0-9/]{10}: or next;
      my @b=split('/',$a[0]);
       my $b=join('-',@b);
      $days{$b}=1;
    }
     close L;
  }

  # 3) now open all the log files, read into memory a day at a time, sort and output as a single stream.
  #    read just one days worth of data from each file.
  #
  my $matching=0;
  for my $date (keys %days)
  {
  my $dateo=$date;
  $date=~s:-:/:g;
  my @data;
  for $l (@loglist)
  {
    $d=$devices{$l};
    print "Opening $l device $d\n";
     open(L,$l) or next;
    while ()
     {
       chomp;
      m:^[0-9/]{10}: and !m/$date/ and $matching=0;
       if (m/$date/)
      {
         s/,/ $d,/;
        push(@data,$_);
        $matching=1;
        next;
      }
      if ($matching)
      {
       $data[-1].=" ".$_ if $data[-1] =~ m:^[0-9/]{10}:
      }
    }
    $matching=0;  
     close L;
  }
  print "Sorting for $date\n";  
  @data=sort { $a cmp $b } @data;
  $"="\n";
  $dateo=join('-',reverse split('-',$dateo));
  $outfile="$logdir/$dateo.log";
  open(LL, ">>$outfile") or die "Cannot open $outfile";
  print LL "@data\n";
  close LL;
  print "Output done for date $date to file $outfile\n";
  }
  unlink @loglist;
}


If you find this useful, please bitcoin me! 187PquUCdXRHvQgNc5e7GUnkX8ZeNxMx62
Even 0.001 bitcoins would let me know you found it intresting!!
But even if you do not to bitcoin me, would like to hear that you found it useful anyway!
legendary
Activity: 1750
Merit: 1007
I've got my boxes set with a GUI auto log-in install to make sure all the displays are initialized at the start, but they're all headless.  I log into them via SSH and use the following commands to get one SSH window to show multiple miners:

screen -S GPU1
./poclbm.py -d1  (I've modified the python script to auto fill in log in/worksize/vector arguments based on device #)
Ctrl a+d
screen -S GPU2
./poclbm.py -d2
Ctrl a+d

screen -S Multimon
screen -x GPU1
Ctrl+a, Shift+S
Ctrl+a, Ctrl+tab
Ctrl+a, Ctrl+c
screen -x GPU2


The results can be seen here: https://i.imgur.com/b1zg4.gif
legendary
Activity: 1284
Merit: 1001
No, you need X to get all the necessary drivers. I use fluxbox which is very light weight and just run startx from screen.
legendary
Activity: 3920
Merit: 2348
Eadem mutata resurgo
install screen. type "screen", run the miner, then control+d detaches the screen. then type "screen" again to run another miner. typing "screen -ls" will list all the open screens. their is a number at the beginning of each screen in the list, type "screen -r " to reattach to the screen.

Hmmm, does this get the Xorg process running to install the fglrx drivers?
legendary
Activity: 1284
Merit: 1001
It's easier to manage if you don't start a separate screen session for each miner. If you just type screen once, you will start a screen session. You can then start as many terminals as you like inside that session by pressing ctrl-a c to create, and ctrl-a n to switch between the terminals. Start one miner in each terminal. You can also start the miner directly to save some RAM by typing 'screen ' in a screen terminal.
newbie
Activity: 3
Merit: 0
install screen. type "screen", run the miner, then control+d detaches the screen. then type "screen" again to run another miner. typing "screen -ls" will list all the open screens. their is a number at the beginning of each screen in the list, type "screen -r " to reattach to the screen.
full member
Activity: 216
Merit: 100
A shell script, screen?
sr. member
Activity: 280
Merit: 252
Is it possible to run 4 seperate miners for my 4 x 5870 setup WITHOUT the ubuntu desktop running?

For example, right now when I run 4 GPUs mining at once on one machine, I open up 4 terminals and enter the appropriate d 1, d 2, d 3, etc commands....

How would I open up multiple terminals or run multiple instances when only running the all black console screen?
Jump to: