Skip to content
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

Jaxlib CPU issues #5

Closed
juliagorman opened this issue Mar 22, 2023 · 5 comments
Closed

Jaxlib CPU issues #5

juliagorman opened this issue Mar 22, 2023 · 5 comments

Comments

@juliagorman
Copy link

I am running off my Mac laptop and I installed pip as such: pip install "jax[cpu]" and now I am getting this error just when running the first line of the keypoint-MoSeq walkthrough

Screenshot 2023-03-22 at 11 58 59 AM

@calebweinreb
Copy link
Contributor

The error

RuntimeError: This version of jaxlib was built using AVX instructions, which your CPU and/or operating system do not support. You may be able work around this issue by building jaxlib from source.

is caused by trying to pip install jax on a mac with an M1 chip. You can see a discussion about workarounds here. Basically, the two approaches seem to be installing jax with conda (from conda-forge) or installing jax via miniforge.

I haven't been able to test either approach since I don't have an M1 chip... Would you be able to try the following and let me know how it goes?

  1. Delete your existing keypoint_moseq environment (conda env remove -n keypoint_moseq)
  2. Reinstall using the conda .yml file from the repo, as described in the keypoint-moseq docs

@talmo
Copy link
Contributor

talmo commented Mar 25, 2023

I think PR #6 fixes the installation issues with the conda environment, and I was able to install it on CPU on an M1 Mac via the Linux CPU conda file (conda_envs/environment.linux_cpu.yml), but there are still other dependency issues.

I submitted PR #7 to add a Mac-specific conda environment file to fix this, but it only supports CPU.

For native Apple Silicon Metal support, see this related Jax issue: jax-ml/jax#8074

@calebweinreb
Copy link
Contributor

OK so final answer here is to install via conda

conda env create -f conda_envs/environment.mac_cpu.yml

@juliagorman
Copy link
Author

when i run this command now, i get this error
Screenshot 2023-04-18 at 2 23 46 PM

@calebweinreb
Copy link
Contributor

make sure the current working directory for your terminal is keypoint-moseq, i.e. by cloning the repo as described in the docs.

git clone https://github.com/dattalab/keypoint-moseq
chdir keypoint-moseq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants