Bitcoin Forum
November 08, 2024, 02:44:32 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How To Open 6 Terminals, Set GPU Clocks, And Start POCLBM On Ubuntu Startup???  (Read 5320 times)
gigabytecoin (OP)
Sr. Member
****
Offline Offline

Activity: 280
Merit: 252


View Profile
May 20, 2011, 01:30:58 AM
 #1

The title says it all.

I don't want to have to manually tweak my rigs every time I power them on.

There must be a simple way to open up multiple terminal screens, change all gpu clocks, and start mining - but I haven't figured it out!
vegaman
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
May 20, 2011, 01:48:16 AM
 #2

I'd just run them inside screen sessions, then you can connect from wherever and check on them.

Just something like:
screen -S "name of screen session here" -X screen <command line for miner here> 2>&1 1>/dev/null


One line like that for each instance of the miner and run it from whever, such as /etc/init/rc.local

I'm sure there should be a way to overclock from the commandline too, just have a search and run that command before spawning the miners.
Zibbo
Newbie
*
Offline Offline

Activity: 59
Merit: 0


View Profile
May 20, 2011, 10:54:46 AM
 #3

This is how I do it. It could be a lot more polished, but when I got it working, I just let it be. I assume you know how to use screen.

set_ati_profiles.sh sets clocks and fan settings

Code:
#!/bin/bash

DISPLAY=:0
export LD_LIBRARY_PATH=/home/xxxx/ati-stream-sdk-v2.1-lnx64/lib/x86_64/:

cd /home/xxxx

AMDOverdriveCtrl -i 0 card2.core1.safe.ovdr > /dev/null &
AMDOverdriveCtrl -i 3 card2.core2.safe.ovdr > /dev/null &
AMDOverdriveCtrl -i 4 card4.core1.safe.ovdr > /dev/null &
AMDOverdriveCtrl -i 7 card4.core2.safe.ovdr > /dev/null &

start1.sh starts miner for the first core:
Code:
#!/bin/bash
export DISPLAY=:0
export LD_LIBRARY_PATH=/home/xxxx/ati-stream-sdk-v2.1-lnx64/lib/x86_64/:
python phoenix.py -u http://xxxx:yyyy@zzz.zzz.zzz.zzz:8332/ DEVICE=1 VECTORS BFI_INT AGGRESSION=11

Then I have a custom screenrc called start_miners:

Code:
shell /bin/bash

chdir /home/xxxx/bitcoin-0.3.21/bin/64/
screen 0
exec ./bitcoind -daemon
             
chdir /home/xxxx/phoenix-1.46/
screen 1
exec ./start1.sh
screen 2
exec ./start2.sh
screen 3
exec ./start3.sh
screen 4
exec ./start4.sh

After that set your X to auto login, and add two commands to "startup programs" in that nice GUI config tool in Ubuntu (startup settings or something like that?)

set_ati_profiles.sh
screen -d -m -c /home/xxxx/start_miners

That starts screen in detached mode, and you can just login with ssh to check up on your miners. No need for monitor/keyboard/mouse.

Some of the extra maneuvering in those scripts are done, because screen didn't seem to pass LD_LIBRARY_PATH if I tried give the miner command line directly to the screen. Also it felt like I had to be logged in on X for everything to work ok reliably, so that's why I used that "startup programs" menu, so they would be called after the login.
gigabytecoin (OP)
Sr. Member
****
Offline Offline

Activity: 280
Merit: 252


View Profile
May 20, 2011, 07:17:20 PM
 #4

Perfect, thanks guys!

I am unfamiliar with screen but I will not be by the end of tonight... and will send a few your way if/when I get it implemented!
BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 04, 2011, 04:44:39 PM
 #5

Hi Guys, tryting to get this auto launch script to run my miners on ubuntu 11.04 then access them via ssh and screen command...  I have the autologon and auto card config running but getting this error after I ssh to the running terminal, and the miners are not launched....  Any ideas?


:~/phoenix$ Traceback (most recent call last):
  File "phoenix.py", line 123, in <module>
    miner.start(options)
  File "/home/administrator/phoenix/Miner.py", line 75, in start
    self.kernel = self.options.makeKernel(KernelInterface(self))
  File "phoenix.py", line 111, in makeKernel
    kernelModule = imp.load_module(module, file, filename, smt)
  File "kernels/poclbm/__init__.py", line 22, in <module>
    import pyopencl as cl
  File "/usr/local/lib/python2.7/dist-packages/pyopencl-0.92-py2.7-linux-x86_64.egg/pyopencl/__init__.py", line 3, in <module>
    import pyopencl._cl as _cl
ImportError: libOpenCL.so: cannot open shared object file: No such file or directory
BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 04, 2011, 04:51:39 PM
 #6

Hi Monoquark, just checked that and it is correct...  :~/ati-stream-sdk-v2.1-lnx64/lib$
BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 04, 2011, 05:00:31 PM
 #7

Could this be something wrong with python?,, btw my miners work fine if I launch manually from terminal

:~/phoenix$ Traceback (most recent call last):
  File "phoenix.py", line 123, in <module>
    miner.start(options)
  File "/home/administrator/phoenix/Miner.py", line 75, in start
    self.kernel = self.options.makeKernel(KernelInterface(self))
  File "phoenix.py", line 111, in makeKernel
    kernelModule = imp.load_module(module, file, filename, smt)
  File "kernels/poclbm/__init__.py", line 22, in <module>
    import pyopencl as cl
  File "/usr/local/lib/python2.7/dist-packages/pyopencl-0.92-py2.7-linux-x86_64.egg/pyopencl/__init__.py", line 3, in <module>
    import pyopencl._cl as _cl
ImportError: libOpenCL.so: cannot open shared object file: No such file or directory
supa
Copper Member
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
June 04, 2011, 08:49:40 PM
 #8


Check ldconfig -p | grep -o opencl

In my experience, make sure you -
export DISPLAY=0:0

(or whatever your display is with the ATI driver) before you try to use something that needs OpenCL.


I wish NVIDIA hashed better.... I don't even have to init the driver to use CUDA. Sad

BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 04, 2011, 10:12:48 PM
 #9

I'm getting closer....  now I get this message when I ssh to the screen.

 No device specified or device not found, use DEVICE=ID to specify one of the following



This is my start_miners script..


start_miners
shell /bin/bash

chdir /home/administrator/phoenix/
screen 0
exec ./test.sh


I call this during startup via the startup programs with the following command line :    screen -d -m -c /home/administrator/phoenix/start_miners


This is my test.sh script;


#!/bin/bash
export DISPLAY=0:0
export LD_LIBRARY_PATH=/home/administrator/ati-stream-sdk-v2.1-lnx64/lib/x86_64/:
python phoenix.py -u http://xxxx@xxxx_0:pass@deepbit.net:8332/ -k poclbm VECTORS BFI_INT AGGRESSION=12 WORKSIZE=128 DEVICE=1



BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 05, 2011, 02:09:40 PM
 #10




Ok, tried that now I'm getting ...

~/phoenix$ [05/06/2011 09:05:21] FATAL kernel error: Failed to load OpenCL kernel!
BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 05, 2011, 02:35:52 PM
 #11

ok, now I'm getting   python: can't open file 'phoenix.py': [Errno 2] No such file or directory

perhaps a path statement to correct?
BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 05, 2011, 02:46:01 PM
 #12

/usr/bin/python: can't open file 'phoenix.py': [Errno 2] No such file or directory

uh oh, no python folder, but how am I able to run the miner manually..


BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 05, 2011, 02:55:42 PM
 #13

 Could not locate the specified kernel!     Huh
BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 05, 2011, 03:02:07 PM
 #14


#!/bin/bash
export DISPLAY=:0
export LD_LIBRARY_PATH=/home/administrator/ati-stream-sdk-v2.1-lnx64/lib/x86_64/:
/usr/bin/python /home/administrator/phoenix/phoenix.py -u http://xxxx@xxxx.com_0:xxxx@deepbit.net:8332/ -k poclbm VECTORS BFI_INT AGGRESSION=12 WORKSIZE=128 DEVICE=0
bolapara
Member
**
Offline Offline

Activity: 78
Merit: 10


View Profile
June 05, 2011, 03:09:04 PM
 #15

This is the way I do it.

Code:
user@miner00:~$ cat screen_mining.rc 
screen -t GPU0 0 /home/user/mine.sh 1
screen -t GPU1 1 /home/user/mine.sh 2
screen -t GPU2 2 /home/user/mine.sh 3
user@miner00:~$

mine.sh sets up the clocks, the fans, etc on the specified card and launches the miner.

just run like this: screen -c screen_mining.rc
BitCointransfers
Member
**
Offline Offline

Activity: 104
Merit: 35


View Profile
June 05, 2011, 03:12:41 PM
 #16

once the cd line goes back in I get....


:~$ [05/06/2011 10:11:14] FATAL kernel error: Failed to load OpenCL kernel!
willebra
Jr. Member
*
Offline Offline

Activity: 56
Merit: 10


View Profile
June 07, 2011, 07:46:49 PM
 #17

This is most strange... can you manually:

1. cd /home/administrator/phoenix/
2. python /home/administrator/phoenix/phoenix.py -u http://xxxx@xxxx.com_0:xxxx@deepbit.net:8332/ -k poclbm VECTORS BFI_INT AGGRESSION=12 WORKSIZE=128 DEVICE=0

?

If that does not work I'm completely stumped.

Have the same problem and this does not resolve it. Running phoenix.py with the above command (at btcguild.com) from where its located (i have it at /opt/miners/phoenix/) gives the same error.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!