-
Notifications
You must be signed in to change notification settings - Fork 4
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
Error "illegal hardware instruction" with Rosetta / M1 #52
Comments
If you follows the CIAO download instructions that you linked, then you probably executed somethimg like this (maybe with some additonal Python packages thrown in - I usually also install astropy, scipy etc.)
In other words, you probably installed marx already as a conda pacakge. So, there should be no need to run I'm also somewhat surprised that is does not work, because marx does not depend on any external library (e.g. instead of using cfitsio, marx includes its own jdfits library - the reason is historic: When marx was writen, cfitsio was not available). However, I also can't debug that without any output and |
Thanks @hamogu, indeed
So it seems they point to the conda installed binaries. Just to make sure I haven't screwed up my environment with the |
Even in a newly installed environment the error persists. This is the environment I'm using: https://github.com/astrostat/pylira-extra/blob/main/datasets/chandra-arlac/environment.yaml |
I ordered and M1 machine for myself a few weeks ago just to prepare for this case to give me at least some chance of debugging M1 issues.... I'll look into it, but (since I received that machine only 2 weeks ago) I have no experience with this wired double-architecture yet and it would be great if I could take some time (plus, the holidays are coming). Do you need an urgent solution or can you work around it for now (e.g. use a different computer for the running marx)? |
Also, if possible, it would be great if you could post a complete example here. You say above that |
Thanks a lot @hamogu! I'm running the following script, which defines the analysis steps https://github.com/astrostat/pylira-extra/blob/main/datasets/chandra-arlac/make.py So you could basically clone https://github.com/astrostat/pylira-extra/, create the environment and run Meanwhile I'll check for a workaround... |
Here is the output of
|
I'm missing the file Depending on how big the files are, you might not want to attach them to a github issue, but could send them to me by email or point me to a location on the Cfa HEAD LAN e.g. /pool7/xxx/xxx . |
It's latel I should go to bed. That's of course stupid of me. I just need ot download the OBSID by hand first so that I get the |
OK, I've run through all your steps and it works for me:
That let's me think that it's your setup, not marx. I see above that you use mambaforge (like I do) and also have the same conda version that I use. So, that can't be it. However, your path indicates that you have a (separate?) mamba for intel "/Users/adonath/software/mambaforge-intel/envs/ciao-4.14", while I'm using only the ARM mamba and then install environment that require rosatta2 with specific settings per environment. Some notes on what I did are below; but I did not test if installing an intel specific mamba and using that for your environment can trigger the problem - I only know that my setup does not trigger it. Since conda-forge now offers arm64 (M1, Apple Silicon) native builds for miniforge/mambaforge (https://github.com/conda-forge/miniforge#download) and for essentially all packages on conda-forge, my conda installation is ARM-native. So, if I naively put in the commands from the CIAO install threads
conda fails to find the packages since it's only looking into the noarch and osx-arm64 directories of each channel, but we only have osx-64 builds for CIAO and our other binary packages. That is true even if the terminal where I type that command itself runs under Rosetta2. However, I can tell conda which subdir in each channel to look at specifically:
Again, for this command it does not matter if I'm running it in a "normal" terminal or an "rosetta2" terminal, since it's just downloaded and installing, not using the packages. After creating an environment, it makes sense to set the
(Alternatively, I would just create an empty environment and then do the conda env config ... before installing anything.) That complete the setup. In order to use the CIAO software, I have to open a terminal with Rosetta2 emulation, and the I can do the usual
and go from there. |
Can you check your $PATH? Maybe there is something in there from your earlier attempt to compile marx with |
Thanks a lot for your help @hamogu! I didn't know about the My $ echo $PATH
/Users/adonath/software/mambaforge/envs/ciao-4.14/bin:/Users/adonath/software/mambaforge/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
$echo $CONDA_SUBDIR
osx-64
$echo $MARX_ROOT
/Users/adonath/software/mambaforge/envs/ciao-4.14/ Output of active environment : ciao-4.14
active env location : /Users/adonath/software/mambaforge/envs/ciao-4.14
shell level : 2
user config file : /Users/adonath/.condarc
populated config files : /Users/adonath/software/mambaforge/.condarc
conda version : 4.11.0
conda-build version : not installed
python version : 3.9.7.final.0
virtual packages : __osx=11.6=0
__unix=0=0
__archspec=1=x86_64
base environment : /Users/adonath/software/mambaforge (writable)
conda av data dir : /Users/adonath/software/mambaforge/etc/conda
conda av metadata url : None
channel URLs : https://conda.anaconda.org/conda-forge/osx-64
https://conda.anaconda.org/conda-forge/noarch
package cache : /Users/adonath/software/mambaforge/pkgs
/Users/adonath/.conda/pkgs
envs directories : /Users/adonath/software/mambaforge/envs
/Users/adonath/.conda/envs
platform : osx-64
user-agent : conda/4.11.0 requests/2.26.0 CPython/3.9.7 Darwin/20.6.0 OSX/11.6
UID:GID : 502:20
netrc file : None
offline mode : False The terminal runs correctly in Rosetta mode: What is interesting: when running the terminal without Rosetta2 activated I get exactly the same error (except they I expect it there...). So I'm starting to doubt my Rosetta2 mode works correctly. |
Unfortunately, I can't help with debugging why Rosetta2 might not do the right thing. I'm still very new to this M1 system myself... What's odd to me it that your script makes it all the way through to |
I completely agree here, the behavior doesn't make any sense to me... I have access to another M1 MacBook Air so I will now try to make it work there and report. |
For completeness: I setup the environment on the M1 MacBook Air I have access to and it runs through without any issue. |
Coming back to this old issue... Is this still an issue? If so, is there anything I can do about it? I'm a little lost how to move this forward, since I can't reproduce it on my Mac. Or can I close this issue? |
Since there are been no comment in the fast two years and it seems to work now, I'm going to close this issue. Please reopen if new cases of failure are observed or if any new information emerges that makes this actionable for Marx developers. |
I'm using a
conda
osx-64 environment on an M1 machine, which runs in the command line using Rosetta. I created the ciao environment as described here https://cxc.cfa.harvard.edu/ciao/download/ and everything works fine. I'm following https://cxc.cfa.harvard.edu/ciao/threads/marx/ to finally create a PSF image. For this I installedmarx
using theinstall_marx
script.However when running
simulate_psf
I receive:And when running
marx2fits --pixadj=RANDOMIZE psf_i0000_marx.dir psf_i0000_marx.fits
independently I get the following error:The error suggests an interference with some other libraries build for the
osx-arm64
or similar. The part that confuses me is, thatmarx2fits
, without any arguments just runs fine. I presume the solution is somehow to re-buildmarx
from source and link to the correct libraries, however any help is appreciated here!The text was updated successfully, but these errors were encountered: