Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nonce Selection Question ? #219

Open
santaniitr opened this issue Mar 3, 2018 · 2 comments
Open

Nonce Selection Question ? #219

santaniitr opened this issue Mar 3, 2018 · 2 comments

Comments

@santaniitr
Copy link

I am trying to test in neoscrypt by selectively taking the nonce from a function, instead of sequentially for full range of 0 to 4G. Currently i have not yet figured out a clean way, as it seems to link at many places (start_nonce, end_nonce, max_nonce) using UINT32_MAX.

Can you help me what should be modified... lets take a very simple case... If we need to search only the nonce field from 0xffff to 0xffffff only..... during each job received from pool. Then where should be the change and recompile.

@santaniitr santaniitr changed the title Nonce Selection Nonce Selection Question ? Mar 3, 2018
@KlausT
Copy link
Owner

KlausT commented Mar 3, 2018

Why would you want to search a limited range?

First you have to split up the nonce range if you have multiple gpus.
The lowest nonce for each card is calculated here:

nonceptr[0] = (UINT32_MAX / opt_n_threads) * thr_id; // 0 if single thr

You could probably do it like this:
nonceptr[0] = lowlimit + ((highlimit - lowlimit + 1) / opt_n_threads) * thr_id;

The highest nonce for each card is calculated here:

uint32_t end_nonce = UINT32_MAX / opt_n_threads * (thr_id + 1) - (thr_id + 1);

You could change it like this:
uint32_t end_nonce = lowlimit - 1 + (highlimit - lowlimit + 1) / opt_n_threads * (thr_id + 1);

Then change this line

if(nonceptr[0] >= end_nonce - 0x00010000 || extrajob)

to if(nonceptr[0] >= end_nonce || extrajob)
And change this line
if((time(NULL) - g_work_time) >= scan_time || nonceptr[0] >= (end_nonce - 0x10000))

to if((time(NULL) - g_work_time) >= scan_time || nonceptr[0] >= end_nonce))

(By the way, I just realized that the calculation in my code is probably sligthly wrong)

@santaniitr
Copy link
Author

Thank you very much KlausT for such a wonderful reply.
I will continue my testing now and let you know once we get the extra benefit. Nonce range search is always limited in these algo where Hhshrate is of the order of few MH/s per card. We never complete the full range in them.
Ultimately we want to find more shares even if the hashrate is similar. Let me see. Thanks.

okoto-xyz referenced this issue in okoto-xyz/cpuminer-yescrypt Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants