Author

Topic: [ANN]: cpuminer-opt v3.8.8.1, open source optimized multi-algo CPU miner - page 184. (Read 444067 times)

legendary
Activity: 1470
Merit: 1114
Sizeof accepts data type names including structs, so sizeof (struct_name) * threads should work.

much ado about nothing. simpler to have each miner thread define a local copy, all refs are
within scope so should be no problem.
hero member
Activity: 672
Merit: 500
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.
legendary
Activity: 1470
Merit: 1114
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.
legendary
Activity: 1470
Merit: 1114
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.
legendary
Activity: 2716
Merit: 1094
Black Belt Developer
Sizeof accepts data type names including structs, so sizeof (struct_name) * threads should work.
legendary
Activity: 1470
Merit: 1114
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?
legendary
Activity: 1470
Merit: 1114
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.
legendary
Activity: 2716
Merit: 1094
Black Belt Developer
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
legendary
Activity: 2912
Merit: 1091
--- ChainWorks Industries ---
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
legendary
Activity: 2912
Merit: 1091
--- ChainWorks Industries ---
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
full member
Activity: 231
Merit: 150
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.
full member
Activity: 231
Merit: 150
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.
legendary
Activity: 1470
Merit: 1114
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.
legendary
Activity: 2716
Merit: 1094
Black Belt Developer
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.
legendary
Activity: 1470
Merit: 1114
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.

legendary
Activity: 1470
Merit: 1114
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.
legendary
Activity: 2912
Merit: 1091
--- ChainWorks Industries ---
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
hero member
Activity: 672
Merit: 500
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.
legendary
Activity: 1470
Merit: 1114
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.
legendary
Activity: 2912
Merit: 1091
--- ChainWorks Industries ---
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
Jump to: