-
Notifications
You must be signed in to change notification settings - Fork 206
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
Check/add support for Apple M1 processor #428
Comments
I'd hope we can just use an updated cpu_features version if this seems necessary. Besides publicly available docs regarding that chip would be helpful as well. |
If I change the cpu_features to recognize that the M1 chip is actually ARM with CPU_FEATURES_ARCH_ARM defined, volk compiles and runs without issue. I'm not sure if this the appropriate solution or if there is more to do. While clang 12 has aarch64 define, it does not appear to define arm so the cpu_feature submodule fails to build. |
So VOLK builds and uses NEON on M1? That's good. And we might face 2 issues in the future:
|
With regards to 2 first, clang12 has In the email from @dkozel I'm not sure if it is using neon or not yet. I have attached the make test results here as I only downloaded / built it for the first time anywhere yesterday.
|
You have multiple options to check: About the |
I don't think it does support SVE. Looking at the
I don't think that even thought cpu_features is compiling it is detecting anything properly.
Looks like there's an open issue about adding support for M1 to cpu_feature already, so that much is good. |
Getting closer to having something functional:
|
@sbehnke thanks for working on it! |
Submitted google/cpu_features#150 Now we wait for Google to tell me what I've done wrong. |
Very cool! I have an ARM Mac I can do testing on ... not M1 but still ARM. I left a comment on you PR ... LGMT either way, but I think that change would help. Thx for your work! |
Hi there! Just found this thread after my intel based MacBook died this week, and I chose (which has now become a painful process in reinstalling GNU radio) to get the M1 chip based MacBook. I currently can't successfully install VOLK in the Rosetta emulator or with the ARM cmake toolchain files. Are there any updates on this? I can also help with testing if needed. |
We're waiting for the PR against cpu_features to get merged. Afterwards, we can probably add M1 support pretty quickly. It looks like M1 is ARM based but there are some subtle differences. |
This (among other near impossible installations) prompted me to actually return the computer for an Intel chip. All will be much easier now! Thank you for your help and great development. |
@sbehnke Did you successfully get GNU Radio running on an M1 mac? |
No, I haven't. I got pulled in a different direction and haven't had a chance to circle back yet. |
Thanks for the fast response! I think no one has succeeded then. |
I made a pull request for the upstream Volk, but it didn't get approved and pulled in, which I don't blame them for. I don't think we quite capture all of the capabilities of the processor and without that building in the tree I'm not sure what to do. |
Thanks for doing this PR! I still hope it'll get merged at some point. At this point 2 out of 3 PRs against cpu_features are directly relevant to us. |
Any news ? It seems that macports can compile gnuradio and volk for m1 https://ports.macports.org/port/volk/details/ https://ports.macports.org/port/volk/builds/?page=1. I am using homebrew but still no news for homebrew. |
@fllay Yes I pushed fixes for Volk's cpu_features into MacPorts. No movement upstream there; no idea what the timeframe is. I don't mix and match package managers, and I do MacPorts -- so I have no idea what homebrew is doing. |
Having Volk patch cpu_features is a possible, I suppose ... that would help homebrew and other package managers and building from source on M1. Worth considering. |
Thank you for information, I guess I will move to macports. Actually, when I used intel Mac, I was using macports for package management and gnuradio. |
On the plus side: It is a very simple patch to cpu_features to compile and use VOLK on M1. We could patch cpu_features ourselves. However, that'll give quite a few package maintainers quite a headache. We'd rely on a custom cpu_features version that is not available through package managers. I'd say that is not a solution we should do here but leave to the package maintainers to decide for themselves. I just hope that there will be progress soon on the cpu_features side. |
@jdemel discussion from GRCon21 summary: (1) don't use |
The related discussion was to minimally patch |
I fear that I'd really like to find a maintained project that supports CPU feature detection. We might extract the relevant parts from In any case, we might run into issues e.g. in VMs. If there'd be an option to run e.g. AVX512 commands and catch |
I just started looking at this project: https://github.com/simd-everywhere/simde.git ... it's pretty cool! |
Maybe as a compromise at least right now, we tweak the CMake scripts to check for Apple M1 & if that succeeds then we don't do |
Thinking of SIMDe for the CPU detection more-so than their actual code ... though that's pretty cool too! |
It seems that Volk without M1 support is making a headache to lot of us! Cant finishing installing SatDump here since Vosk is a must |
If you compile from source, you can fix it by patching |
It seems like the relevant patch got merged |
We have 3 issues that should be fixed with this commit. Fix gnuradio#428 Should be fixed because cpu_features detects `arm64` now. Thus, it builds on MacOS and reports M1 capabilities. Fix gnuradio#478 Fix gnuradio#484 cpu_features received quite a bit of contributions for FreeBSD. All the issues we had should be fixed now. However, this might require further evaluation. Signed-off-by: Johannes Demel <[email protected]>
We have 3 issues that should be fixed with this commit. Fix gnuradio#428 Should be fixed because cpu_features detects `arm64` now. Thus, it builds on MacOS and reports M1 capabilities. Fix gnuradio#478 Fix gnuradio#484 cpu_features received quite a bit of contributions for FreeBSD. All the issues we had should be fixed now. However, this might require further evaluation. Signed-off-by: Johannes Demel <[email protected]>
With Apple's switch to ARM there may be some adjustments needed to detect and use the available NEON instructions.
@sbehnke is interested in working on/testing this feature.
The text was updated successfully, but these errors were encountered: