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

Improve Blake 3 performance using compiler flags #1

Open
FreeTrade opened this issue May 29, 2022 · 7 comments
Open

Improve Blake 3 performance using compiler flags #1

FreeTrade opened this issue May 29, 2022 · 7 comments

Comments

@FreeTrade
Copy link

All compiler flags are switched off for lowest common denominator compile. Should be possible to improve mining and validation performance by improving make files to switch on compiler flags where appropriate.

@FreeTrade
Copy link
Author

have a look in config.ac - this is the line that switches the flags off -

CFLAGS="$CFLAGS -DBLAKE3_NO_SSE2 -DBLAKE3_NO_SSE41 -DBLAKE3_NO_AVX2 -DBLAKE3_NO_AVX512"

@bitRiderproject
Copy link

Ok removed it and start to compile as for now its ok

@bitRiderproject
Copy link

fails all time I think it is related to files inside blake3 folder

@FreeTrade
Copy link
Author

Yes, I was only able to get it to compile by putting this kludge in the make file. I'm sure a make file wizard could have this compiling to a single binary with all the optimizations that only kick-in when the required CPU features are available. It's beyond my skills though.

@FreeTrade
Copy link
Author

hmmm, i was able to get it to compile by using the

CFLAGS="-march=skylake-avx512"

with CONFIG_SITE=

However the miner crashes running it on different hardware, so i guess this will compile with the optimizations, but will crash on a computer that doesn't have the CPU instructions.

Miners may be able to gain optimizations by compiling it on the machine they are running it with and compiling with CFLAGS="-march=native"

more details on compiling here - looks like each of the files needs to be compiled with different processor switches.
https://github.com/BLAKE3-team/BLAKE3/blob/master/c/README.md#x86

@FreeTrade
Copy link
Author

Could handle this by either setting make file to compile each blake3 file with the correct compiler option
OR
compiling the blake3 into a shared library (easy to do), then having the miner use that shared library (couldn't get that to work)

@FreeTrade
Copy link
Author

left sse and avx2 flags on. possible additional gains if avx512 switch properly added.

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

2 participants