Bitcoin Forum
May 05, 2024, 03:21:05 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: 1 2 [All]
  Print  
Author Topic: Simple core/memory auto-tuner script  (Read 4572 times)
FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
April 30, 2013, 10:03:10 PM
Last edit: May 02, 2013, 09:16:28 PM by FaT
 #1

I didn't feel like spending ages fiddling with my GPU core and memory clock settings to find the sweet spot for Scrypt based mining, so I created a simple python script to do it for me!
The script uses the cgminer API, so you will have to enable that.

Thought I may as well share it: https://github.com/Uvedale/CGMinerTuner

The README on the git page gives all the available command line options and usage. This is a basic overview:

You specify your core clock and memory clock search ranges, and it will try combinations within those ranges, recording the achieved kh as it goes along.
Once it is done, it will give you a report on the best combinations.

There are a bunch of options you can add such as:
- max allowable temperature
- desired core:mem ratio range (to constrain search time)
- memory clock increment step
- core clock increment step
- time to wait between increment steps (longer is obviously better for more accurate results, but will impact the search time considerably)
- how many top results to show at the end

Other than possibly increasing your hash rate, it can also be used to find lower clocks that give you the same/similar hash rate.

This hasn't been thoroughly tested, so use at your own risk.
I'm sure the code can be improved considerably; I'll gladly accept pull requests!

If you find this helpful, please consider donating (especially if it increased your mining speed Cheesy )

BTC: 1CM1zDcfUpg81fCJxacq2nNsZCE3G96FLH
LTC: Lej4FBr9k3HM49GJix922xyJCm1whqHmfU
FTC: 72KjWoZKM3C8S8xaujTNwcFjFbq48XNfpg
1714879265
Hero Member
*
Offline Offline

Posts: 1714879265

View Profile Personal Message (Offline)

Ignore
1714879265
Reply with quote  #2

1714879265
Report to moderator
The forum was founded in 2009 by Satoshi and Sirius. It replaced a SourceForge forum.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
503guy
Full Member
***
Offline Offline

Activity: 140
Merit: 100



View Profile
April 30, 2013, 10:05:41 PM
 #2

Pretty cool.  I'll give it a shot and report back.

MrWizard
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile
April 30, 2013, 10:34:15 PM
 #3

I looked at the code and it looks safe.

Running it now.

In the readme.md file the example says to use -h 192.168.0.4, but it should be -i 192.168.0.4 (or your appropriate ip address).

I'm running two cgminers and can only tune one at a time without changing the default API address of the second cgminer.  I don't know how to do that yet.

"I walked into the room dripping in Bitcoins.  Yea dripping in Bitcoins."
(BTC) 168DCCeGmDy3xTWRimLVhvKtK3yEWbpsSg     (LTC) LbYS8VFqFSU7B9bfaHD11seQMtrtYEKpLe
(BBQ) bNVZErvwLzpEG7H3kt1fycWspzRQB1MJzL
FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
May 01, 2013, 12:11:11 AM
 #4

In the readme.md file the example says to use -h 192.168.0.4, but it should be -i 192.168.0.4 (or your appropriate ip address).

Thanks - fixed.

I'm running two cgminers and can only tune one at a time without changing the default API address of the second cgminer.  I don't know how to do that yet.

Not sure I follow. If you have two cgminer programs running, one would have to have its API listening on a different port (using --api-port).
If you wanted to tune both of them at the same time, you would just launch two instances of the tuner, specifying the custom API port of the 2nd cgminer instance in the parameters of the second tuner instance.
MrWizard
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile
May 01, 2013, 12:17:30 AM
 #5


Not sure I follow. If you have two cgminer programs running, one would have to have its API listening on a different port (using --api-port).
If you wanted to tune both of them at the same time, you would just launch two instances of the tuner, specifying the custom API port of the 2nd cgminer instance in the parameters of the second tuner instance.

That's right.  I need to add something like: --api-port 4029  to the second cgminer, and then specify that port to the 2nd tuner.

"I walked into the room dripping in Bitcoins.  Yea dripping in Bitcoins."
(BTC) 168DCCeGmDy3xTWRimLVhvKtK3yEWbpsSg     (LTC) LbYS8VFqFSU7B9bfaHD11seQMtrtYEKpLe
(BBQ) bNVZErvwLzpEG7H3kt1fycWspzRQB1MJzL
503guy
Full Member
***
Offline Offline

Activity: 140
Merit: 100



View Profile
May 01, 2013, 12:33:11 AM
 #6


I'm running two cgminers and can only tune one at a time without changing the default API address of the second cgminer.  I don't know how to do that yet.

Just curious, why are you running two instances of cgminer on the same machine?  Different pools?

MrWizard
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile
May 01, 2013, 12:38:26 AM
 #7


I'm running two cgminers and can only tune one at a time without changing the default API address of the second cgminer.  I don't know how to do that yet.

Just curious, why are you running two instances of cgminer on the same machine?  Different pools?
Different cards.  Needing to set different Intensity, thread-concurrency, work size, etc.
And since i'm mining also on my main video card, I sometimes have to stop that miner if I have to do other gpu intensive tasks.

"I walked into the room dripping in Bitcoins.  Yea dripping in Bitcoins."
(BTC) 168DCCeGmDy3xTWRimLVhvKtK3yEWbpsSg     (LTC) LbYS8VFqFSU7B9bfaHD11seQMtrtYEKpLe
(BBQ) bNVZErvwLzpEG7H3kt1fycWspzRQB1MJzL
MrWizard
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile
May 01, 2013, 09:56:38 PM
 #8

I'm sending you a donation.  Not because This tool helped me speed up mining.  I got zero increase in mining.  I guess my cards are near optimally tuned.  But because I was able to optimize in another way.  Also,  I now have example code on how to talk to cgminer via APIs.  That could be useful to me some day.

"I walked into the room dripping in Bitcoins.  Yea dripping in Bitcoins."
(BTC) 168DCCeGmDy3xTWRimLVhvKtK3yEWbpsSg     (LTC) LbYS8VFqFSU7B9bfaHD11seQMtrtYEKpLe
(BBQ) bNVZErvwLzpEG7H3kt1fycWspzRQB1MJzL
glendall
Legendary
*
Offline Offline

Activity: 2100
Merit: 1018


Sugars.zone | DatingFi - Earn for Posting


View Profile
May 01, 2013, 10:02:30 PM
 #9

Going to give this a go tonight, looks great, thanks...

.SUGAR.
██   ██

██   ██

██   ██

██   ██

██   ██

██   ██
▄▄████████████████████▄▄
▄████████████████████████▄
███████▀▀▀██████▀▀▀███████
█████▀██████▀▀██████▀█████
██████████████████████████
██████████████████████████
█████████████████████▄████
██████████████████████████
████████▄████████▄████████
██████████████████████████
▀████████████████████████▀
▀▀████████████████████▀▀

██   ██

██   ██

██   ██

██   ██

██   ██

██   ██
███████████████████████████
███████████████████████████
██████               ██████
██████   ▄████▀      ██████
██████▄▄▄███▀   ▄█   ██████
██████████▀   ▄███   ██████
████████▀   ▄█████▄▄▄██████
██████▀   ▄███████▀▀▀██████
██████   ▀▀▀▀▀▀▀▀▀   ██████
██████               ██████
███████████████████████████
███████████████████████████
.
Backed By
ZetaChain

██   ██

██   ██

██   ██

██   ██

██   ██

██   ██

██   ██

██   ██

██   ██

██   ██

██   ██

██   ██
▄▄████████████████████▄▄
██████████████████████████
████████████████████████████
█████████████████▀▀  ███████
█████████████▀▀      ███████
█████████▀▀   ▄▄     ███████
█████▀▀    ▄█▀▀     ████████
█████████ █▀        ████████
█████████ █ ▄███▄   ████████
██████████████████▄▄████████
██████████████████████████
▀▀████████████████████▀▀
▄▄████████████████████▄▄
██████████████████████████
██████ ▄▀██████████  ███████
███████▄▀▄▀██████  █████████
█████████▄▀▄▀██  ███████████
███████████▄▀▄ █████████████
███████████  ▄▀▄▀███████████
█████████  ████▄▀▄▀█████████
███████  ████████▄▀ ████████
████████████████████████████
██████████████████████████
▀▀████████████████████▀▀
FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
May 02, 2013, 09:08:18 PM
 #10

I'm sending you a donation.  Not because This tool helped me speed up mining.  I got zero increase in mining.  I guess my cards are near optimally tuned.  But because I was able to optimize in another way.  Also,  I now have example code on how to talk to cgminer via APIs.  That could be useful to me some day.

Thanks!
erpbridge
Legendary
*
Offline Offline

Activity: 954
Merit: 1000


View Profile
May 02, 2013, 09:35:04 PM
 #11

Its throwing an error when I try to run against my miner machine remotely... same when I try to run against it locally.

C:\temp\virtual currencies\CGMinerTuner-master>python CGMinerTuner.py -i 192.168.1.111 -d 0 -c 800-1100 -m 1100-1500 -r 0.5-0.7 -t 82 --showtop 10
  File "CGMinerTuner.py", line 154
    except Exception, e:
                    ^
SyntaxError: invalid syntax
FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
May 02, 2013, 09:37:51 PM
 #12

Its throwing an error when I try to run against my miner machine remotely... same when I try to run against it locally.

C:\temp\virtual currencies\CGMinerTuner-master>python CGMinerTuner.py -i 192.168.1.111 -d 0 -c 800-1100 -m 1100-1500 -r 0.5-0.7 -t 82 --showtop 10
  File "CGMinerTuner.py", line 154
    except Exception, e:
                    ^
SyntaxError: invalid syntax


Are you using a Mac? You probably need to update your python installation (I used 2.7, but 3 should work too).
Download link: http://www.python.org/download/releases/2.7.4/
FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
May 02, 2013, 09:40:40 PM
 #13

I'm blind. Didn't see your obviously Windows command prompt.
What is the output of 'python --version'?
erpbridge
Legendary
*
Offline Offline

Activity: 954
Merit: 1000


View Profile
May 02, 2013, 10:18:34 PM
 #14

Python 3.3.1 ... The most current from Python's site over the weekend.
Boxman90
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


View Profile
May 02, 2013, 10:26:14 PM
 #15

Same error here.. gonna install 2.7 now

Also i'm using 64 bit -- should i take 32bit?

LTC: LKKy4eDWyVtSrQAJy7Qmmz61RaFY91D9yC   BTC: 18fzdnCkuUNthCD8hM36UBGopFa9ij78gG
FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
May 02, 2013, 10:29:10 PM
 #16

Found the problem, its simple to fix. Will push the changes soon.
turtle83
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250


Supersonic


View Profile WWW
May 02, 2013, 10:29:33 PM
 #17

Python 3.3.1 ... The most current from Python's site over the weekend.

the script worked fine on linux with 2.7.x

You may want to try 2.7 ...
There are big incompatible changes between 2.x and 3.x , and most people still develop for 2.x unless they explicitly state that they require(or support) 3.

FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
May 02, 2013, 10:41:21 PM
 #18

The latest version should be compatible with Python 3.x now.
nst6563
Sr. Member
****
Offline Offline

Activity: 252
Merit: 254


View Profile
May 08, 2013, 04:36:12 AM
 #19

I just tried this and keep running into "failed to set new gpu core clock".
Any ideas or is my card (4870x2) not compatible?

Win7 x64
Cgminer 3.0
Python 3 (will try 2.7 tomorrow)
amd/ati driver 13.1

thanks
FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
May 08, 2013, 05:57:46 AM
 #20

I just tried this and keep running into "failed to set new gpu core clock".
Any ideas or is my card (4870x2) not compatible?

Win7 x64
Cgminer 3.0
Python 3 (will try 2.7 tomorrow)
amd/ati driver 13.1

thanks

Can you change your GPU clocks using cgminer directly? If you try, ignore any "success" messages cgminer gives you after a clock change and verify that the new clocks are being used yourself (it should display them). This python just uses cgminers clock changing functionality, so if it doesn't work in cgminer, this script won't work.

Make sure you are giving the tuner sensible clock ranges for your card too.
joshki
Full Member
***
Offline Offline

Activity: 210
Merit: 100


View Profile
May 08, 2013, 06:01:26 AM
 #21

I'm sending you a donation.  Not because This tool helped me speed up mining.  I got zero increase in mining.  I guess my cards are near optimally tuned.  But because I was able to optimize in another way.  Also,  I now have example code on how to talk to cgminer via APIs.  That could be useful to me some day.

You know that there are multiple examples of how to talk to the api in different languages in the cgminer package itself, right?
nst6563
Sr. Member
****
Offline Offline

Activity: 252
Merit: 254


View Profile
May 08, 2013, 02:20:49 PM
 #22


Can you change your GPU clocks using cgminer directly? If you try, ignore any "success" messages cgminer gives you after a clock change and verify that the new clocks are being used yourself (it should display them). This python just uses cgminers clock changing functionality, so if it doesn't work in cgminer, this script won't work.

Make sure you are giving the tuner sensible clock ranges for your card too.

checked with cgminer and it looks like I can't change the clocks in it either.  That sux.  Guess I'm S.O.L. on that.

Any chance you're going to expand this script to include other cgminer settings like threads, thread concurrency, worksize, etc?
anatolikostis
Legendary
*
Offline Offline

Activity: 2026
Merit: 1005



View Profile
May 10, 2013, 07:11:53 PM
 #23

what kind syntax of command is for Win64 for example?  Undecided
FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
May 17, 2013, 01:29:04 PM
 #24


Can you change your GPU clocks using cgminer directly? If you try, ignore any "success" messages cgminer gives you after a clock change and verify that the new clocks are being used yourself (it should display them). This python just uses cgminers clock changing functionality, so if it doesn't work in cgminer, this script won't work.

Make sure you are giving the tuner sensible clock ranges for your card too.

checked with cgminer and it looks like I can't change the clocks in it either.  That sux.  Guess I'm S.O.L. on that.

Any chance you're going to expand this script to include other cgminer settings like threads, thread concurrency, worksize, etc?

Not at the moment. It seems like there are well established values to try for different cards though.
FaT (OP)
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
May 17, 2013, 01:31:13 PM
 #25

what kind syntax of command is for Win64 for example?  Undecided

Syntax is exactly the same, you just need to have python installed. You might need to give the full path to python when launching the script, for example:
>C:\python27\python.exe CGMinerTuner.py ....
sapsan
Member
**
Offline Offline

Activity: 86
Merit: 10



View Profile
January 02, 2014, 07:11:47 PM
 #26

It seems that this a script does not want to work with cgminer 3.7.2
LuxCapacitor
Newbie
*
Offline Offline

Activity: 36
Merit: 0


View Profile
January 13, 2014, 05:39:14 AM
Last edit: January 14, 2014, 08:06:00 AM by LuxCapacitor
 #27

It seems that this a script does not want to work with cgminer 3.7.2

I just noticed this after fooling with it for an hour  Cry

EDIT:

After some research and trial and error, adding these settings allowed me to use CGMinerTuner

Code:
"api-listen" : true,
"api-allow" : "W:192.168.1.100,192.168.1/24,127.0.0.1",
"api-port" : "4028",

We'll see what happens in a few hours  Grin
ilic
Hero Member
*****
Offline Offline

Activity: 535
Merit: 502


View Profile
January 13, 2014, 05:45:54 AM
 #28

ive been looking for something like this, just what i need!

Good free and easy Bitcoin Faucet thingy: https://freebitco.in/?r=9293711
Do not invest in HYIPs people, however you can put some into iCenter: https://t.me/icenter_bot?start=j5t25s58148
Pages: 1 2 [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!