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 support wanted / relevant? #13

Open
sesam opened this issue Oct 1, 2018 · 20 comments
Open

GPU support wanted / relevant? #13

sesam opened this issue Oct 1, 2018 · 20 comments

Comments

@sesam
Copy link

sesam commented Oct 1, 2018

I see no mention of GPU support, if it's relevant, PRs wanted, etc.

Here's another ed25519 vanity generator that might be interesting to compare with: https://docs.rs/crate/nano-vanity/0.2.1

@cathugger
Copy link
Owner

cathugger commented Oct 1, 2018

There was #4 but basically I don't really have hardware to test with and much experience with programming GPUs :\
And I'm not really sure how it'd integrate with stuff like filters, and is this project right scope for that.
Thanks for mentioning https://github.com/PlasmaPower/nano-vanity looks like it's doing pretty much same kind of thing.
Should we filter inside GPU? Or send all generated keys to CPU for that? Or mixed approach with subset of wider filters in GPU and full filtering in CPU side?
How should it relate to main mkp224o application? Be part of it, or separate executable? (probably separate, different kind of dependencies)
mkp224o is CC0 (with some parts put into Public Domain), but since https://github.com/PlasmaPower/nano-vanity is BSD, and I don't think it's worth redoing it, that part of codebase would be BSD licensed.
Should it be in this project scope, or separate repository should be made? Not sure..

Lot of uncertainty from my side... I'll need to think about it, but I myself currently not doing any code for this, so incase anyone wants to work on it, they shouldn't hesitate.

@Cyclic3
Copy link

Cyclic3 commented Oct 30, 2018

Have you tried pocl? That works with just a CPU, so you should be able to test with it.

@Baaleos
Copy link

Baaleos commented Feb 25, 2019

In regards to the question of when to do the filtering - Scallion - a .net GPU generator for onion addresses I think just generates a work load, processes the GPG keys and then filters on the cpu.
The important thing is to keep the GPU hard at work, if it runs out of work it then throttles down.

@cathugger
Copy link
Owner

I'm too busy with other irl stuff, and have too little interest in doing this myself (lack of actual powerful GPU isn't motivating, because I personally won't benefit from it, and even testing might get unnecessarily tedious (unless I try with pocl but that's one more thing to learn to play with..)).
Will leave open, as there is some good knowledge in this issue in case someone might be interested doing this.

@exander77
Copy link

Is here a documentation how are the new adresses generated?

@cathugger
Copy link
Owner

currently no but reading code shouldn't be hard.
essentially we generate ed25519 pubkeys as quick as possible filtering them as quickly as possible and once we get match we reseed private key, and format pubkey x privkey pair in format tor accepts and dump that to filesystem. or output in yaml-ish format.
there are few ways to calculate public keys as quick as possible.
there are also few ways to filter and it depends on amount of filters and their properties which way to do it works best. which is why it's configurable at compile time.

@cathugger
Copy link
Owner

cathugger commented Jun 15, 2019

@WhaleHub It'd increase likehood. But then I don't even have proper motherboard for that (my only serious working machine right now is laptop). Might get some better hardware this summer, maybe.
Why is nobody who isn't me doing it, tho, I mean there definitely must be people capable and having all the right hardware, and it shouldn't even be too hard. There's even https://github.com/PlasmaPower/nano-vanity/blob/master/src/opencl/curve25519.cl, also there are useful tips in https://eprint.iacr.org/2014/198.pdf.

@Scripter17
Copy link

I don't mean to be rude, but has anyone made any progress on this front? I can't find any other software that does what the issue proposes.
It's been a bit over a year and a half since this issue started, and just a few days over a year since the last comment. I highly doubt that no one has done anything with this in that time.

@cathugger
Copy link
Owner

cathugger commented Jul 4, 2020

as I've indicated earlier I'm not working on it atm.
it kinda looks a bit odd to me too that no one's doing it.

@dr-bonez
Copy link

I have built one that works with cuda in Rust.
https://github.com/dr-bonez/tor-v3-vanity

@GIJack
Copy link

GIJack commented Jan 18, 2021

I could definitely use some OpenCL support. Especially multi-device...

I have two GPUs and would make my life easier...

@harryqt
Copy link

harryqt commented Mar 5, 2022

@dr-bonez which is would be better? AMD 5900x CPU or RTX 3080 GPU?

@dr-bonez
Copy link

dr-bonez commented Mar 5, 2022

There's definitely something wrong with my generator that is slowing it down, that I haven't had time to debug. For now, I'd recommend continuing to use the cpu version.

@harryqt
Copy link

harryqt commented Mar 5, 2022

Alright. Thank you. 🙏

@adapt-L
Copy link

adapt-L commented Jan 29, 2023

I think I still have some code saved from last year when I attempted this with OpenCL. It was very inefficient, orders of magnitude slower than mkp244o (perhaps because it was a copy of supercop or donna that used branching)? This was just a test on intel graphics though, I have not been able to get OpenCL working on amd or nvidia.

I can share if anyone is interested. Maybe someone with OpenCL experience could fix it up...

@cathugger
Copy link
Owner

please do share. i kinda do have capable setup now, just not much time. even if not for me, may be useful for someone else.

@exander77
Copy link

I think I still have some code saved from last year when I attempted this with OpenCL. It was very inefficient, orders of magnitude slower than mkp244o (perhaps because it was a copy of supercop or donna that used branching)? This was just a test on intel graphics though, I have not been able to get OpenCL working on amd or nvidia.

I can share if anyone is interested. Maybe someone with OpenCL experience could fix it up...

Yes, if you share it, We can definitely optimize. I hate interfacing with OpenCL, but I can look into optimizing already existing code.

@adapt-L
Copy link

adapt-L commented Jan 30, 2023

@exander77 Here is a link: https://github.com/adapt-L/GenEd
It's just a prototype that generates the keypair and filters it. My CPU (i5-1240P) gives me 0.28676 million keypairs/sec and my integrated GPU gives me 0.0614793 million keypairs/sec

@Zipdox2
Copy link

Zipdox2 commented Nov 5, 2024

I wrote this but I'm having trouble getting it to run on my GPU because Mesa OpenCL support is poor. https://gitlab.com/zipdox/onion-v3-vanity-opencl

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

No branches or pull requests

12 participants