Bitcoin Forum
January 18, 2018, 08:53:38 AM *
News: Electrum users must upgrade to 3.0.5 if they haven't already. More info.
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 ... 165 »
  Print  
Author Topic: [ANN]: cpuminer-opt v3.7.10, open source optimized multi-algo CPU miner  (Read 390416 times)
chrysophylax
Legendary
*
Offline Offline

Activity: 1022


--- ChainWorks Industries ---


View Profile WWW
January 31, 2016, 07:25:54 AM
 #281

The following may be of interest to devs of cpuminer, ccminer and maybe others.

Update:

More architectural changes made. Most declarations moved from cpu-miner.c
to miner.h so no files will need to include it. The system I am famiiar with could prevent
being embedded adn it was the default. The owner had to explicitly allow  inclusion
and to whom. Nice feature.

I still have to migrate full_test and get_opt to use the gate. I will have to split up the options
into common options and algo specific options. cpuminer-c will handler the common options
and the algos will handle the algo-specific options that apply to them.

I will also look into enhancing the registration process to have the algo and its custom
options added to the argument list and help file. These are the only remaining holes in the gate,
to my knowledge.

The gate is almost complete. It's called a gate because it is the only path between cpu-miner.c
and the algos. A very popular technique where I come from.

A developpers preview should be avilable in a couple of days.

I am hopeful the rearchitecting will help solve some of the other nagging issues I have been having,
like flipping between undefined and multi defined.

Previous post:
--------
I've done a lot of rebuilding under the hood because  miner_thread had become
polluted with too much algo specific code. Well, that is all gone.
Folllowing is a summary of the changes. I will make a preview available before release.

- restructured the file system to be more modular with respect to algos

- removed bloat added to support multiple CPU targets.

- removed all algo specific code from miner.h and cpu-miner.c, and eventually util.c
   and anywhere else I find it, it all lives now in the algo's source file.

- adding algos doesn't require any changes to base code, a registry interface file requires adding one entry.

- redesigned the scanhash engine to use function pointers instead of switch/case.

- removed many long switch/case statements.

- created a registry where algos register their functions with cpu-miner.

- registry functions include scanhash, hash, init_ctx, get_max64, and get_custom_opts with plans
  to add full_test and any others I find.

- enabled initialization of algo context outside of miner_thread loop.

- changes do not increase performance directly but enables more efficient management of contexts
  which helps certain algos, specificaly quark.

I just realized that with this archtitecture it might be possible to implement mining different algos
or different pools in different threads at the same time. How cool is that? But is it useful?

Found another gate function I need to implenent, get_scratchbuf

that would be interesting to say the least - if not practical ...

im getting more and more stable here - and still preparing for the second move in 5weeks time - but i can join in more often now mate ...

what can i do to help here - as your testing seems to be taking full flight - with some of the best of the community i must add Smiley ...

glad to see so much happening here ...

#crysx

Hey crysx,

Nice to hear from you.  There are a couple of people testing the SSE2 target, that is the only thing I can't test myself.
If you can help out with that it would be great because there are a couple of issues.

I've got addreses form TPruvot to test the obscure algos on yiimp, so , other than real old CPUs, I'm good to go.

You can always s mine for yor own benefit if you like. Wink

yup - i can see the guys and gals have been doing an awesome job testing ...

let me know the addresses you want to mine to for testing - pm then if you want - or publish them here ...

ill have a little bit more time after the next few days ... still unpacking and repacking unfortunately for my partner and i ...

#crysx

grn - Gfz2cXMkhMZYWSFvLEMnM8bXk7X5Mtq2J2 . exchange - https://www.cryptopia.co.nz/Exchange/?market=GRN_BTC . cwi thread - https://bitcointalk.org/index.php?topic=1563601 . email - crysx@gnxs.com .
1516265618
Hero Member
*
Offline Offline

Posts: 1516265618

View Profile Personal Message (Offline)

Ignore
1516265618
Reply with quote  #2

1516265618
Report to moderator
1516265618
Hero Member
*
Offline Offline

Posts: 1516265618

View Profile Personal Message (Offline)

Ignore
1516265618
Reply with quote  #2

1516265618
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
chrysophylax
Legendary
*
Offline Offline

Activity: 1022


--- ChainWorks Industries ---


View Profile WWW
January 31, 2016, 07:28:53 AM
 #282

Code:
[2016-01-31 00:05:26] accepted: 15/15 (100.00%), 2316 kH/s yes!
[2016-01-31 00:05:34] CPU #47: 49.16 kH/s
^C[2016-01-31 00:05:42] SIGINT received, exiting
thewolf@thewolf-H8QG6:~/Downloads/cpuminer-opt-3.0.7$ ./cpuminer -a x11 -o stratum+tcp://x11.usa.nicehash.com:3336 -u 18tvS3deKZK5q4eTtPRWYeEMWmGmuErHgz.H8QG6 -p d=0.01 -t 48

 Grin Grin Grin 48 cores of goodness. Having problems getting the 4th CPU to work :-(

2.3 MH on a CPU, nice! How much do they cost?

usually this is a bios tweak / setting that disables the cpus ...

opterons mainly - but that was a while back when i used to build these big servers ...

joblo - if you ever want to have a foray into the cuda world - talk to me first please mate Wink ...

#crysx

grn - Gfz2cXMkhMZYWSFvLEMnM8bXk7X5Mtq2J2 . exchange - https://www.cryptopia.co.nz/Exchange/?market=GRN_BTC . cwi thread - https://bitcointalk.org/index.php?topic=1563601 . email - crysx@gnxs.com .
joblo
Legendary
*
Offline Offline

Activity: 1008


View Profile
January 31, 2016, 08:21:41 AM
 #283

Code:
[2016-01-31 00:05:26] accepted: 15/15 (100.00%), 2316 kH/s yes!
[2016-01-31 00:05:34] CPU #47: 49.16 kH/s
^C[2016-01-31 00:05:42] SIGINT received, exiting
thewolf@thewolf-H8QG6:~/Downloads/cpuminer-opt-3.0.7$ ./cpuminer -a x11 -o stratum+tcp://x11.usa.nicehash.com:3336 -u 18tvS3deKZK5q4eTtPRWYeEMWmGmuErHgz.H8QG6 -p d=0.01 -t 48

 Grin Grin Grin 48 cores of goodness. Having problems getting the 4th CPU to work :-(

2.3 MH on a CPU, nice! How much do they cost?

usually this is a bios tweak / setting that disables the cpus ...

opterons mainly - but that was a while back when i used to build these big servers ...

joblo - if you ever want to have a foray into the cuda world - talk to me first please mate Wink ...

#crysx

It's only a matter of time. Thi srearchitecting of the front end is going to pay off well because
it's identical to ccminer. I;m also learning a lot about the algo chains and how hashing is done.
The only thingI'll have left to struggle with is the cuda architecture because it's so foreign to
anything I'm familiar with and good docs are hard to find. But I'm hoping I can be useful.

Principal developer of cpuminer-opt, the optimized multi-algo CPU miner.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
https://bitcointalk.org/index.php?topic=1326803.0
MaxDZ8
Hero Member
*****
Offline Offline

Activity: 673



View Profile
January 31, 2016, 08:32:31 AM
 #284

Cleaning up, cleaning up! Have you considered making it data-driven? I was thinking about loading CL kernels for CPU-side verifications as well. At that point we shouldn't even need to recompile at all. Or maybe something DLL based.
chrysophylax
Legendary
*
Offline Offline

Activity: 1022


--- ChainWorks Industries ---


View Profile WWW
January 31, 2016, 08:39:46 AM
 #285

Code:
[2016-01-31 00:05:26] accepted: 15/15 (100.00%), 2316 kH/s yes!
[2016-01-31 00:05:34] CPU #47: 49.16 kH/s
^C[2016-01-31 00:05:42] SIGINT received, exiting
thewolf@thewolf-H8QG6:~/Downloads/cpuminer-opt-3.0.7$ ./cpuminer -a x11 -o stratum+tcp://x11.usa.nicehash.com:3336 -u 18tvS3deKZK5q4eTtPRWYeEMWmGmuErHgz.H8QG6 -p d=0.01 -t 48

 Grin Grin Grin 48 cores of goodness. Having problems getting the 4th CPU to work :-(

2.3 MH on a CPU, nice! How much do they cost?

usually this is a bios tweak / setting that disables the cpus ...

opterons mainly - but that was a while back when i used to build these big servers ...

joblo - if you ever want to have a foray into the cuda world - talk to me first please mate Wink ...

#crysx

It's only a matter of time. Thi srearchitecting of the front end is going to pay off well because
it's identical to ccminer. I;m also learning a lot about the algo chains and how hashing is done.
The only thingI'll have left to struggle with is the cuda architecture because it's so foreign to
anything I'm familiar with and good docs are hard to find. But I'm hoping I can be useful.

well - if there is an option there - come and have a chat ...

i dont think it will take long for you to get a grasp of things - it will take a while to really get fluent with it all - and to get to the 'other' devs levels ( yes djm34 wolf0 sp pallas and many many more ) its a matter of experience and time ...

i kick myself everytime i think of how i was the top 3% of university and i dropped out - just before my degree was getting into c++ heavily ... id already got pascal and cobol almost down pat - c++ was next ...

now there is bringing back a HUGE amount of memories ... yup - i know why i dropped out - stupid young fella who knew everything - i was ... Wink ...

#crysx

grn - Gfz2cXMkhMZYWSFvLEMnM8bXk7X5Mtq2J2 . exchange - https://www.cryptopia.co.nz/Exchange/?market=GRN_BTC . cwi thread - https://bitcointalk.org/index.php?topic=1563601 . email - crysx@gnxs.com .
joblo
Legendary
*
Offline Offline

Activity: 1008


View Profile
January 31, 2016, 08:50:34 AM
 #286

Cleaning up, cleaning up! Have you considered making it data-driven? I was thinking about loading CL kernels for CPU-side verifications as well. At that point we shouldn't even need to recompile at all. Or maybe something DLL based.

If I'm not mistaken that sounds a lot like sgminer. I haven't looked at that yet as I use cuda on the GPU side.
I'm aware you can install kernels without recompiling but is that an opencl only feature? I so it dosn't do
much for a cpu miner. My main interest in sgminer would be to look into Intel IGPU mining. Can't find much
info about it, only that it can be. and has been done. That would also be an opportunity to get up to speed
on opencl. If you would happen to know anything about that i'd be grateful if you'd share it..

Dll based? (shudder) that's Windows? Or do you mean shared libraries? My concern about shared libraries
it could cap performnance to the lowest common denoniminator. And I haven't had much luck with Windows
lately.

And data driven, well I think it already supports config files if that's what you mean.

I have been doing mostly grunt work to get up to speed. I saw a mess and decided to clean it up.
Aklthough I may sometimes have visions I wouldn't call myself a visionary and would leave the
more specialist work for the specialists, at least for now.

Principal developer of cpuminer-opt, the optimized multi-algo CPU miner.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
https://bitcointalk.org/index.php?topic=1326803.0
joblo
Legendary
*
Offline Offline

Activity: 1008


View Profile
January 31, 2016, 08:56:33 AM
 #287

Code:
[2016-01-31 00:05:26] accepted: 15/15 (100.00%), 2316 kH/s yes!
[2016-01-31 00:05:34] CPU #47: 49.16 kH/s
^C[2016-01-31 00:05:42] SIGINT received, exiting
thewolf@thewolf-H8QG6:~/Downloads/cpuminer-opt-3.0.7$ ./cpuminer -a x11 -o stratum+tcp://x11.usa.nicehash.com:3336 -u 18tvS3deKZK5q4eTtPRWYeEMWmGmuErHgz.H8QG6 -p d=0.01 -t 48

 Grin Grin Grin 48 cores of goodness. Having problems getting the 4th CPU to work :-(

2.3 MH on a CPU, nice! How much do they cost?

usually this is a bios tweak / setting that disables the cpus ...

opterons mainly - but that was a while back when i used to build these big servers ...

joblo - if you ever want to have a foray into the cuda world - talk to me first please mate Wink ...

#crysx

It's only a matter of time. Thi srearchitecting of the front end is going to pay off well because
it's identical to ccminer. I;m also learning a lot about the algo chains and how hashing is done.
The only thingI'll have left to struggle with is the cuda architecture because it's so foreign to
anything I'm familiar with and good docs are hard to find. But I'm hoping I can be useful.

well - if there is an option there - come and have a chat ...

i dont think it will take long for you to get a grasp of things - it will take a while to really get fluent with it all - and to get to the 'other' devs levels ( yes djm34 wolf0 sp pallas and many many more ) its a matter of experience and time ...

i kick myself everytime i think of how i was the top 3% of university and i dropped out - just before my degree was getting into c++ heavily ... id already got pascal and cobol almost down pat - c++ was next ...

now there is bringing back a HUGE amount of memories ... yup - i know why i dropped out - stupid young fella who knew everything - i was ... Wink ...

#crysx

It took me 11 years to complete mine but I went off track in year 1, had a good paying PT job and cut classes for
more hours. The job was a dead end and and eventually I got motivated to go back to school, just to get out of
that job. I don't now how old you are but it's never too late. Cobol eh? There may still be demand for Cobol
support.


Principal developer of cpuminer-opt, the optimized multi-algo CPU miner.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
https://bitcointalk.org/index.php?topic=1326803.0
pallas
Legendary
*
Offline Offline

Activity: 1526


Black Belt Developer


View Profile
January 31, 2016, 09:20:22 AM
 #288

Most of the studies I did were computing related, still most of my knowledge is self-made.
Cobol? There is still a lot around: just look at banks and travel GDSs, for example.

joblo
Legendary
*
Offline Offline

Activity: 1008


View Profile
January 31, 2016, 09:45:46 AM
 #289

Most of the studies I did were computing related, still most of my knowledge is self-made.
Cobol? There is still a lot around: just look at banks and travel GDSs, for example.

I reecall learning a language called simula, for simulations. I was OO but but thtat was before
OO became popular. While off school the OO buz sarted, andI was reasding a bit about it and wondred
what all the fuss was about. It took me a while to put the pieces together and that I wasn't impressed
with it because  I alredy did it. But simula was an early implentation and didn't have all the feature
of c++.

The irony is that we had one term to learn the labguage nd a second term to use it for as simulation
but between terms they upgraded the system and couldn't get a compiler for the new system.

Principal developer of cpuminer-opt, the optimized multi-algo CPU miner.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
https://bitcointalk.org/index.php?topic=1326803.0
zTheWolfz
Full Member
***
Offline Offline

Activity: 227


View Profile
January 31, 2016, 11:13:08 AM
 #290

Code:
[2016-01-31 00:05:26] accepted: 15/15 (100.00%), 2316 kH/s yes!
[2016-01-31 00:05:34] CPU #47: 49.16 kH/s
^C[2016-01-31 00:05:42] SIGINT received, exiting
thewolf@thewolf-H8QG6:~/Downloads/cpuminer-opt-3.0.7$ ./cpuminer -a x11 -o stratum+tcp://x11.usa.nicehash.com:3336 -u 18tvS3deKZK5q4eTtPRWYeEMWmGmuErHgz.H8QG6 -p d=0.01 -t 48

 Grin Grin Grin 48 cores of goodness. Having problems getting the 4th CPU to work :-(

2.3 MH on a CPU, nice! How much do they cost?


The guy wanted 49.99 each, but was open to offers I got them for 42$ each 168 /w free shipped.
My 1st offer was 40 he came back with 45 I counter offer42 and he took the offer.

thewolf@thewolf-H8QG6:~$ sudo clockspeed
[sudo] password for thewolf:
Clockspeed (OCNG5.3)
Family 15h
Turbo is supported. 2 boost state(s).
Running, please wait...
Refclock: 248.003 MHz
Clockspeed: 3224.039 MHz
thewolf@thewolf-H8QG6:~$
 That score was with the OC.
[2016-01-31 05:13:58] accepted: 30/30 (100.00%), 2362 kH/s yes!
[2016-01-31 05:14:09] CPU #18: 49.09 kH/s
[2016-01-31 05:14:10] accepted: 31/31 (100.00%), 2362 kH/s yes!
[2016-01-31 05:14:13] CPU #35: 49.25 kH/s
[2016-01-31 05:14:13] accepted: 32/32 (100.00%), 2362 kH/s yes!
[2016-01-31 05:14:13] CPU #44: 49.21 kH/s
[2016-01-31 05:14:14] accepted: 33/33 (100.00%), 2362 kH/s yes!
[2016-01-31 05:14:19] CPU #45: 49.21 kH/s
[2016-01-31 05:14:19] accepted: 34/34 (100.00%), 2362 kH/s yes!
Grin  Tongue
They hit up close to 3.8Ghz on less cores under load with the turbo boost.
zTheWolfz
Full Member
***
Offline Offline

Activity: 227


View Profile
January 31, 2016, 11:39:49 AM
 #291

Code:
[2016-01-31 00:05:26] accepted: 15/15 (100.00%), 2316 kH/s yes!
[2016-01-31 00:05:34] CPU #47: 49.16 kH/s
^C[2016-01-31 00:05:42] SIGINT received, exiting
thewolf@thewolf-H8QG6:~/Downloads/cpuminer-opt-3.0.7$ ./cpuminer -a x11 -o stratum+tcp://x11.usa.nicehash.com:3336 -u 18tvS3deKZK5q4eTtPRWYeEMWmGmuErHgz.H8QG6 -p d=0.01 -t 48

 Grin Grin Grin 48 cores of goodness. Having problems getting the 4th CPU to work :-(

2.3 MH on a CPU, nice! How much do they cost?

usually this is a bios tweak / setting that disables the cpus ...

opterons mainly - but that was a while back when i used to build these big servers ...

joblo - if you ever want to have a foray into the cuda world - talk to me first please mate Wink ...

#crysx
I wish it was something as simple as a bios tweak. I been around bios and motherboards for many years.
Use to do tech support for Abit motherboards back in the day when they were top dog at overclocking boards.
First motherboard to have jumperless OC, SoftMenu it was called. Then UGuru. lol I was a Moderator at
there forum for many years up until they closed the doors. May have to send this board in for a replacement
Its acted up before this same way, something is going out "or has gone out" for CPU socket 4 on the board
I'm pretty sure.  Undecided I'll work with it a little more over the next few days. Hope it still under warranty.  I gave over
$850 just for the M/B alone.
chrysophylax
Legendary
*
Offline Offline

Activity: 1022


--- ChainWorks Industries ---


View Profile WWW
January 31, 2016, 01:05:51 PM
 #292

Code:
[2016-01-31 00:05:26] accepted: 15/15 (100.00%), 2316 kH/s yes!
[2016-01-31 00:05:34] CPU #47: 49.16 kH/s
^C[2016-01-31 00:05:42] SIGINT received, exiting
thewolf@thewolf-H8QG6:~/Downloads/cpuminer-opt-3.0.7$ ./cpuminer -a x11 -o stratum+tcp://x11.usa.nicehash.com:3336 -u 18tvS3deKZK5q4eTtPRWYeEMWmGmuErHgz.H8QG6 -p d=0.01 -t 48

 Grin Grin Grin 48 cores of goodness. Having problems getting the 4th CPU to work :-(

2.3 MH on a CPU, nice! How much do they cost?

usually this is a bios tweak / setting that disables the cpus ...

opterons mainly - but that was a while back when i used to build these big servers ...

joblo - if you ever want to have a foray into the cuda world - talk to me first please mate Wink ...

#crysx
I wish it was something as simple as a bios tweak. I been around bios and motherboards for many years.
Use to do tech support for Abit motherboards back in the day when they were top dog at overclocking boards.
First motherboard to have jumperless OC, SoftMenu it was called. Then UGuru. lol I was a Moderator at
there forum for many years up until they closed the doors. May have to send this board in for a replacement
Its acted up before this same way, something is going out "or has gone out" for CPU socket 4 on the board
I'm pretty sure.  Undecided I'll work with it a little more over the next few days. Hope it still under warranty.  I gave over
$850 just for the M/B alone.

yup - understood ...

my server boards were around the $950aud at the time ( supermicro - amazing boards ) - and they are STILL running to this day ... believe me that was along time ago - about 7 years now - and they 'just work' ... unfortunately for me - at the time xeon systems were the mainstream ... i really wanted an oct opteron system - but the pricetag meant i had to sell the car to buy it ... and i like my fast cars - so the motherboard lost out ...

but i cant complain - these servers are rugged and i have built them with the best i could find at the time ... money ( and a lot of it ) well spend then ...

maybe it is the socket itself - sometime a regulator or cap gone bad ... it happens ...

i hope you can get it running though - it sounds like you have one hell of a system there ...

#crysx

grn - Gfz2cXMkhMZYWSFvLEMnM8bXk7X5Mtq2J2 . exchange - https://www.cryptopia.co.nz/Exchange/?market=GRN_BTC . cwi thread - https://bitcointalk.org/index.php?topic=1563601 . email - crysx@gnxs.com .
chrysophylax
Legendary
*
Offline Offline

Activity: 1022


--- ChainWorks Industries ---


View Profile WWW
January 31, 2016, 01:09:25 PM
 #293

Code:
[2016-01-31 00:05:26] accepted: 15/15 (100.00%), 2316 kH/s yes!
[2016-01-31 00:05:34] CPU #47: 49.16 kH/s
^C[2016-01-31 00:05:42] SIGINT received, exiting
thewolf@thewolf-H8QG6:~/Downloads/cpuminer-opt-3.0.7$ ./cpuminer -a x11 -o stratum+tcp://x11.usa.nicehash.com:3336 -u 18tvS3deKZK5q4eTtPRWYeEMWmGmuErHgz.H8QG6 -p d=0.01 -t 48

 Grin Grin Grin 48 cores of goodness. Having problems getting the 4th CPU to work :-(

2.3 MH on a CPU, nice! How much do they cost?

usually this is a bios tweak / setting that disables the cpus ...

opterons mainly - but that was a while back when i used to build these big servers ...

joblo - if you ever want to have a foray into the cuda world - talk to me first please mate Wink ...

#crysx

It's only a matter of time. Thi srearchitecting of the front end is going to pay off well because
it's identical to ccminer. I;m also learning a lot about the algo chains and how hashing is done.
The only thingI'll have left to struggle with is the cuda architecture because it's so foreign to
anything I'm familiar with and good docs are hard to find. But I'm hoping I can be useful.

well - if there is an option there - come and have a chat ...

i dont think it will take long for you to get a grasp of things - it will take a while to really get fluent with it all - and to get to the 'other' devs levels ( yes djm34 wolf0 sp pallas and many many more ) its a matter of experience and time ...

i kick myself everytime i think of how i was the top 3% of university and i dropped out - just before my degree was getting into c++ heavily ... id already got pascal and cobol almost down pat - c++ was next ...

now there is bringing back a HUGE amount of memories ... yup - i know why i dropped out - stupid young fella who knew everything - i was ... Wink ...

#crysx

It took me 11 years to complete mine but I went off track in year 1, had a good paying PT job and cut classes for
more hours. The job was a dead end and and eventually I got motivated to go back to school, just to get out of
that job. I don't now how old you are but it's never too late. Cobol eh? There may still be demand for Cobol
support.



yup - cobol ... and pascal - one of my favourite procedural languages at the time ...

id never go back to cobol - and the money to get me back would be too much to spend ... what a nightmare that language is ...

c++ on the other hand ... that was something i have always wanted to get back into ...

and yes - im old ... 46 about to hit the 47 in a few months ...

fun fun Tongue ... and nite nite Smiley ...

#crysx

grn - Gfz2cXMkhMZYWSFvLEMnM8bXk7X5Mtq2J2 . exchange - https://www.cryptopia.co.nz/Exchange/?market=GRN_BTC . cwi thread - https://bitcointalk.org/index.php?topic=1563601 . email - crysx@gnxs.com .
pallas
Legendary
*
Offline Offline

Activity: 1526


Black Belt Developer


View Profile
January 31, 2016, 01:29:11 PM
 #294

Do you guys remember the first tomshardware (it was sysdoc.pair.com back then) article on the Asus p55t2p4 motherboard?
I had that card and it was so fun! By specs the fastest cpu it could run was a pentium 233 but with some hardware mods you could easily run a k6 at 450 :-D

joblo
Legendary
*
Offline Offline

Activity: 1008


View Profile
January 31, 2016, 06:04:44 PM
 #295

Here's a sample of algo_gate code as a teaser. The funny syntax is just how c defines
function pointers.  This technique used used a lot in file systems and device
drivers due to it's flexibility and extensibility.

It's kinda OOish but without the pretensions.

I'm just tidying up the syntax errors and should have a compile later today

Code:
// declare some function pointers
// mandatory functions require a custom target function specific to each algo.
// Otherwise the null instance will return a fail code.
// Optional functions may not be required for certain algos or the null
// instance provides a safe default. If the default null instance is suitable for
// a particular algo it is not necessary to define a custom target function.

typedef struct
{
//mandatory
int    *( *scanhash ) ( int, uint32_t*, const uint32_t*, uint32_t, uint64_t* );
void   *( *hash )( void*, const void*, uint32_t ) ;
//optional
void   *( *init_ctx ) ();
uint32_t *( *get_max64 ) ();
void     *( *get_opt) ();
bool     *( *full_test) ();
void     *( *set_target) ( struct work*, uint32_t, uint32_t );
void     *( *gen_merkle_root) ( char* merkle_root, struct stratum_ctx* );
bool     *( *get_scratchbuf ) ( char* );
int      *( *check_algo_alias) ( enum algos );
void     *( *ignore_pok) ( int, int );
void     *( *display_hashrate)( int, uint64_t );
void     *( *display_benchmark_hashrate)( int, uint64_t* );
void     *( *wait_for_diff) ( struct stratum_ctx* );
} algo_gate_t;

Each algo then implements the target functions it needs and a function to register
them with algo_gate:

Code:
bool register_x11_algo( algo_gate_t* gate )
{
  gate->init_ctx = &init_x11_aes_ctx;
  gate->scanhash = &scanhash_x11_aes;
  gate->hash     = &x11_hash_aes;
  return true;
};

Each miner thread then calls the registration function for the algo to be mined

Code:
   if ( false == register_algo_gate( opt_algo, algo_gate[thr_id] ) )
   {
     applog(LOG_ERR,"Thread %d algo_gate registration failed.\n", thr_id);
     if ( NULL != algo_gate )
     {
        free( algo_gate );
     }
     exit(1);
   }

And the functions are called:

Code:
    if ( algo_gate->scanhash != null_scanhash )
    {
       rc = algo_gate->scanhash( thr_id, work.data, work.target, max_nonce,
                                                          &hashes_done );
    }
    else
    {
       applog(LOG_ERR,"%s has no scanhash function registered.\n",
                                              algo_names[opt_algo]);
    }


And that's all there is to it. There ar no references to any specific algos in the miner thread, it is completely
absract.

Principal developer of cpuminer-opt, the optimized multi-algo CPU miner.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
https://bitcointalk.org/index.php?topic=1326803.0
joblo
Legendary
*
Offline Offline

Activity: 1008


View Profile
January 31, 2016, 10:26:29 PM
 #296

Well the algo gate engine is built and it starts but I seem to be caught in a vicious loop.

I need the proper algo name in order to register the gate, but I need the gate registered
before I can check for algo aliases. It looks like I need to poke a hole in the gate.

But that also exposes a fatal logical flaw. I have the algo entered by the user which may or may not
be an alias. I can't map directly from an alias to a proper name, I have to poll each algo if they
accept the given name as an alias for them. A little redesign is in order.

There were some other issues such as the need to register the gate before the miner threeads are
started. I just let main use thread 0's gate.

But I'm also having problems with malloc, probably the size. I've declared a global struct pointer
as the root of the gate data, but how do I alloc the mem so this pointer points to a buffer of size
threads*struct size? sizeof only accepts variables, but theonly variableI have is a pointer.
I tried an arbitrary constant but that didn't work either. Do I need a double pointer because it's
an array of structs?

Principal developer of cpuminer-opt, the optimized multi-algo CPU miner.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
https://bitcointalk.org/index.php?topic=1326803.0
pallas
Legendary
*
Offline Offline

Activity: 1526


Black Belt Developer


View Profile
January 31, 2016, 11:05:01 PM
 #297

Sizeof accepts data type names including structs, so sizeof (struct_name) * threads should work.

joblo
Legendary
*
Offline Offline

Activity: 1008


View Profile
February 01, 2016, 01:32:29 AM
 #298

Sizeof accepts data type names including structs, so sizeof (struct_name) * threads should work.

Hmm, I though I tried using a type name before and it didn't work, I must have been mistaken.
As I also mentioned it didn't work with a constant size either so there's more to it.

I got it running with a fixed sized array for now amd it gets all the way to diplaying the hashrates
before it segfaults. Had a lot of initialization issues to work out. printf is the best debugging tool
available (except for the ones I wrote).

Haven't got stuck any one issue for very long so progressing well. Seen some interesting crashes.
I crashed on a function return, obviously corrupted the stack with and extra & on a var.
Forgetting a ; at the end of an included file produces interesting errors.

ll revisit the malloc isue later, thanks.

Principal developer of cpuminer-opt, the optimized multi-algo CPU miner.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
https://bitcointalk.org/index.php?topic=1326803.0
joblo
Legendary
*
Offline Offline

Activity: 1008


View Profile
February 01, 2016, 05:43:11 AM
 #299

I have a solution for the algo alias issue, but not a perfect one. It requires a little more work to install
a new algo. If the algo has an alias it requires addding an entry to the alias array. So it's now a two
step process: add a case to reguister the algo and add an entry to the alias array if appropriate.

The redesigned engine runs, connects to the pool, hashes and reports hashrates ok and submits shares,
but, all rejects. I probably messed something up in cpu-miner, I've already fixed a few of them.
I'll have to walk through the code side by side and look for any divergences.

Principal developer of cpuminer-opt, the optimized multi-algo CPU miner.
BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT
https://bitcointalk.org/index.php?topic=1326803.0
MaxDZ8
Hero Member
*****
Offline Offline

Activity: 673



View Profile
February 01, 2016, 11:53:02 AM
 #300

If I'm not mistaken that sounds a lot like sgminer
No idea how did you get to that conclusion. Indeed the verificators needs to be compiled for the time being (like sgminer) except that every verificator can be re-assembled on need at runtime.
For CPU mining no, that's not really going to work efficiently, as the hashing itself is simple most of the time and the cost involved in CALL will be overwhelming. Yet you could design a proper DLL interface considering your needs (no, it is not easy).

Dll based? (shudder) that's Windows? Or do you mean shared libraries? My concern about shared libraries
it could cap performnance to the lowest common denoniminator.
No idea why you guys are so tied to stickers. DLLs and SOs are pretty much the same thing for most practical purposes. Dynamic linking based on runtime capabilities has been around by decades and it can be efficient - the old school example is linking games to Glide/D3D/GL by runtime or even GL extensions on GPU capabilities. You can do the same, detect feature set X, fetch library_X.so, feature set Y fetch library_Y.so. If the interface is purely functional it will be relatively easy especially in plain C and will - in theory - allow a single executable to support every future algorithm.

That is, if you want to go in that direction.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 ... 165 »
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!