Author

Topic: Silly linux scripts and tricks (Read 3378 times)

full member
Activity: 238
Merit: 100
June 13, 2011, 06:41:00 PM
#9
Sort of related....  I just posted about an automated linux mining management and load balancing system that uses all kinds of silly tricks to monitor and report on the status of many miners:)

http://forum.bitcoin.org/index.php?topic=16548.0
copper member
Activity: 56
Merit: 0
June 13, 2011, 09:36:55 AM
#8
Good point.

Did not find that thread when I searched for "linux scripts" before. Smiley
inh
full member
Activity: 155
Merit: 100
June 13, 2011, 07:33:30 AM
#7
OP, there's already a thread like this, why not contribute there? Smiley

http://forum.bitcoin.org/index.php?topic=9999.0
legendary
Activity: 1148
Merit: 1001
Radix-The Decentralized Finance Protocol
June 13, 2011, 04:00:55 AM
#6

Sounds like a great opportunity for you to provide one! Smiley

I didn't ignore your original request - I've been digging around in aticonfig and pplib stuff but haven't found anything that gives me an amperage or estimated power use - only voltages.

Ive been looking at the code of radeonvolt, its not complicated, but to get the info you need to know the graphic card protocol, which I dont, it takes time and its boring as hell. And for someone who already knows it, it would be quite easy to provide it, or even hack radeonvolt to accept more types of cards...

I would actually pay some bitcoins to someone willing to actualize radeonvolt or AMDOverdriveCtrl (or a new one) to provide that info. Maybe we can start a bounty.

EDIT: I have checked the AMD ADL Library (the one used by AMDOverdriveCtrl) and it does not allow to access current or other temprearture sensors. It actually allows to access what AMDOverdriveCtrl is already showing. To get the rest of the info you need to access the card (via i2c I believe) and its probably different for every model.

If anyone is willing to upgrade radeonvolt (or AMDOverdriveCtrl or a new one) to read 5870 cards I am willing to give 5btc bounty.
copper member
Activity: 56
Merit: 0
June 13, 2011, 03:07:27 AM
#5

Sounds like a great opportunity for you to provide one! Smiley

I didn't ignore your original request - I've been digging around in aticonfig and pplib stuff but haven't found anything that gives me an amperage or estimated power use - only voltages.
legendary
Activity: 1148
Merit: 1001
Radix-The Decentralized Finance Protocol
June 13, 2011, 02:51:13 AM
#4
There's this -


aticonfig --pplib-cmd "get activity"
Current Activity is Core Clock: 1005MHZ
Memory Clock: 225MHZ
VDDC: 1088
Activity: 99 percent
Performance Level: 2
Bus Speed: 2500
Bus Lanes: 16
Maximum Bus Lanes: 16


But there's no current amp or wattage.  What Windows thing gives you a power consumption listing?

I know of gpu-z but there are others. There is also the issue of the rest of sensors.

I guess I could look into the code of radeonvolt to see how it does it and try to adapt it to my card... :snooze: Now seriously, there are ways to get the info, its kind of sad that no linux frontend (GUI or comand line) to get that info exists.
copper member
Activity: 56
Merit: 0
June 13, 2011, 02:40:43 AM
#3
There's this -


aticonfig --pplib-cmd "get activity"
Current Activity is Core Clock: 1005MHZ
Memory Clock: 225MHZ
VDDC: 1088
Activity: 99 percent
Performance Level: 2
Bus Speed: 2500
Bus Lanes: 16
Maximum Bus Lanes: 16


But there's no current amp or wattage.  What Windows thing gives you a power consumption listing?
legendary
Activity: 1148
Merit: 1001
Radix-The Decentralized Finance Protocol
June 13, 2011, 02:24:19 AM
#2
I know I am getting repetitive but it would be great if we could get someway to get the consumption and the rest of the temperature sensors in Linux.

With AMDOverdriveCtrl you can see the voltage, but it does not tell you the current. You need both to know the consumption. The cards measure it because windows applications allow you to know.

There is this application called radeonvolt but it only works with a few selected cards.

Anyone has a solution?
copper member
Activity: 56
Merit: 0
June 13, 2011, 01:46:06 AM
#1
Code:
#!/bin/bash
while [ 1 ]; do
        echo "$(aticonfig --adapter=all --odgt | sed ':a;N;$!ba;s/\n//g')" | nc -l 9001
done

I realized we have a lot of new Linux users out there, so here's a simple script to keep you away from the GUI.

Put the above in a file, chmod u+x it, run it.  That's it.  Connect with a browser to whatever the host is, port 9001.

Requires netcat (nc).

Feel free to replace "aticonfig --adapter=all --odgt" with whatever you like - use tee to redirect your miner output or whatever you want to a file, then push that through netcat.

Let's say you've got a script called startminer.sh that starts poclbm (or whatever).  You can use the following to start it:

startminer.sh | tee -a minerlog.log

Then use -
Code:
#!/bin/bash
while [ 1 ]; do
        echo "$(sed ':a;N;$!ba;s/\n//g' < minerlog.log)" | nc -l 9001
done

For ssh sessions, don't forget that happy watch command -
watch -n 1 aticonfig --adapter=all --odgt

Will continuously print to the screen the output from aticonfig every 1 second.

And finally, if you're using eligius, don't forget there are both EU and US servers.

I haven't been able to test the following script... eligius servers haven't gone down.  But the idea is if you had a line in your /etc/hosts like:

173.242.112.67 eligius.mining

And pointed a miner at http://eligius.mining:8337 while the script below ran..... if the hashrate for that server hit 0 or was otherwise unreachable it should "failover" to the other server.

Code:
#!/bin/bash

EUHTTP="http://eligius.st/~luke-jr/raw/eu/hashrate.txt"
USHTTP="http://eligius.st/~luke-jr/raw/us/hashrate.txt"

EUIP="85.25.78.8"
USIP="173.242.112.67"

export EUIP
export USIP

CURRENT=$USHTTP

echo $EUIP
echo $USIP

while [ 1 == 1 ]; do
echo "Checking..."

HR=$(wget -q -O - $CURRENT)

if [ -z "$HR" ]
then
HR="0"
fi

echo "Hashrate $HR"

if [ $CURRENT == $USHTTP ]
then
if [ $HR == 0 ]
then
cp /etc/hosts /tmp/hosts
sed s/$USIP/$EUIP/ < /tmp/hosts > /etc/hosts
echo "Switched to Europe."
CURRENT=$EUHTTP
fi
elif [ $CURRENT == $EUHTTP ]
then
if [ $HR == 0 ]
then
cp /etc/hosts /tmp/hosts
sed s/$EUIP/$USIP/ < /tmp/hosts > /etc/hosts
echo "Switched to US."
CURRENT=$USHTTP
fi
fi
sleep 5m
done
Jump to: