-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Binary release error in 2.6.32-573.7.1.el6.x86_64 GNU/Linux #135
Comments
Can you show the output of I build binaries with I can certainly put on binaries without SIMD support if that would help. (I was seeing if I could get away with not doing it, since it will be confusing to users. "Which one should I download?") |
|
Yeah, looks like your CPU doesn't support |
So... I want to fix this issue but I'm not sure what the best way is. I understand the technical issues at play, but I'm concerned more about the user experience here. Let me describe what I think is the problem. Today, if I'm on Linux and I want to download a Linux binary for ripgrep, I click on the "releases" link and there is exactly one choice that makes sense: In the future, if we add different downloads for various flavors of SIMD support, then will be multiple choices and none of them will be obvious. For example, you might have to choose between How can I fix this? I could add some notes about this in the release page, but I feel like that will be ineffective. |
It is not unheard of to have a program do run time detection of the supported instruction set and pick the correct functions as needed. Openssl with AES instruction support is one example. VLC and other video players are another good source of examples. Here they actually fork and test the instruction works since they don't trust the CPU ID bits to be correct. https://mailman.videolan.org/pipermail/vlc-devel/2009-September/066544.html So the general solution may be to create one binary that detects and loads the correct arch specific module. I have no idea how to do that in rust, but I would like to hope it is possible without too many hoops. And hopefully it is just a small subset of the code that really needs the instructions for the performance boost. |
@acmay Ah, thanks for the update! Yup, Rust has a few cpuid crates that we could use to avoid running SSSE3 code if it's not available. The problem is actually a bit more sinister then that though. In particular, if I compile a binary using the equivalent of The only way to solve this problem for real is using target specific function attributes. (Which I just recently added to the Rust compiler.) This allows one to use SSSE3 vendor intrinsics on a function-by-function level without actually passing |
I have an AMD CPU and get |
@wiz Can you show the output of |
Sure,
According to wikipedia SSSE3 instructions are available only on APUs and maybe newer chips. |
@wiz OK, so it's the same issue as others. For others: there's no need to chime in if you got this error and you know your CPU doesn't support SSSE3. It's a known issue. The current work-around requires you to compile from source. |
I know it is the same one. It's just dumping good bunch of AMD (those are mostly affected) users seems wrong. |
I agree. That's why this is an open issue. |
I'm not a user of ripgrep, but I came across this while looking for something else entirely and thought of something that might help you out. Suggestion: package all versions of the binary in a single RPM and use an install-time script to figure out which one to actually use. ex:
This avoids having to manage complex state in a single binary, potentially having the performance gains from using SIMD lost by the capability checks, at the cost of a larger package. |
@gblues Unfortunately, RPMs only work on certain Linux distros, which makes it a non-starter. "Make packages for every Linux distro" is also a non-starter. |
@BurntSushi perhaps keep the default build as the one that includes the latest SIMD, and denote the alternative builds with something like Worst case for users of modern processors who download the wrong version though is that they get a slightly less optimized build, right? Doesn't seem like a much of a big deal. |
This update brings with it a new feature of the regex crate which will now use SIMD optimizations automatically at runtime with no necessary compile time flags. All that's needed is to enable the `unstable` feature. Other crates, such as bytecount and encoding_rs, are still using the old-style SIMD support, so we leave the simd-accel and avx-accel features. However, the binaries we distribute on Github no longer have those features enabled, which makes them truly portable. Fixes #135
In the release notes it says
I have downloaded the https://github.com/BurntSushi/ripgrep/releases/download/0.9.0/ripgrep-0.9.0-x86_64-unknown-linux-musl.tar.gz build but when I run it, it doesn't seem to take advantage of the CPU features available e.g.
The output of
So the CPU an
Maybe I have misunderstood but I expected that 0.9.0 would detect and use SMID and AVX? |
@jamesmudd It should be, yes. The The build instructions in the README indicate that some SIMD features are enabled at compile time (line counting and transcoding, specifically) while others are enabled at runtime (regex matching). The ideal is that they are all enabled at runtime, but we'll have to wait for the maintainers of the respective libraries to catch up and add support for runtime detection. The misleading output of
The only way to enable compile time SIMD/AVX is to build ripgrep yourself. See also: #1013 |
Thanks for the explanation sorry I didn't see the other bug. Ripgrep is a great product keep up the good work! |
When trying to run the ripgrep-0.2.1-x86_64-unknown-linux-musl.tar.gz release the following error happens:
I tried to build it locally but ran into too many issues with cargo and rust (I'm behind the company firewall with a weird proxy and certificate handling)
The text was updated successfully, but these errors were encountered: