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

Grin binary release fails on CPU without avx2 support #2494

Closed
hashmap opened this issue Jan 30, 2019 · 7 comments
Closed

Grin binary release fails on CPU without avx2 support #2494

hashmap opened this issue Jan 30, 2019 · 7 comments
Labels

Comments

@hashmap
Copy link
Contributor

hashmap commented Jan 30, 2019

Grin binary release fails silently, when an user runs it one more time it complains about corrupted storage. The real reason is unsupported CPU instruction (SIGILL), most likely avx/avx2 one.

More info #2334
I create this issue to focus on release process improvement, it seems valuable to have a build with AVX2 support which brings a nice speedup. At the same time it may be confusing for some users if we have 2 packages for each OS.

Here is what we build:

$ elfx86exts grin
MODE64 (call)
CMOV (cmova)
SSE1 (movups)
SSE2 (movq)
SSSE3 (pshufb)
AVX (vxorps)
AVX2 (vpcmpeqd)
BMI2 (mulx)
ADX (adcx)
BMI (andn)
CPU Generation: Unknown
@devmechanic
Copy link

I believe AVX is present on core i3 or better (celerons and pentiums don't have it).

@ignopeverell
Copy link
Contributor

I'm thinking we're seeing this:

rust-lang/rust#50154

From what I gather, LLVM seems to have some polyfill for architectures that don't support AVX, but their use has seen a regression. It looks like it's been recently fixed in the LLVM repository:

https://bugs.llvm.org/show_bug.cgi?id=37358

The fix is included in LLVM 7.0.1. I'm not 100% sure but perusing the Rust release notes it doesn't seem the fix has been included yet.

@hashmap hashmap added the bug label Feb 8, 2019
@hashmap hashmap changed the title Grin binary release with and (or) without avx2 support Grin binary release fails on CPU without avx2 support Feb 8, 2019
@DinoStray
Copy link

I use docker run grin.
One machine run successfully, another run with the error same as #2334.
The one with no error:
image
The one with error:
image
It seems like that both of them support avx and avx2

@nikito7
Copy link

nikito7 commented Feb 28, 2019

Some search in google

"Disable AVX in Rust (required for EC2)
rust-ec2.patch"

https://gist.github.com/jedisct1/8984243

https://amp.reddit.com/r/rust/comments/6ynm53/a_simple_tip_to_improve_rust_program_speed/

@nikito7
Copy link

nikito7 commented Feb 28, 2019

Fixed?

rust-lang/rust#50154 (comment)

@josef-v
Copy link

josef-v commented Aug 15, 2019

We have found out that this might be a problem in croaring crate, which is built natively.
See:
grep -r native target/release/build/croaring-sys-57163d129afeb5e6/

target/release/build/croaring-sys-57163d129afeb5e6/output:running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-Wall" "-Wextra" "-std=c11" "-march=native" "-O3" "-o" "/home/jv/github-repos/grin/target/release/build/croaring-sys-57163d129afeb5e6/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"

@jaspervdm
Copy link
Contributor

This should be fixed in v3.1.1 and onwards. If it re-appears, please open a new issue for it and we will investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants