Pages:
Author

Topic: Hacking The KNC Firmware: Overclocking - page 47. (Read 144362 times)

full member
Activity: 147
Merit: 100
software developer
January 12, 2014, 08:21:45 AM
Ah, so you have an October unit, thought November one.

I used my modified starter from before for the latest 0.99-2 (October).
Just added the additional bfgminer lines at the top, the start cmd at the end of do_start(), as well as the kill-cmd in do_stop().

Works fine.

*edit:
here's mine
Code:
#!/bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

use_bfgminer=
if [ -f /config/miner.conf ]; then
        . /config/miner.conf  #if bfgminer is enabled, this file contains: use_bfgminer="true"
fi
if [ "$use_bfgminer" = true ] ; then
        DAEMON=/usr/bin/bfgminer
        NAME=bfgminer
        DESC="BFGMiner daemon"
        EXTRA_OPT="-S knc:auto"
else
DAEMON=/usr/bin/cgminer
NAME=cgminer
DESC="Cgminer daemon"
EXTRA_OPT=
fi


set -e

test -x "$DAEMON" || exit 0

do_start() {
# Stop SPI poller
spi_ena=0
i2cset -y 2 0x71 2 $spi_ena

good_ports=""
bad_ports=""

# CLear faults in megadlynx's
for b in 3 4 5 6 7 8 ; do
for d in 0 1 2 3 4 5 6 7 ; do
i2cset -y $b 0x1$d 3 >/dev/null 2>&1 || true
done
done

for p in 0 1 2 3 4 5 ; do
i2cset -y 2 0x71 1 $((p+1))
good_flag=0
ar="$(spi-test -s 50000 -OHC -D /dev/spidev1.0 0x80,3,0,0,0,0,0,0 | tail -c 13)"
                if [ "x$ar" = "x00 30 A0 01" ] ; then
good_flag=1
fi
ar="$(spi-test -s 50000 -OHC -D /dev/spidev1.0 0x80,2,0,0,0,0,0,0 | tail -c 13)"
                if [ "x$ar" = "x00 30 A0 01" ] ; then
good_flag=1
fi
ar="$(spi-test -s 50000 -OHC -D /dev/spidev1.0 0x80,1,0,0,0,0,0,0 | tail -c 13)"
                if [ "x$ar" = "x00 30 A0 01" ] ; then
good_flag=1
fi
ar="$(spi-test -s 50000 -OHC -D /dev/spidev1.0 0x80,0,0,0,0,0,0,0 | tail -c 13)"
                if [ "x$ar" = "x00 30 A0 01" ] ; then
good_flag=1
fi

if [ "$good_flag" = "1" ] ; then
good_ports=$good_ports" $p"
else
bad_ports=$bad_ports" $p"
fi
done

if [ -n "$good_ports" ] ; then
for p in $good_ports ; do
# Re-enable PLL
i2cset -y 2 0x71 1 $((p+1))
for c in 0 1 2 3 ; do
cmd=$(printf "0x84,0x%02X,0,0" $c)
spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/dev/null
cmd=$(printf "0x86,0x%02X,0x02,0x11" $c)
spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/dev/null
cmd=$(printf "0x85,0x%02X,0,0" $c)
spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/dev/null
done

# re-enable all cores
i=0
while [[ $i -lt 192 ]] ; do
i2cset -y 2 0x2$p $i 1
i=$((i+1))
done
spi_ena=$(( spi_ena | (1 << $p) ))
done
fi
if [ -n "$bad_ports" ] ; then
for p in $bad_ports ; do
# Disable PLL
i2cset -y 2 0x71 1 $((p+1))
for c in 0 1 2 3 ; do
cmd=$(printf "0x84,0x%02X,0,0" $c)
spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/dev/null
done

# disable all cores
i=0
while [[ $i -lt 192 ]] ; do
i2cset -y 2 0x2$p $i 0
i=$((i+1))
done
spi_ena=$(( spi_ena & ~(1 << $p) ))
done
fi

# Disable direct SPI
i2cset -y 2 0x71 1 0

# Enable SPI poller
i2cset -y 2 0x71 2 $spi_ena

start-stop-daemon -b -S -x screen -- -S cgminer -t cgminer -m -d "$DAEMON" --api-listen -c /config/cgminer.conf $EXTRA_OPT
}

do_stop() {
        killall -9 bfgminer cgminer 2>/dev/null || true
}
case "$1" in
  start)
        echo -n "Starting $DESC: "
do_start
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
do_stop
        echo "$NAME."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: "
        do_stop
        do_start
        echo "$NAME."
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0
legendary
Activity: 1036
Merit: 1000
Nighty Night Don't Let The Trolls Bite Nom Nom Nom
January 12, 2014, 07:58:50 AM
my KnC units have ROI(yes in BTC not fiat) and more so i am happy to play with them in any way and form.

Really i have no idea what i am doing, but the more i play the more vim cmds i am picking up anyway.

resetting or flashing undo's anything i do in Vi anyway,  otherwise i doubt either of my miners would be working.


edit: really i just want to use bfgminer but still have the ability to OC. I might just give up for now, the extra 70GH i get with my saturn is not worth giving up for bfgminer just now.
full member
Activity: 147
Merit: 100
software developer
January 12, 2014, 07:54:44 AM
(...)
trying to add the above, but running into problems...

Quote
Restarting Cgminer daemon: /etc/init.d/cgminer.sh: line 134: can't create /: Is a directory
(...)

?!, somehow when I removed the leading space I must have removed 'dev/null' by accident.
Thanks for pointing out, have editited my post above.

Redirect STDOUT to '/dev/null' instead of '/'.


I'm impressed that you have the balls to play around with it.
Please try one module/port (for ex 'if [ "$p" == "0" ]; then' ), only - just in case it doesn't work as expected.
Maybe even restrict testing to one of the four chips on one board, only.

Therefore remove the 'for'-loop and use one value between 0..3 for the core to play with.
Please share your experiences afterwards, thanks in advance!
legendary
Activity: 1036
Merit: 1000
Nighty Night Don't Let The Trolls Bite Nom Nom Nom
January 12, 2014, 05:13:54 AM

Code:
 # Re-enable PLL
                i2cset -y 2 0x71 1 $((p+1))
                        for c in 0 1 2 3 ; do
                                cmd=$(printf "0x84,0x%02X,0,0" $c)
                                spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/
                                cmd=$(printf "0x86,0x%02X,0x01,0xD1" $c)
                                spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/
                                cmd=$(printf "0x85,0x%02X,0,0" $c)
                                spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/
                        done
[/quote]


trying to add the above, but running into problems...

Quote
Restarting Cgminer daemon: /etc/init.d/cgminer.sh: line 134: can't create /: Is a directory



edit: ohhhhh how i hate this editing...... if at first you don't succeed...... offer a reward for someone to teach you...... any takers?
newbie
Activity: 38
Merit: 0
January 11, 2014, 10:44:30 PM
update to at least firmware v0.99
have 0.99 tuning firmware

@Sonic
remove bert-mod. then it should be right.
full member
Activity: 147
Merit: 100
software developer
January 11, 2014, 10:17:20 PM
I might have missed it but if one is running bfgminer instead of cgminer the file to change is different correct?  Like /etc/init.d/bfgminer.sh

No, actually it is the same file '/etc/init.d/cgminer', content has changed.
Here's the complete one from the latest (0.99-2), no difference between October/November devices btw.
It's missing the spi-test line, so I added the part before 'set e', as well as the last line in 'do_start()' and the line in 'do_stop()' into my modified starter based on 0.99-tune.

Code:
#!/bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

use_bfgminer=
if [ -f /config/miner.conf ]; then
. /config/miner.conf
fi
if [ "$use_bfgminer" = true ] ; then
DAEMON=/usr/bin/bfgminer
NAME=bfgminer
DESC="BFGMiner daemon"
EXTRA_OPT="-S knc:auto"
else
DAEMON=/usr/bin/cgminer
NAME=cgminer
DESC="Cgminer daemon"
EXTRA_OPT=
fi

set -e

test -x "$DAEMON" || exit 0

do_start() {
# Stop SPI poller
spi_ena=0
i2cset -y 2 0x71 2 $spi_ena

good_ports=""
bad_ports=""

# CLear faults in megadlynx's
for b in 3 4 5 6 7 8 ; do
for d in 0 1 2 3 4 5 6 7 ; do
i2cset -y $b 0x1$d 3 >/dev/null 2>&1 || true
done
done

for p in 0 1 2 3 4 5 ; do
i2cset -y 2 0x71 1 $((p+1))
good_flag=0
ar="$(spi-test -s 50000 -OHC -D /dev/spidev1.0 0x80,3,0,0,0,0,0,0 | tail -c 13)"
                if [ "x$ar" = "x00 30 A0 01" ] ; then
good_flag=1
fi
ar="$(spi-test -s 50000 -OHC -D /dev/spidev1.0 0x80,2,0,0,0,0,0,0 | tail -c 13)"
                if [ "x$ar" = "x00 30 A0 01" ] ; then
good_flag=1
fi
ar="$(spi-test -s 50000 -OHC -D /dev/spidev1.0 0x80,1,0,0,0,0,0,0 | tail -c 13)"
                if [ "x$ar" = "x00 30 A0 01" ] ; then
good_flag=1
fi
ar="$(spi-test -s 50000 -OHC -D /dev/spidev1.0 0x80,0,0,0,0,0,0,0 | tail -c 13)"
                if [ "x$ar" = "x00 30 A0 01" ] ; then
good_flag=1
fi

if [ "$good_flag" = "1" ] ; then
good_ports=$good_ports" $p"
else
bad_ports=$bad_ports" $p"
fi
done

if [ -n "$good_ports" ] ; then
for p in $good_ports ; do
# re-enable all cores
i=0
while [[ $i -lt 192 ]] ; do
i2cset -y 2 0x2$p $i 1
i=$((i+1))
done
spi_ena=$(( spi_ena | (1 << $p) ))
done
fi
if [ -n "$bad_ports" ] ; then
for p in $bad_ports ; do
# disable all cores
i=0
while [[ $i -lt 192 ]] ; do
i2cset -y 2 0x2$p $i 0
i=$((i+1))
done
spi_ena=$(( spi_ena & ~(1 << $p) ))
done
fi

# Disable direct SPI
i2cset -y 2 0x71 1 0

# Enable SPI poller
i2cset -y 2 0x71 2 $spi_ena

start-stop-daemon -b -S -x screen -- -S cgminer -t cgminer -m -d "$DAEMON" --api-listen -c /config/cgminer.conf $EXTRA_OPT
}

do_stop() {
killall -9 bfgminer cgminer 2>/dev/null || true
}
case "$1" in
  start)
        echo -n "Starting $DESC: "
do_start
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
do_stop
        echo "$NAME."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: "
        do_stop
        do_start
        echo "$NAME."
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0

When enabling bfgminer, file '/config/miner.conf' which is loaded at the beginning contains
Code:
use_bfgminer="true"
legendary
Activity: 1400
Merit: 1000
I owe my soul to the Bitcoin code...
January 11, 2014, 09:46:19 PM
I might have missed it but if one is running bfgminer instead of cgminer the file to change is different correct?  Like /etc/init.d/bfgminer.sh
newbie
Activity: 11
Merit: 0
January 11, 2014, 09:15:01 PM
Done firmware changed to 0.99.1 tuning (or tuned i don't remember) actually mining at 626 Gh/s with cmd=$(printf "0x86,0x%02X,0x02,0x01" $c)

A lot of thanks Smiley
full member
Activity: 147
Merit: 100
software developer
January 11, 2014, 08:15:33 PM
Hi, i am the brother of tiozes, we connect to the jupiter using putty, then press Q, later we open /etc/init.d/cgminer.sh and in the line 61..

[img removed]

That file belongs to a November device. [edit: with latest 0.99-2 the file has changed, might be October, too]
It enables the cores only, but there's no section where the clock speed is set as far as I can read it.
That 're-enable all cores' part can be found on both, October and November devices.
Code:
for p in $good_ports ; do
    # re-enable all cores
    i=0
    while [[ $i -lt 192 ]] ; do
     i2cset -y 2 0x2$p $i 1
        i=$((i+1))
    done
    spi_ena=$(( spi_ena | (1 << $p) ))
done


This 'Re-enable PPL' part with 'spi-test' calls is missing on November devices (as well as on 0.99-2 in general), however 'spi-test' binary is available.
Code:
# Re-enable PLL                                         
i2cset -y 2 0x71 1 $((p+1))                            
for c in 0 1 2 3 ; do                                  
    cmd=$(printf "0x84,0x%02X,0,0" $c)              
    spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/dev/null
    cmd=$(printf "0x86,0x%02X,0x01,0xD1" $c)
    spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/dev/null
    cmd=$(printf "0x85,0x%02X,0,0" $c)              
    spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/dev/null
done

for each good port the following is executed on October devices to set the clock speed, before all cores are re-enabled.
The line where the clock speed is set is this one
Code:
cmd=$(printf "0x86,0x%02X,0x01,0xD1" $c)
spi-test -s 50000 -OHC -D /dev/spidev1.0 $cmd >/dev/null
it means for each port, all 4 chips are touched ($c=[0..3])
Code:
spi-test -s 50000 -OHC -D /dev/spidev1.0 0x86,0x00,0x01,0xD1
..
spi-test -s 50000 -OHC -D /dev/spidev1.0 0x86,0x03,0x01,0xD1

So you could play around with this command on a November unit.
Overclocking might work if they are not already at their max and most important:
be aware please you can blow up your hardware without any possibility for RMA.

Here's some info about spi-test to understand better what this magic line does
Code:
Usage: spi-test [-DsbdlnHOLC3] [data,..]
  -D --device   device to use (default /dev/spidev1.1)
  -s --speed    max speed (Hz)
  -d --delay    delay (usec)
  -b --bpw      bits per word
  -n --len      length
  -l --loop     loopback
  -H --cpha     clock phase
  -O --cpol     clock polarity
  -L --lsb      least significant bit first
  -C --cs-high  chip select active high
  -3 --3wire    SI/SO signals shared
  data is a series of octets to send, separated by comma, or b# to switch to another bits per word
newbie
Activity: 11
Merit: 0
January 11, 2014, 07:42:27 PM
update to at least firmware v0.99
have 0.99 tuning firmware
full member
Activity: 237
Merit: 100
January 11, 2014, 07:24:06 PM
update to at least firmware v0.99
newbie
Activity: 11
Merit: 0
January 11, 2014, 06:59:18 PM
Hi, i am the brother of tiozes, we connect to the jupiter using putty, then press Q, later we open /etc/init.d/cgminer.sh and in the line 61..

http://imagizer.imageshack.us/v2/800x600q90/138/eago.jpg
legendary
Activity: 2408
Merit: 1004
January 11, 2014, 05:30:30 PM
October with 4vrm
member
Activity: 329
Merit: 10
https://eloncity.io/
January 11, 2014, 04:54:07 PM
OK, finally decided to give this a go, october jupiter 8 vrm which was running around 557GH

Followed the instructions to change to 211, and initially speed was awful around 400, so using cyper's post as a guide started messing with advanced page replicating the spi voltage and frequency and then tweaking the various die voltages, after a while I only managed to get it back up to around 500 and decided to give up.

Flashed back to 0.98 and the miner returned to it's usual 557GH

Today decided to give it another go, flashed back to 0.99.1-tune, made the alteration to 221 and restarted and it was up around 620 which was excellent, when I looked at the advanced page it had remembered all my settings from the previous attempt.

Most of the dies were running around 50A similar to the screenshot cyper posted, but one was up at 54A so I lowered it's voltage setting and hit apply, immediately the miner dropped back down to 550GH and all the dies dropped back down to 42-43A

Very confused now  Huh

I have an October Jupiter w/8 VRM's.  For line 61 I am using the following which gets me 600 - 615 GH/s with stable temps.

cmd=$(printf "0x86,0x%02X,0x02,0x01" $c)  

My factory code is as follows which is different from what everyone else appears to have for some reason.   cmd=$(printf "0x86,0x%02X,0x01,0xD1" $c)

You might want to give it a whirl.  

-MW
ImI
legendary
Activity: 1946
Merit: 1019
January 11, 2014, 03:45:55 PM
Mining Status

CGMiner Status   Running (pid=1896)
Last Checked   Sat Jan 11 18:48:43 UTC 2014
Avg. Hash Rate   639 Gh/s
Difficulty Accepted   3,026,944
Difficulty Rejected   23,552 (0.8 %)
Hardware Errors   61,345 (1.9 %)
WU   8,937
Difficulty Stale   0
Network Blocks   50
Pool Rejected   0.8 %
Pool Stale   0
Best Share   3,130,981
Found Blocks   0
HW Status

ASIC slot #1   50.0 ℃
ASIC slot #2   -
ASIC slot #3   48.5 ℃
ASIC slot #4   54.0 ℃
ASIC slot #5   40.0 ℃
ASIC slot #6   -


October Jup with 8 vrm / 4 vrm?
legendary
Activity: 2408
Merit: 1004
January 11, 2014, 01:49:35 PM
Mining Status

CGMiner Status   Running (pid=1896)
Last Checked   Sat Jan 11 18:48:43 UTC 2014
Avg. Hash Rate   639 Gh/s
Difficulty Accepted   3,026,944
Difficulty Rejected   23,552 (0.8 %)
Hardware Errors   61,345 (1.9 %)
WU   8,937
Difficulty Stale   0
Network Blocks   50
Pool Rejected   0.8 %
Pool Stale   0
Best Share   3,130,981
Found Blocks   0
HW Status

ASIC slot #1   50.0 ℃
ASIC slot #2   -
ASIC slot #3   48.5 ℃
ASIC slot #4   54.0 ℃
ASIC slot #5   40.0 ℃
ASIC slot #6   -
sr. member
Activity: 281
Merit: 250
January 11, 2014, 10:02:10 AM
i changed the spi to sevral values
i have not seen any changes in hashing speed or hardware error. And half my dies work on 251 which i considder the max that can be done whith de vrms and board design i guess
legendary
Activity: 861
Merit: 1000
“Create Your Decentralized Life”
January 11, 2014, 09:36:56 AM
(...)

hi, I have a jupiter October, Might you tell me what settings I have for that power?

F.A 1200W

I'm Spanish and I do not quite understand.

regards


¿Qué parte no es comprensible para usted? (google translate)


All you need to do is: modify line 61 in the cgminer starter where the clock speed is being set.
It is located on your miner at the following path '/etc/init.d/cgminer.sh'

The line looks like this:
 cmd=$(printf "0x86,0x%02X,0x01,0xF1" $c) 

Change it for example (https://bitcointalksearch.org/topic/m.3985606) to
 cmd=$(printf "0x86,0x%02X,0x02,0x11" $c)

Notice, please, after rebooting changes are gone, therefore copy the file to '/config' first and modify it there.
After modification is done you can execute the modified starter with argument 'restart'
 /config/cgminer.sh restart

Then keep an eye on your advanced tab values and temps!
And cgminer to find best clock setting for your device.

Do I have to change the voltage and frequency SPI SPI? in paragraph advanced

This is what confuses me

regards
full member
Activity: 147
Merit: 100
software developer
January 11, 2014, 06:07:32 AM
(...)

hi, I have a jupiter October, Might you tell me what settings I have for that power?

F.A 1200W

I'm Spanish and I do not quite understand.

regards


¿Qué parte no es comprensible para usted? (google translate)


All you need to do is: modify line 61 in the cgminer starter where the clock speed is being set.
It is located on your miner at the following path '/etc/init.d/cgminer.sh'

The line looks like this:
 cmd=$(printf "0x86,0x%02X,0x01,0xF1" $c) 

Change it for example (https://bitcointalksearch.org/topic/m.3985606) to
 cmd=$(printf "0x86,0x%02X,0x02,0x11" $c)

Notice, please, after rebooting changes are gone, therefore copy the file to '/config' first and modify it there.
After modification is done you can execute the modified starter with argument 'restart'
 /config/cgminer.sh restart

Then keep an eye on your advanced tab values and temps!
And cgminer to find best clock setting for your device.
legendary
Activity: 861
Merit: 1000
“Create Your Decentralized Life”
January 10, 2014, 09:57:07 PM
Just jumped upto 231 myself...put copper heatsinks on vrms and removed pci extenders cause i was only getting 11.5v on one module and the extenders were getting very hot...running great now 12v-11.9v on all modules now, temps are 64, 57, 53, 52 with 2 fans on rear modules...around 55-56a per vrm and getting around .8% hw errors...up .4% from 211 but i suppose i could push alittle more volts and lower it and getting around 660-680 poolside on eligius Smiley ty ty maybe i'll make ROI outta this machine yet...7 btc more n its party time!! Thanks for this thread  Grin

Great point about the PCI extenders, I need to take a look at that as well since my back modules seem to be running 11.6-.7.. Given your experience any recommendations on how to run the cables, or did you manage to find a power supply with long enough PCIe power cables?

ya what cablez said, but i do have a psu that has long pcie cables...and update on hashrate...eligius 12hr rate says 673gh/s Cheesy and my cgminer says 674...that is pretty darn close Smiley


hi, I have a jupiter October, Might you tell me what settings I have for that power?

F.A 1200W

I'm Spanish and I do not quite understand.

regards
Pages:
Jump to: