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

GPU miners example works now, if slowly. #12

Merged
merged 1 commit into from
Sep 2, 2016

Conversation

fasiha
Copy link
Contributor

@fasiha fasiha commented Sep 1, 2016

Addresses #11. Results:

Mined a block on the CPU, nonce: 695822 (time: 0.011s)
Mined a block on the GPU, nonce: 695822 (time: 0.055s)

Is the GPU so much slower because it only stops after all monkeys have done their thing (unlike the CPU which stops once it mines the block), or because I’m doing something inefficient in GLSL-land? (I am total n00b to GLSL.)

Feedback welcome.

@VictorTaelin
Copy link
Owner

I'm really busy, will be reviewing the cause for the slowdown soon. I've briefly looked the code and looks like you did a great job. Thank you very much.

@VictorTaelin
Copy link
Owner

Oh, that is okay. As I said on the comments, the mod function on GLSL seems not to work for big numbers (mod(bhash * nonce, pow(2.0, 31.0)). So, if we increase the difficulty too much, it gives wrong results. Since the difficulty is set to very small, the CPU does it better as the GPU startup overhead doesn't compensate. If you really needed to mine, you must write safe Uint32 mod (and similar) functions on GLSL, but that is too much effort for just an example. The searchFor987654321 was made to benchmark that kind of program (it just increments nonces instead of hashing).

@VictorTaelin VictorTaelin merged commit a325151 into VictorTaelin:master Sep 2, 2016
@fasiha fasiha deleted the fix-miners branch September 26, 2016 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants