Bitcoin Forum
November 07, 2024, 10:01:30 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 [5] 6 7 8 9 10 11 12 13 14 15 16 17 »  All
  Print  
Author Topic: cgmon - mining monitor for Linux - auto restart, reboot, sick gpu, ASIC, &more  (Read 48335 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic.
dr00g
Newbie
*
Offline Offline

Activity: 48
Merit: 0


View Profile
February 02, 2014, 11:54:00 AM
Last edit: February 02, 2014, 12:05:31 PM by dr00g
 #81

That's a lot of changes!

There is a little bug though, pool 3 to 5 will never get added.

You can do something like this:

# Check if pool variable exist, else initialize so script doesn't break below
if {![info exists pool1]} {set pool1 ""}
if {![info exists pool2]} {set pool2 ""}
if {![info exists pool3]} {set pool3 ""}
if {![info exists pool4]} {set pool4 ""}
if {![info exists pool5]} {set pool5 ""}


# Add pools which are not empty
if {$pool1 ne ""} {append mining_command "-o $pool1 -u $pool1_user -p $pool1_pass "}
if {$pool2 ne ""} {append mining_command "-o $pool2 -u $pool2_user -p $pool2_pass "}
if {$pool3 ne ""} {append mining_command "-o $pool3 -u $pool3_user -p $pool3_pass "}
if {$pool4 ne ""} {append mining_command "-o $pool4 -u $pool4_user -p $pool4_pass "}
if {$pool5 ne ""} {append mining_command "-o $pool5 -u $pool5_user -p $pool5_pass "}


Btw, awesome job on the php timeout, been wanting that, but I couldn't figure how to do it! Smiley
That is funny enough how I learned about ASIC hang when I was troubleshooting what actually made it hang up - both ASIC hang and sometimes when doing OC (or voltage change I seem to remember having experienced too) hangs up the miner so you can't quit, or will recieve API replies.

Would it be possible to throw the php timeout interval as a variable from the tcl script? Just so it's easier to costumize, if needed Smiley
mig5000
Sr. Member
****
Offline Offline

Activity: 324
Merit: 250


View Profile
February 02, 2014, 12:38:26 PM
 #82

jdape : Would you have any idea why I was/am getting these PHP errors ?

Thanks
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 02, 2014, 06:11:04 PM
 #83

That's a lot of changes!

There is a little bug though, pool 3 to 5 will never get added.
Hmm.  It seems to work.  Here's the code I am using now:
Code:
if {$pool3 != ""} {append mining_command " -o $pool3 -u $pool3_user -p $pool3_pass "}
If pool3 is specified in the config, it appends the pool3 variables to the mining command.



Btw, awesome job on the php timeout, been wanting that, but I couldn't figure how to do it! Smiley
That is funny enough how I learned about ASIC hang when I was troubleshooting what actually made it hang up - both ASIC hang and sometimes when doing OC (or voltage change I seem to remember having experienced too) hangs up the miner so you can't quit, or will recieve API replies.

Thanks!  It was a PITA to figure out actually.  Documentation wasn't very clear on timeouts in php.


Would it be possible to throw the php timeout interval as a variable from the tcl script? Just so it's easier to costumize, if needed Smiley
Hmm.  I don't know how one could do that since the variables in that string (the api file) are specifically not being interpreted by TCL.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 02, 2014, 06:15:37 PM
 #84

jdape : Would you have any idea why I was/am getting these PHP errors ?

Thanks


That could happen if your cgminer/sgminer is not listening to API commands, or not listening to them on the correct hostname/port.  You need --api-listen and you should be listening on 127.0.0.1 (localhost) port 4028.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
dr00g
Newbie
*
Offline Offline

Activity: 48
Merit: 0


View Profile
February 02, 2014, 06:24:51 PM
 #85

Oh, didn't notice you put those lines in the middle of the script, just looked it (too) quickly through!

The reason I have a few lines to initialize is because then you can "deactivate" a pool from starting next time by simply commenting the poolx variable, instead of switching pool numbers or urls around.
Have been thinking if this could be done in an even smarter way, will look into that later...
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 02, 2014, 06:26:21 PM
 #86

Oh, didn't notice you put those lines in the middle of the script, just looked it (too) quickly through!

The reason I have a few lines to initialize is because then you can "deactivate" a pool from starting next time by simply commenting the poolx variable, instead of switching pool numbers or urls around.
Have been thinking if this could be done in an even smarter way, will look into that later...

Great point.  I will have to change it to allow that behavior.  Smiley

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 02, 2014, 06:59:56 PM
 #87

Done.

#   Changed pool configuration.  Now you can comment out unused pools or leave them blank. 

Note: In 0.1b12 the pool variables have changed format so copy/pasting old pool info into this latest download will break the script.  You'll need to enter the actual address, username, and password as required.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
dr00g
Newbie
*
Offline Offline

Activity: 48
Merit: 0


View Profile
February 02, 2014, 07:47:21 PM
 #88

Sweet implementation, much smoother than mine! Tongue

Now you can also cleanup 50 % of your todo! Wink
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 02, 2014, 07:49:27 PM
 #89

haha... yea.  That feature is *almost* working Wink

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 02, 2014, 08:19:51 PM
 #90

Hi there!
Could you help me to resolve the following issue.
I have added this line:"*/5 * * * *   root   /home/my username/cgmon.tcl >/dev/null 2>&1" to crontab and after the system boots nothing happens but in 5 minutes cgmon starts. Does it happens because  my PC connects to internet through wifi and it takes 10-15 seconds to connect to router after booting and therefore after booting cgminer cood not connect to the pool and only after checking of cgmon in 5 minutes it restarts cgminer again?
Thank you.


By default the cronjob runs every fifth minute of the hour.  So your miner would get started within 5 minutes of booting.  If you want, you can change */5 to */1 or */2 so it checks every minute or two instead.   

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 02, 2014, 08:24:11 PM
 #91

Hi there!
Could you help me to resolve the following issue.
I have added this line:"*/5 * * * *   root   /home/my username/cgmon.tcl >/dev/null 2>&1" to crontab and after the system boots nothing happens but in 5 minutes cgmon starts. Does it happens because  my PC connects to internet through wifi and it takes 10-15 seconds to connect to router after booting and therefore after booting cgminer cood not connect to the pool and only after checking of cgmon in 5 minutes it restarts cgminer again?
Thank you.


By default the cronjob runs every fifth minute of the hour.  So your miner would get started within 5 minutes of booting.  If you want, you can change */5 to */1 or */2 so it checks every minute or two instead.  

FYI, having your miner start four times a day, via a 5 minute cronjob would on average potentially waste 0.6% of your daily mining time, vs a 1 minute cronjob.    Perhaps I should change the default cronjob to 1, 2, or 3 minutes?

Of course the reboots themselves could cause that much loss too... 

The nice thing about using cgmon.tcl for me, is that I can see which GPU's are clocked too high and slowly lower those clock speeds until the GPU becomes stable over multiple days or weeks.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 02, 2014, 08:28:32 PM
 #92

FYI, having your miner start four times a day, via a 5 minute cronjob would on average potentially waste 0.6% of your daily mining time, vs a 1 minute cronjob.  

Actually it could be twice that much loss since cgmon.tcl only has a chance to catch the problem once every 5 minutes...  The next version will have a recommended cron time of every 2 minutes.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 02, 2014, 08:32:51 PM
 #93

cgmon b12 released

http://www.forked.net/~apex/cgmon/cgmon.tcl

Changes:

# 0.1b12
#   Added check for connection reset when using cgminer API.
#   Moved share monitoring option into config section.
#   Changed pool configuration.  Now you can comment out unused pools or leave them blank.
#   Added option to disable email notifications when cgmon.tcl is run by hand.  Keeps the inbox spam down when adjusting settings, etc.
#   Cleaned up some code.
#   Changed cronjob default to every 2 minutes.  If you have an existing cronjob, you'll need to edit /etc/crontab yourself to make this change.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
MrBobC
Member
**
Offline Offline

Activity: 110
Merit: 10


View Profile
February 03, 2014, 03:25:48 PM
 #94

When cgmon restarts cgminer, I find my hashrate is less than half what it was before, despite all the same settings.  Does the restart command not include (in windows terms) setx use_gpu_alloc 100 and the gpu_use_sync_objects 1?  Also, any word on the reboot if the hash rate falls below xx?
rorbit
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
February 03, 2014, 04:43:07 PM
 #95

Thanks for the PHP time out catch.  That should do it.
Angela8488
Full Member
***
Offline Offline

Activity: 127
Merit: 100


View Profile
February 03, 2014, 05:43:54 PM
 #96

OS: CentOS 6.2 X64
cgmon 0.1b13

Quote
couldn't execute "shutdown": no such file or directory
    while executing
"exec shutdown -r now"
    (procedure "reboot" line 5)
    invoked from within
"reboot"
    (procedure "check_status" line 175)
    invoked from within
"check_status"
    (file "/usr/local/bin/cgmon.tcl" line 421)


[root@rig ~]# whereis shutdown
shutdown: /sbin/shutdown /usr/share/man/man8/shutdown.8.gz /usr/share/man/man3p/shutdown.3p.gz /usr/share/man/man2/shutdown.2.gz
dr00g
Newbie
*
Offline Offline

Activity: 48
Merit: 0


View Profile
February 03, 2014, 06:24:20 PM
 #97

Try changing:

"exec shutdown -r now"

To:
"exec reboot"

That should work in CentOS.
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 04, 2014, 02:17:46 AM
 #98

OS: CentOS 6.2 X64
cgmon 0.1b13

Quote
couldn't execute "shutdown": no such file or directory
    while executing
"exec shutdown -r now"
    (procedure "reboot" line 5)
    invoked from within
"reboot"
    (procedure "check_status" line 175)
    invoked from within
"check_status"
    (file "/usr/local/bin/cgmon.tcl" line 421)


[root@rig ~]# whereis shutdown
shutdown: /sbin/shutdown /usr/share/man/man8/shutdown.8.gz /usr/share/man/man3p/shutdown.3p.gz /usr/share/man/man2/shutdown.2.gz

Fixed.  Thanks!

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 04, 2014, 02:21:02 AM
 #99

When cgmon restarts cgminer, I find my hashrate is less than half what it was before, despite all the same settings.  Does the restart command not include (in windows terms) setx use_gpu_alloc 100 and the gpu_use_sync_objects 1?  Also, any word on the reboot if the hash rate falls below xx?

Hmm.  Take a look at /tmp/cgmon-mine.sh.  That's the file that has the mining command.  It should also contain:
Code:
export DISPLAY=:0
export GPU_MAX_ALLOC_PERCENT=100
export GPU_USE_SYNC_OBJECTS=1

You could try running /tmp/cgmon-mine.sh directly and see if that gets you the full hashrate.  If it does, I expect the problem could be with the way cgminer is started from crontab.   What OS are you using?

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
MrBobC
Member
**
Offline Offline

Activity: 110
Merit: 10


View Profile
February 04, 2014, 03:01:48 AM
 #100

That file looked fine.  BAMT 1.3
Pages: « 1 2 3 4 [5] 6 7 8 9 10 11 12 13 14 15 16 17 »  All
  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!