Reputation: 1468
I am running PyTorch in Python 3.8.5 on a M1 Macbook Pro, and I get these error messages:
Intel MKL FATAL ERROR: This system does not meet the minimum requirements for use of the Intel(R) Math Kernel Library.
The processor must support the Intel(R) Supplemental Streaming SIMD Extensions 3 (Intel(R) SSSE3) instructions.
The processor must support the Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) instructions.
The processor must support the Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.
What do they mean, and what can I do to resolve them?
Upvotes: 19
Views: 20320
Reputation: 331
Got the same error when trying Huggingface models. M1 Mac with conda
environment.
Apparently "problem" is that conda
installs packages for M1 Mac (who would have thought, huh) but not every library works with arm processor. This seems to be the case with Torch library.
How I fixed this.
pip install torch, torchvision
conda install
the rest of dependencies.The problem might not be in Torch package itself but rather the way conda
picks other dependencies. It looks for best ones for particular environment. On the other hand pip
doesn't bother much to find most suitable ones particularly for arm processor and installs what works.
Upvotes: 1
Reputation: 1523
I ran into this error when trying to install an intel env via conda
on an M1 mac. With a native env (osx-arm64
) it worked, but I needed an intel env (osx-64
) for some other reason.
I managed to resolve this error by downgrading mkl
to version 2021 instead of version 2022 which was installed as a transitive dependency.
I simply added this to my environment.yml
and re-installed it:
- mkl < 2022
Note that if your conda
is M1 native (i.e. has a platform of osx-arm64
), and you want to install an intel environment, you need to do it like so:
CONDA_SUBDIR=osx-64 conda env update -f environment.yml
The env also contains pytorch
, and this approach allowed me to install everything via conda, instead of relying on a hybrid of conda/pip like the other solutions.
Upvotes: 12
Reputation: 109
As @CJD suggested installing PyTorch using pip apparently solves the problem, even on a Mac with M1 or newer versions M1 Pro and M1 Max [Tested].
Using pip
will install PyTorch without MKL.
Steps:
conda
(if it is installed): conda remove pytorch
pip
: pip install torch
.Check the following link for further details: https://github.com/pytorch/pytorch/issues/71022
Upvotes: 7
Reputation: 53
I was getting the same error messages for any package I tried to import (ie, numpy, pandas, etc). I am running OSX Monterey on a late 2008 macbook 5,1 through opencore. The key bit for me was just installing nomkl as per CJD's comment above. It didn't matter whether it was a new or base environment. I don't really understand what the problem was or the possible limitations of the fix, but it is working now.
Upvotes: 2