-
Notifications
You must be signed in to change notification settings - Fork 15
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
Segmentation fault for Apple Silicon M1 CPU #23
Comments
I always use the I will try to get someone else with a Mac to test. |
My computer uses the Apple Silicon M1 CPU.
|
I attempted to replicate on my M1 MBP and didn't get a segmentation fault. $ git clone --branch testing_script https://github.com/frheault/tractography_file_format.git
$ pip3 install .
Successfully installed Cython-0.29.28 aiohttp-3.8.1 aiosignal-1.2.0 async-timeout-4.0.2 charset-normalizer-2.0.12 dipy-1.6.0.dev0 frozenlist-1.3.0 fury-0.8.0.post416+g5059a52 multidict-6.0.2 tractography-file-format-0.0.0 vtk-9.1.0 wslink-1.6.1 yarl-1.7.2
$ cd scripts
$ python3 tff_convert_tractogram.py ~/AF_left.trk ~/test.trx OS: macOS Big Sur v11.1 |
I still get the fault. I tried removing all the components you installed.
I get the same crash if I attempt to import the library:
|
Are both/either of you using Anaconda Python? If one is and the other isn't
that could also be a cause.
…On Fri, Apr 29, 2022 at 11:07 AM Chris Rorden ***@***.***> wrote:
I still get the fault. I tried removing all the components you installed.
$ pip3 uninstall Cython aiohttp aiosignal async-timeout charset-normalizer dipy frozenlist fury multidict tractography-file-format vtk wslink yarl
$ git clone --branch testing_script https://github.com/frheault/tractography_file_format.git
$ cd tractography_file_format
$ pip3 install .
$ cd scripts
$ python3 tff_convert_tractogram.py ~/AF_left.trk ~/test.trx
zsh: segmentation fault python3 tff_convert_tractogram.py ~/IFOF_L.trk IFO.trx
$sw_vers
ProductName: macOS
ProductVersion: 11.6.5
BuildVersion: 20G527
$sysctl -n hw.model
MacBookAir10,1
I get the same crash if I attempt to import the library:
> python
Python 3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:41:07)
[Clang 11.1.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print('hola')
hola
>>> from tractography_file_format.workflows import convert_tractogram
zsh: segmentation fault python3
—
Reply to this email directly, view it on GitHub
<#23 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA46NX57MV6QGZSBI4U7P3VHQQNTANCNFSM5T3YUZPQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I was:
deactivating condo and attempting to a clean install did not go well:
|
@neurolabusc for the clean env there is a When I get out of isolation I will do some testing on a Mac with and without Anancoda and hopefully replicate your error. |
It still fails:
|
I don't own a Mac, so I don't know why and partially remember, but I once solved that with The underlying error of the segfault will be hard to identify. EDIT: When I get my hands on a Mac Monday, I will note what I did from scratch and write it in the README.md |
This sounds very familiar. I also had huge issues getting dipy installed on my M1, that eventually was at least part of the solution. I don't use anaconda, I use homebrew python. |
I was able to get
Is there a way to get the functionality without all of these dependencies? Now that I have attempted to install via both conda and non-conda my system hard disk shows it getting filled with all things Python. |
Dipy and Nibabel and VTK are required for the scripts and the utilities, so there no way around it. You probably need Conda probably installed all of that (and a lot more), but it's weird Conda didn't work as it was. I'm sorry I don't have a recipe for you, I'm not a Mac user and I don't know what's going on with Conda. @fionaEyoung Is there something special about M1? |
Does not look
|
@arokem Do you have an idea? |
We do not provide wheels or tried with ARM64 yet for DIPY. So, on macOS, I recommend using Rosetta for now (the x86_64 emulator). we need to check if all DIPY dependencies work with ARM64 which seems to not be the case now. I did not follow the thread above so I am not sure if homebrew or conda is using the rosetta environment or ARM64 environment. Also, do not forget that OpenGL "is not working" on the ARM64 architecture of the mac M1, you need to use the rosetta environment. VTK works only in the rosetta environment. They did not integrate vulkan/moltenvk and it will take quite some time for them to do it. This implies that the VTK reader can be problematic for quite a long time if you do not implement your own. |
Well, this seems to explain why everything is breaking, thank you for the information. I had no idea there were so many underlying issues! |
@neurolabusc does this help? |
@skoudoro thanks for all your insightful comments. I do want to take issue with your comment |
I wonder if the DIPY developers could revisit this issue.
|
Does this mean that Mac-bound DIPY users would have to install VTK with homebrew for DIPY to work? That might cause some environment messes (e.g., for conda users), no? |
Thank you for pinging us @neurolabusc. I will look into it today or tomorrow. it seems that our core dependencies (h5py, NumPy, scipy) and some optional dependencies (like VTK) have a wheel on PyPI for native support of macOS with python 3.9. For some of them, the wheels are missing for python 3.10 so it will work only on python 3.9 for now. So the goal is to check if all the tests passed with the current version of DIPY and arm64.
|
it should now work now natively on mac M1 with python 3.9. I do not have this machine so can you try it and give us an update @neurolabusc? (VTK should work also with Thanks! |
Any ideas?
|
@skoudoro just tried again, with same results as June. Anything else I can do? |
Hi @neurolabusc, Sorry, I did not try yet to fork the repo and introspect in detail this command line to see where it fails exactly. Since you have no issue with the installation anymore, I was assuming that someone else will look at that. I am not sure what is the reason for the segfault (if it is coming from trx, dipy, vtk or something else). I hope I will be able to reproduce it. I will look into it next week and keep you updated, I am currently not available this week. |
My mac is too old and I can not generate the error, everything is working as expected. I am currently trying to have access to an M1. |
@skoudoro I would suggest you ask for cloud credits from brainhack_cloud or use the free tier this will give you access to Ampere Altera A1 ARM-based CPUs. For your needs, I do not even think you need docker, you can simply create and launch an instance and SSH into the CPU. Here are the instructions. You can create multiple instances using Oracle (rpm-based) or Ubuntu (Debian-based 18.04-22.04) distributions. You can choose between ARM (A1) and x86-64 (Xeon and Ryzen) instances, so you can validate your solution across architectures. I am happy to have a zoom meeting to help get you up and running. |
Hi @neurolabusc, I just got a new M1 and try this. it worked as expected, no segmentation fault. you use this repo I am not sure that the repo you are using is up to date. I hope it helps, keep me updated |
@frheault, can you tell us if you continue to update |
@skoudoro well spotted. Thanks for following up on this. It does seem like the installer(s) do not correctly identify all the dependencies - things worked if I manually installed them. Is there a way we could resolve these? Regardless, I think you can close this issue as you have resolved my core issue.
|
I had the same problem concerning the dependencies, I had to do it manually. I think #36 is fixing those problems so it should be better when this PR is merged. |
That repository is now set to automatically redirect here. So, this repository supersedes it completely. I believe that you can still pull from the old URL, so you don't necessarily have to update the remotes on your local machine. |
Recent versions of the
testing_script
branch fail on my macOS M1 computer. Earlier commits work correctly. I am eager to try out the new features (options to save indices and positions as 32-bit values). There is no documentation on installation, so perhaps I am doing something wrong. Can you replicate this behavior (assuming a valid TRK file in the home directory):The text was updated successfully, but these errors were encountered: