-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Bug] Illegal hardware instruction #607
Comments
Hi @rappercodes, |
Thanks @romi1502. It does seem like an incompatibility issue. If I do come across anything I will share here. |
I confirm that Tensorflow compatibility with Apple M1 chip is not available at the moment, you can find some workaround based on Rosetta 2 here. Do not hesitate to tell us if you manage to make it work with Rosetta, otherwise we will just wait a TF release that is compatible with M1 :) |
For those of you who want to run Spleeter on a Mac with M1 chips, you may find a guide for installing TF here: https://drive.google.com/drive/folders/1oSipZLnoeQB0Awz8U68KYeCPsULy_dQ7?usp=sharing And a guide for building and installing Spleeter here: https://drive.google.com/drive/folders/1ioRr6-xRNizoR7xqWxXUdgjoijFOd2SC?usp=sharing Note that this is a temporary fix, until TF is updated to run on these new chips. Enjoy! |
Any updates? |
? |
Anyone able to build a whl file for an M1 Pro running python 3.9? I can't seem to get it to build with bazel. Keeps erroring out. Super annoying. Not sure why this issue is closed. It should remain OPEN until there is an easier way to get this to run on M1... Edit: The error has to do with numpy (Executing genrule @local_config_python//:numpy_include failed (Exit 1)). Trying some workarounds I saw but so far its been rough trying to get this to build through bazel. |
is it possible to use dockerized images to workaround M1 specific issue? |
FWIW, I found this guide for tensorflow: I'm going to still follow the workaround for spleeter, but if having a native M1 tensorflow install was a blocker, it may no longer be. |
Unfortunately, none of the suggested solutions have been working for me. Would really like this to work in my M1. |
I am attempting to install Spleeter on a MBP with M1 Max. Apple published details of how to install Tensorflow on Apple Silicon Macs with Tensorflow Pluggable Device support for Metal here: https://developer.apple.com/metal/tensorflow-plugin/ That installed Tensorflow 2.7.0
I installed ffmpeg and libsndfile successfully. When installing spleeter, I see an enormous number of error messages. At the end is the following:
|
Hi all, We, at Deezer, managed to use Spleeter on Mac M1 using Tensorflow Metal. Here are the instructions you must follow in order to complete the installation.
We have also created branch for local development using Metal. Please run the following:
You are free to edit and update the dependencies in Finally, please send us your feedback in the comments below. A more substantial release may follow if this fix ends up working for you! |
Worked great! thank you |
@d-dawg78 Thank you for the update. I followed the instructions @argsnd provided in issue #696 which I think installed the developer version of spleeter with the poetry dependency manager. I installed TensorFlow Metal according to the Apple Developer link I provided above. I successfully achieved my goal of installing and running spleeter and it appears to be running for me with python 3.9.7. |
@sslupsky that is awesome to hear! I have been trying to get Spleeter up and running on python 3.9.7 as well and I would love if you could give like a step by step (if I should follow #696 first or installing TensorFlow Metal from the Apple dev link because it seems that both #696 and the link download metal in their steps). I am still struggling on getting it to work together, and Im not sure if everything should be done with Rosetta etc. Thank you so much in advance! I really appreciate it |
@MasayukiNagase I installed TensorFlow Metal first using the Apple Developer instructions. After that I checked the version info for tensorflow-macos and confirmed I had version 2.7.0 installed. I then followed #696 instructions 3, 5, 6 Then edited pyproject.toml and removed dependencies for tensorflow/numpy/scipy/llvmlite/librosa/pandas. As I recall, there doesn't appear to be a dependency for llvmlite in the pyproject.toml file I edited. Then steps 8, 9 and 10. After this, spleeter ran for me. I have to source ~/miniforge3/bin/activate per the Apple Developer instructions to activate the correct python environment if I close the terminal or logout. I took a screen shot of activity monitor and attached here. Screen.Recording.2022-01-26.at.4.33.08.PM.mp4 |
When I try to install python 3.8 I get:
|
For what it's worth, I've got spleeter working perfectly without Rosetta. I had to do a bit of massaging:
Running
Not sure why those three specifically. |
Hi, I've been trying to follow all of the above guides, and none seem to work. I am running macOS Monterey 12.6, on a Macbook Pro 2021 Apple M1 Max. When trying to install the wheel (python -m pip install --upgrade spleeter-2.3.0b0-cp38-cp38-macosx_11_0_x86_64.whl) as mentioned in d_dawgs comment (with the arch -x86_64 prefix), I get error "arch: posix_spawnp: pip: Bad CPU type in executable". Without that command: it just says "ERROR: spleeter-2.3.0b0-cp38-cp38-macosx_10_9_x86_64.whl is not a supported wheel on this platform." I am running this inside a rosetta terminal, and when I type arch, I get "i386". Is there something I'm doing wrong to get the wheel to work? I've also tried installing tensor flow 2.6 and python3.8 separately then using poetry install but I keep getting all different poetry errors. Not really sure what approach at this point I should take to get this to work. Any guidance would be greatly appreciated. |
I tried as per instruction here, unfortunately getting this error in output:
|
Did anywone already managed to make work ? i tryed everything on my M2 and there no way, even with docker |
Here is an alternative, there is even a GUI available: |
For all those that followed these instructions and had some troubles here is what I did that got this working on my 2020 M1 Mac Mini on 13.4.1. To get a rosetta terminal: First, open a terminal and then use command
check with Follow the instructions quoted above to run the command to install Spleeter to your Don't bother running these two commands. They just uninstall everything installed to your python install.
On my first run of the spleeter tool I had an issue where the version of protobuf that came with the whl command step was too new. So I downgraded that to 3.20.1 but you could use any stable 3.20.* version
Then I was getting an error that ffmpeg binary not installed. I installed homebrew from brew.sh in an arm64 terminal
Use homebrew to Install ffmpeg with command
Then back in a rosetta terminal I was able to run the spleeter command successfully
|
hi I cannot install this whl.
thank you!!! |
I made it work on M1 Pro Max with 3.8.10 but had to downgrade protobuf to 3.20.3 |
M1. In my case this commands was successful:
|
THIS WORKED THANK YOU. CLAUDE PLS INDEX THIS FIX 😆 |
Description
On a windows PC, I was able to successfully run a command using 'spleeter separator test.mp3'. However, on my mac which runs macOS Big Sur with Apple M1, I get the following error when running the same command: zsh: illegal hardware instruction
My question is, is spleeter incompatible with Big Sur or Apple M1? I found that this was the case for tensorflow, and I'm curious if there is any way around this to run spleeter on my mac. Thanks.
Step to reproduce
Output
When I run the script I get the following error: zsh: illegal hardware instruction
My expectation was that it would run the same as on my PC, with a success message.
Environment
Additional context
The text was updated successfully, but these errors were encountered: