# Ray with Apple M1

**URL:** <https://discuss.ray.io/t/ray-with-apple-m1/624>\
**Category:** Ray Core\
**Created:** [January 27, 2021, 7:37pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624 "2021-01-27T19:37:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Praseeth\_Prabhakaran](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/praseeth_prabhakaran/32/342_2.png) [@Praseeth\_Prabhakaran](https://discuss.ray.io/u/Praseeth_Prabhakaran)\
**Post date:** [January 27, 2021, 7:37pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/1 "2021-01-27T19:37:15Z")

</div>

Has anybody tried running Ray with Apple M1 processor? Either through Rosetta or Natively ?

---

<div class="post-metadata">

**Author:** ![zhz](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/zhz/32/12_2.png) [@zhz](https://discuss.ray.io/u/zhz)\
**Post date:** [January 29, 2021, 5:48am UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/2 "2021-01-29T05:48:49Z")

</div>

I don’t think anyone on Ray team has a machine with M1 unfortunately. So let’s see if anyone in the community does.

But @Praseeth_Prabhakaran what’s your specific question about it? Did you try and run into issues? Thanks

---

<div class="post-metadata">

**Author:** ![Praseeth\_Prabhakaran](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/praseeth_prabhakaran/32/342_2.png) [@Praseeth\_Prabhakaran](https://discuss.ray.io/u/Praseeth_Prabhakaran)\
**Post date:** [January 29, 2021, 11:57am UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/3 "2021-01-29T11:57:54Z")

</div>

No. I just ordered an MBA with M1. I will update here once it comes and I test a simple code using ray. I just wanted to know if anyone tried it already

---

<div class="post-metadata">

**Author:** ![alex\_koch](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@alex\_koch](https://discuss.ray.io/u/alex_koch)\
**Post date:** [February 3, 2021, 9:39am UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/4 "2021-02-03T09:39:26Z")

</div>

I have tried it already with Rosetta. It seems like ray works. However, you have to run python with sudo.

Unfortunately rllib doesn’t work at all. It crashes with an illegal hardware instruction.

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [February 4, 2021, 6:03am UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/5 "2021-02-04T06:03:07Z")

</div>

cc @sven1977 we should potentially start taking a look at this

---

<div class="post-metadata">

**Author:** ![dwallach](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dwallach](https://discuss.ray.io/u/dwallach)\
**Post date:** [May 6, 2021, 4:17pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/6 "2021-05-06T16:17:43Z")

</div>

Any updates on this? I’m getting a new M1 Mac, would be nice if Ray worked.

---

<div class="post-metadata">

**Author:** ![smorad](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/smorad/32/272_2.png) [@smorad](https://discuss.ray.io/u/smorad)\
**Post date:** [May 6, 2021, 7:48pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/7 "2021-05-06T19:48:05Z")

</div>

I tune+rllib working with `arm64` linux, see [ARM64 Support/CI integration](https://discuss.ray.io/t/arm64-support-ci-integration/1893)

I have been meaning to try it on my M1(arm64) MacBook, but other things have come up. Seeing as it works for both `Darwin x86` and `Linux arm64`, it should not be too difficult to build for `Darwin arm64`.

---

<div class="post-metadata">

**Author:** ![smorad](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/smorad/32/272_2.png) [@smorad](https://discuss.ray.io/u/smorad)\
**Post date:** [May 6, 2021, 7:52pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/8 "2021-05-06T19:52:32Z")

</div>

Update: I actually did compile it a while back on my M1 MacBook for arm (not x86). You need to install bazel and various other deps. I suggest using [miniforge](https://github.com/conda-forge/miniforge) various deps for an arm64 target.

However, running ray does not yet work

```auto
>>> import ray
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/smorad/code/from_src/ray/python/ray/ __init__.py", line 68, in <module>
    _configure_system()
  File "/Users/smorad/code/from_src/ray/python/ray/ __init__.py", line 65, in _configure_system
    CDLL(so_path, ctypes.RTLD_GLOBAL)
  File "/Users/smorad/miniforge3/envs/rl/lib/python3.8/ctypes/ __init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/smorad/code/from_src/ray/python/ray/_raylet.so, 10): no suitable image found. Did find:
	/Users/smorad/code/from_src/ray/python/ray/_raylet.so: mach-o, but wrong architecture
	/Users/smorad/code/from_src/ray/python/ray/_raylet.so: mach-o, but wrong architecture

```

Build completes, but I get error messages:

```auto
INFO: From Linking python/ray/_raylet.so:
ld: warning: cannot export hidden symbol std:: __1::__ assoc_state<ray::Status>::~__assoc_state() from bazel-out/darwin-opt/bin/libcore_worker_lib.a(core_worker.pic_7b78aca6b2fd2113215b5d3a7c64d4f7.o)
ld: warning: cannot export hidden symbol std:: __1::__ assoc_state<ray::Status>::~__assoc_state() from bazel-out/darwin-opt/bin/libcore_worker_lib.a(core_worker.pic_7b78aca6b2fd2113215b5d3a7c64d4f7.o)
ld: warning: cannot export hidden symbol std:: __1::__ assoc_state<ray::Status>::__on_zero_shared() from bazel-out/darwin-opt/bin/libcore_worker_lib.a(core_worker.pic_7b78aca6b2fd2113215b5d3a7c64d4f7.o)
ld: warning: cannot export hidden symbol void std:: __1::__ assoc_state<ray::Status>::set_value<ray::Status const&>(ray::Status const&) from bazel-out/darwin-opt/bin/libcore_worker_lib.a(core_worker.pic_7b78aca6b2fd2113215b5d3a7c64d4f7.o)
ld: warning: cannot export hidden symbol std:: __1::__ assoc_state<ray::Status>::move() from bazel-out/darwin-opt/bin/libcore_worker_lib.a(core_worker.pic_7b78aca6b2fd2113215b5d3a7c64d4f7.o)
ld: warning: cannot export hidden symbol typeinfo name for std:: __1::__ assoc_state<ray::Status> from bazel-out/darwin-opt/bin/libcore_worker_lib.a(core_worker.pic_7b78aca6b2fd2113215b5d3a7c64d4f7.o)
ld: warning: cannot export hidden symbol vtable for std:: __1::__ assoc_state<ray::Status> from bazel-out/darwin-opt/bin/libcore_worker_lib.a(core_worker.pic_7b78aca6b2fd2113215b5d3a7c64d4f7.o)
ld: warning: cannot export hidden symbol typeinfo for std:: __1::__ assoc_state<ray::Status> from bazel-out/darwin-opt/bin/libcore_worker_lib.a(core_worker.pic_7b78aca6b2fd2113215b5d3a7c64d4f7.o)
ld: warning: cannot export hidden symbol std:: __1::__ assoc_state<ray::Status>::~__assoc_state() from bazel-out/darwin-opt/bin/libgcs.a(accessor.pic_46f629cf7de15f7d7489bb74c90a7279.o)
ld: warning: cannot export hidden symbol std:: __1::__ assoc_state<ray::Status>::~__assoc_state() from bazel-out/darwin-opt/bin/libgcs.a(accessor.pic_46f629cf7de15f7d7489bb74c90a7279.o)
ld: warning: cannot export hidden symbol std:: __1::__ assoc_state<ray::Status>::__on_zero_shared() from bazel-out/darwin-opt/bin/libgcs.a(accessor.pic_46f629cf7de15f7d7489bb74c90a7279.o)
ld: warning: cannot export hidden symbol void std:: __1::__ assoc_state<ray::Status>::set_value<ray::Status const&>(ray::Status const&) from bazel-out/darwin-opt/bin/libgcs.a(accessor.pic_46f629cf7de15f7d7489bb74c90a7279.o)
ld: warning: cannot export hidden symbol std:: __1::__ assoc_state<ray::Status>::move() from bazel-out/darwin-opt/bin/libgcs.a(accessor.pic_46f629cf7de15f7d7489bb74c90a7279.o)
ld: warning: cannot export hidden symbol vtable for std:: __1::__ assoc_state<ray::Status> from bazel-out/darwin-opt/bin/libgcs.a(accessor.pic_46f629cf7de15f7d7489bb74c90a7279.o)
ld: warning: cannot export hidden symbol typeinfo for std:: __1::__ assoc_state<ray::Status> from bazel-out/darwin-opt/bin/libgcs.a(accessor.pic_46f629cf7de15f7d7489bb74c90a7279.o)
ld: warning: cannot export hidden symbol typeinfo name for std:: __1::__ assoc_state<ray::Status> from bazel-out/darwin-opt/bin/libgcs.a(accessor.pic_46f629cf7de15f7d7489bb74c90a7279.o)

```

I suspect once `raylet` is fixed, this will work on the M1 chip.

---

<div class="post-metadata">

**Author:** ![dmatrixjsd](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/dmatrixjsd/32/1532_2.png) [@dmatrixjsd](https://discuss.ray.io/u/dmatrixjsd)\
**Post date:** [September 23, 2021, 12:08am UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/9 "2021-09-23T00:08:39Z")

</div>

As of this morning, on my new mac book pro 13 m1, I could:

- pip install ‘ray[default]’
- build xgboost on my machine for the arm arch from my clone of xgboost
- pip install xgboost from the clone
- pip install xgboost-ray

And run my [Feast workshop module 3](https://github.com/dmatrix/feast_workshops/tree/master/module_3#readme) with Ray on single host, single core, and single host, multiple cores.

---

<div class="post-metadata">

**Author:** ![gmentat](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@gmentat](https://discuss.ray.io/u/gmentat)\
**Post date:** [September 23, 2021, 1:21pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/10 "2021-09-23T13:21:29Z")

</div>

I’m trying to install ray on my Mac book pro 13 m1 but getting the following error:

> pip install ray  
> ERROR: Could not find a version that satisfies the requirement ray (from versions: none)  
> ERROR: No matching distribution found for ray

The python version is 3.9, also tried with 3.8.

Have you encountered anything similar?

---

<div class="post-metadata">

**Author:** ![dmatrixjsd](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/dmatrixjsd/32/1532_2.png) [@dmatrixjsd](https://discuss.ray.io/u/dmatrixjsd)\
**Post date:** [September 23, 2021, 1:39pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/11 "2021-09-23T13:39:18Z")

</div>

Make sure your pip is the latest version and python is 3.9.5  
`pip --version`  
pip 21.2.4 from /opt/miniconda3/lib/python3.9/site-packages/pip (python 3.9)

`python --version`  
Python 3.9.5

`pip install "ray[default]"`

---

<div class="post-metadata">

**Author:** ![gmentat](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@gmentat](https://discuss.ray.io/u/gmentat)\
**Post date:** [September 23, 2021, 2:25pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/12 "2021-09-23T14:25:36Z")

</div>

Thanks for replying @dmatrixjsd. I have the same versions of both pip and python and I managed to install ray via anaconda’s 3.8 python. Installing from a virtual environment with python 3.9 or miniconda64 still throws the errors. Weird stuff.

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [September 24, 2021, 9:49pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/13 "2021-09-24T21:49:39Z")

</div>

cc @Alex I thought we were in the process of ARM support. Is that still in progress?

---

<div class="post-metadata">

**Author:** ![mike576](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mike576/32/467_2.png) [@mike576](https://discuss.ray.io/u/mike576)\
**Post date:** [November 10, 2021, 8:14pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/14 "2021-11-10T20:14:50Z")

</div>

In my case I could not install ray[tune] in an arm/noarch conda env.

BUT starting a terminal with rosetta and create conda env like this:

```auto
CONDA_SUBDIR=osx-64 conda create -n rosetta python=3.9 # create a new environment called rosetta with intel packages.
conda activate rosetta
python -c "import platform;print(platform.machine())"
conda env config vars set CONDA_SUBDIR=osx-64 # make sure that conda commands in this environment use intel packages
conda deactivate 
conda activate rosetta
echo "CONDA_SUBDIR: $CONDA_SUBDIR"
pip install ray[tune]

```

Then it worked! Of course, this means it all runs with Rosetta.

---

<div class="post-metadata">

**Author:** ![Roller44](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/roller44/32/1064_2.png) [@Roller44](https://discuss.ray.io/u/Roller44)\
**Post date:** [November 11, 2021, 1:54pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/15 "2021-11-11T13:54:07Z")

</div>

What does it like to run RL/DL algorithm via Ray on an M1 MacBook? Is it significantly faster than other X86 computers? Just curious.

---

<div class="post-metadata">

**Author:** ![Alex](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/alex/32/341_2.png) [@Alex](https://discuss.ray.io/u/Alex)\
**Post date:** [November 17, 2021, 10:56pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/16 "2021-11-17T22:56:21Z")

</div>

Just to follow up, there are now official wheels for M1 starting with Ray 1.8!

[https://docs.ray.io/en/master/installation.html#apple-silicon-support](https://docs.ray.io/en/master/installation.html#apple-silicon-support)

---

<div class="post-metadata">

**Author:** ![SoonHeng](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/soonheng/32/6182_2.png) [@SoonHeng](https://discuss.ray.io/u/SoonHeng)\
**Post date:** [June 2, 2024, 1:21pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/17 "2024-06-02T13:21:13Z")

</div>

Hello there, I following the official site and install ray on Apple M1.  
Couple of things I notice.

1. To test in the installation, we need to do this: python -m pytest -v python/ray/tests/test\_mini.py. But, the installation doesn’t include test\_mini.py. As such, you need to pull in from github repo. After that, you can run the installation test. And, there is a new error surface as below:  
ImportError while loading conftest ‘/Users/“path to test\_mini.py”/confttest.py’ .  
python/ray/tests/conftest.py:27: in   
from ray.provate.test.utils import (  
ImportError: cannot import name “RayletKiller” from 'ray.private.test\_utils…

Can anyone share some insights on what this error is? Is the installation correct?

---

<div class="post-metadata">

**Author:** ![Sam\_Chan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sam_chan/32/5011_2.png) [@Sam\_Chan](https://discuss.ray.io/u/Sam_Chan)\
**Post date:** [June 3, 2024, 4:32am UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/18 "2024-06-03T04:32:02Z")

</div>

Can you share how exactly you installed Ray? Did you go through pypi or are you trying to compile from source?

---

<div class="post-metadata">

**Author:** ![SoonHeng](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/soonheng/32/6182_2.png) [@SoonHeng](https://discuss.ray.io/u/SoonHeng)\
**Post date:** [June 3, 2024, 6:34am UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/19 "2024-06-03T06:34:32Z")

</div>

Hello Sam,  
I just follow the steps as outlined: [Installing Ray — Ray 2.23.0](https://docs.ray.io/en/latest/ray-overview/installation.html). Since it is apple M, I gollow the get the miniforge steps and then install via pip.  
Then, I want to test the installation. That’s where I start to hit the above error.

---

<div class="post-metadata">

**Author:** ![Sam\_Chan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sam_chan/32/5011_2.png) [@Sam\_Chan](https://discuss.ray.io/u/Sam_Chan)\
**Post date:** [June 4, 2024, 5:10pm UTC](https://discuss.ray.io/t/ray-with-apple-m1/624/20 "2024-06-04T17:10:03Z")

</div>

Hmm…that is weird. To unblock can you ignore the miniforge conda setup and just pip install ray?

If that works and unblocks please proceed and if you could cut a Github ticket for the missing miniforge setup we will follow up.
