Native apple silicon macOS m1 and m2 support

Can I install Mojo on macOS m1 or m2 yet?
93 Replies
Jack Clayton
Jack ClaytonOP16mo ago
Not yet, we're working on native support, and you can upvote the GitHub ticket here: https://github.com/modularml/mojo/issues/510 We have instructions to set up a remote x86-64 environment here: https://developer.modular.com/download And if you're on macOS with an x86 chip you can set up a docker container: https://github.com/modularml/mojo/blob/main/examples/docker/Dockerfile.mojosdk
GitHub
[Feature Request] Support for macOS · Issue #510 · modularml/mojo
Review Mojo's priorities I have read the roadmap and priorities and I believe this request falls within the priorities. What is your request? Tracking issue for supporting Mojo on macOS. Please...
GitHub
mojo/examples/docker/Dockerfile.mojosdk at main · modularml/mojo
The Mojo Programming Language. Contribute to modularml/mojo development by creating an account on GitHub.
Julia
Julia16mo ago
Is it expected not to work even when using a Docker container built with FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/base:ubuntu-22.04?
titusmoore
titusmoore16mo ago
I am already running it in the remote x86_64 env, but it is not the same you sure understand. It is good for testing Mojo itself apart from all my real life projects
Jack Clayton
Jack ClaytonOP16mo ago
@Julia that's right emulation through QEMU and Rosetta both don't work
titusmoore
titusmoore16mo ago
Sure I could build API for communication with it, but who does have time for that when I have fulltime job Upvoted
Jack Clayton
Jack ClaytonOP16mo ago
Definitely we understand how much the community wants native support!
𝐍𝐚𝐩𝐢𝐞𝐫
When can we expect it for mac
Moosems / Three chickens
Even a month (a named month) estimate would be greatly appreciated imo.
sgaseretto
sgaseretto16mo ago
Even having support for ARM so we could run it with Docker would be great I think
rick
rick16mo ago
is there a non-native version rn? pardon my misunderstanding but i thought just linux for now?
Jack Clayton
Jack ClaytonOP16mo ago
You can install into a remote container if on arm64, or use a docker container if on x86_64
ksandvik
ksandvik15mo ago
Yes, please keep this Q&A about Mac M1/M2 support, thx.
chadbrewbaker
chadbrewbaker15mo ago
I finally found some sane documentation on targeting Apple Neural Engine directly. https://github.com/eiln/ane/blob/main/docs/README.md The most simple HelloWorld would be to use the ANE to make a memcopy()? Second would be hashing memory regions?
Moosems / Three chickens
So cool!!
guidorice
guidorice15mo ago
arm64 🧙
Logan
Logan15mo ago
Soon as In sometime in the next week or two or soon as in like a month or two?
ksandvik
ksandvik15mo ago
Follow #mojo-announcements
nole_ksum
nole_ksum15mo ago
still waiting
gryznar
gryznar15mo ago
At 19th October 😁
sa-code
sa-code15mo ago
Tomorrow's the day
namo
namo15mo ago
Yessss .. finally :mojo:
Moosems / Three chickens
Less goo!
Lcross🦠
Lcross🦠15mo ago
🥳
ModularBot
ModularBot15mo ago
Congrats @Lcross🦠, you just advanced to level 1!
guidorice
guidorice15mo ago
https://docs.modular.com/mojo/changelog.html
The Mojo SDK now works on macOS (Apple silicon). This is the same version previously released for Linux. Get the latest version of the SDK for your Mac system:
Modular Docs - Mojo🔥 changelog
A history of significant Mojo changes.
guidorice
guidorice15mo ago
Had to run the curl command twice, the first time it failed with an auth issue. That said, good choice using brew for the macos sdk. Downloading artifacts now... :mojo:
sa-code
sa-code15mo ago
Wooooooo
Melody Daniel
Melody Daniel15mo ago
Only Apple Silicon? It doesn't support Intel?
Moosems / Three chickens
That’s what I was thinking 😕.
Jack Clayton
Jack ClaytonOP15mo ago
@Melody Daniel only Apple Silicon at the moment yeah, you can use docker on Intel Macs for now
Lcross🦠
Lcross🦠15mo ago
It's working here on Silicon! Needed to run as lower case modular auth [auth_code] after curl & setting path and before installing mojo
𝐍𝐚𝐩𝐢𝐞𝐫
It is stuck on downloading artifcats
ModularBot
ModularBot15mo ago
Congrats @𝐍𝐚𝐩𝐢𝐞𝐫, you just advanced to level 3!
aespeiuk
aespeiuk15mo ago
can you give me the exact command? My apple silicon says it is not arm64 tried "curl https://get.modular.com | \ MODULARAUTH=mut \ sh -" and "brew update brew install modularml/packages/modular" and it fails
rdsaylor#2029
rdsaylor#202915mo ago
Very very disappointed that only Apple silicon is supported! Huge letdown
Lcross🦠
Lcross🦠15mo ago
@aespeiuk is it in x86_64?
aespeiuk
aespeiuk15mo ago
mine is apple silicon arm64. but says it is not while trying to install
Lcross🦠
Lcross🦠15mo ago
I have just issued the curl command and brew commands were automatic then the export MODULAR_HOME and export PATH commands followed by modular auth [same code as the curl] and modular install mojo
aespeiuk
aespeiuk15mo ago
I'm on zsh brew which is by default on Apple silicon m series
ModularBot
ModularBot15mo ago
Congrats @aespeiuk, you just advanced to level 1!
Lcross🦠
Lcross🦠15mo ago
My brew is 4.1.16 if it helps
aespeiuk
aespeiuk15mo ago
trying to follow this
No description
Lcross🦠
Lcross🦠15mo ago
I was on developer.modular.com/download and did the right hand side It's slightly different
aespeiuk
aespeiuk15mo ago
here is the output
No description
aespeiuk
aespeiuk15mo ago
tried manual and the right pane steps and fails
Lcross🦠
Lcross🦠15mo ago
I just think you might have brew for x86_64 You can have two brews but I have two condas instead
Jack Clayton
Jack ClaytonOP15mo ago
For anyone else hitting above issue saying the arm64 architecture is required but you're on Apple Silicon: On whatever terminal you're using, right click and press Get Info then untick Open using Rosetta:
No description
fishie22
fishie2215mo ago
I am getting this error after Installing the Modular CLI modular: error: please run modular auth before attempting to install a package
Jack Clayton
Jack ClaytonOP15mo ago
@fishie22 run the command with your auth key after it on: https://developer.modular.com/download
𝐍𝐚𝐩𝐢𝐞𝐫
command not found mojo????
Jack Clayton
Jack ClaytonOP15mo ago
Run the steps up the top here: https://docs.modular.com/mojo/manual/get-started/hello-world.html Put it in your ~/.zshrc file
fishie22
fishie2215mo ago
I successfully installed the CLI using the auth key. Step 3 raises an error. Maybe a dumb question: do I not need step 3 or do I need the auth key again.
Jack Clayton
Jack ClaytonOP15mo ago
run modular auth <your-auth-key-here> first and then run modular install mojo run:
modular auth <your-auth-key-here>
modular install mojo
modular auth <your-auth-key-here>
modular install mojo
haungmickey#000
haungmickey#00015mo ago
No description
haungmickey#000
haungmickey#00015mo ago
If you are using ZSH, run the following commands: echo 'export MODULAR_HOME="/{youpath}/.modular"' >> ~/.zshrc echo 'export PATH="/Users/{youpath}/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.zshrc source ~/.zshrc
aespeiuk
aespeiuk15mo ago
is it bash used normally?
guidorice
guidorice15mo ago
macos switched to ZSH by default a few releases ago.
ModularBot
ModularBot15mo ago
Congrats @haungmickey#000, you just advanced to level 1!
Jack Clayton
Jack ClaytonOP15mo ago
@aespeiuk this is unrelated to macOS so I just created a thread here for you: https://discord.com/channels/1087530497313357884/1164597826228076678/1164597826228076678
JackCooperUsesNeovim
When I try to install on my M1 I get this error:
No description
JackCooperUsesNeovim
anyone else have anything similar?
Inspired Labs
Inspired Labs15mo ago
On Terminal.app in /Applications, when I right click and press Get Info Open using Rosetta is already unticked. So I have raised an issue on Github.
Alexander van der Werff
Still getting:: modular: The arm64 architecture is required for this software. Error: modular: An unsatisfied requirement failed this build. But Rosetta is turned off
Jack Clayton
Jack ClaytonOP15mo ago
Hi @Alexander van der Werff likely due to having intel based homebrew, see the ticket here to fix: https://github.com/modularml/mojo/issues/1078
GitHub
[Modular CLI]: Mac M1 homebrew installation fails with "The arm64 a...
Issue description I try to install the modular CLI as described in the blog: https://www.modular.com/blog/mojo-is-now-available-on-mac However, it fails with "The arm64 architecture is require...
Alexander van der Werff
Hi Jack, thanks, I was just reading the same on github and was about to try to uninstall and reinstall brew. @Jack Clayton is it required to have the command line tools for Xcode 14.3? I have Xcode 15.0.1. The first step now fails with: Error: Your Command Line Tools are too outdated. I have Xcode 15.0.1 on Ventura 13.6
Zac Bowling
Zac Bowling15mo ago
That can happen for a number of reasons but typically if something is in the middle of your connection between the client and server. Like if your network environment has a reverse proxy or some firewall setups or a captive portal for WiFi setups, etc.
JackCooperUsesNeovim
ohhh ok i think ik what it is.
Jack Clayton
Jack ClaytonOP15mo ago
@Alexander van der Werff can you try running brew doctor
Alexander van der Werff
Yes did it, I see it prints Warnings: Warning: Your Command Line Tools are too outdated. Update them from Software Update in System Settings. If that doesn't show you any updates, run: sudo rm -rf /Library/Developer/CommandLineTools sudo xcode-select --install Alternatively, manually download them from: https://developer.apple.com/download/all/. You should download the Command Line Tools for Xcode 14.3. Warning: A newer Command Line Tools release is available. Update them from Software Update in System Settings. If that doesn't show you any updates, run: sudo rm -rf /Library/Developer/CommandLineTools sudo xcode-select --install Alternatively, manually download them from: https://developer.apple.com/download/all/. You should download the Command Line Tools for Xcode 14.3. ..and some more, but I should have the Command Line Tools for Xcode 15.0.1 and brew config shows: CLT: 12.0.0.32.27 Xcode: 15.0.1 Rosetta 2: false
Jack Clayton
Jack ClaytonOP15mo ago
Oh yeah, I don't even have Xcode installed, maybe try uninstalling it:
CLT: 14.3.1.0.1.1683849156
Xcode: N/A
Rosetta 2: false
CLT: 14.3.1.0.1.1683849156
Xcode: N/A
Rosetta 2: false
You can install everything you need for brew just with:
xcode-select --install
xcode-select --install
And then I just brew install llvm
Alexander van der Werff
Right, I need Xcode though, but I see the CLT is pointing to the wrong version somehow
Jack Clayton
Jack ClaytonOP15mo ago
Have you tried uninstalling and reinstalling brew? That seems to be fixing a lot of problems for people
markolonius
markolonius15mo ago
Would there be loss of performance if used docker instead of a system (brew) install on an Apple silicon Mac? Not sure if this is the right place to ask.
Alexander van der Werff
yes I did, I had the intel version (because of previous mac), so following https://github.com/modularml/mojo/issues/1078 fixed it partly, now I need to see why brew is pointing to CLT 12.0 while I have xcode 15 installed on my machine.. probably some old left over
GitHub
[Modular CLI]: Mac M1 homebrew installation fails with "The arm64 a...
Issue description I try to install the modular CLI as described in the blog: https://www.modular.com/blog/mojo-is-now-available-on-mac However, it fails with "The arm64 architecture is require...
ModularBot
ModularBot15mo ago
Congrats @Alexander van der Werff, you just advanced to level 1!
Yeison Rodriguez
Yeison Rodriguez15mo ago
my vscode extension was not working on mac. However it got fixed when I created a new vscode workspace and reinstalled the extension
Sanchay
Sanchay15mo ago
still facing this , but the network has no proxy or anything , even connected with my phones hotspot
No description
aespeiuk
aespeiuk15mo ago
It gives all kind of issues like network and so on, where it is actually a different issue. I had a very tough time with the installation as rosetta was enabled in the options for Terminal app inside applications folder. Then I had to delete brew as it was under users and re-did it under opt. Have you tried disabling rosetta?
ModularBot
ModularBot15mo ago
Congrats @aespeiuk, you just advanced to level 3!
Alexander van der Werff
@Jack Clayton removing the CLT (sudo rm -rf /Library/Developer/CommandLineTools) and xcode-select --install did the trick
Jack Clayton
Jack ClaytonOP15mo ago
Awesome thanks heaps for letting me know, glad it’s working for you
Gio
Gio15mo ago
I'm experiencing issues with getting Mojo to recognize the Python library in my Conda environment on my 13" MacBook M2. I have modified the modular.cfg file to include the path relative to the local Python library, as specified in the documentation. However, when I import "sys" from the Mojo REPL, it doesn't seem to read the Python library properly, leading to problems later on. To be precise, the following line in my modular.cfg file defines the location of the Python library within your Conda environment:
python_lib = /Users/gio/opt/anaconda3/envs/pymojo/lib/libpython3.10.dylib
python_lib = /Users/gio/opt/anaconda3/envs/pymojo/lib/libpython3.10.dylib
It appears to be indeed the correct library path within the pymojo Conda environment:
(pymojo) ➜ ~ ls -ll /Users/gio/opt/anaconda3/envs/pymojo/lib/libpython3.10.dylib
-rwxrwxr-x 1 gio staff 3906684 Oct 22 13:53 /Users/gio/opt/anaconda3/envs/pymojo/lib/libpython3.10.dylib
(pymojo) ➜ ~ ls -ll /Users/gio/opt/anaconda3/envs/pymojo/lib/libpython3.10.dylib
-rwxrwxr-x 1 gio staff 3906684 Oct 22 13:53 /Users/gio/opt/anaconda3/envs/pymojo/lib/libpython3.10.dylib
Now, when I import the python lib from Mojo's REPL this is the error I get:
2> from python import Python
3> let sys = Python.import_module("sys")
4.
(PythonObject) sys = {
(PyObjectPtr) py_object = <parent is NULL>
}
Execution interrupted. Enter code to recover and continue.
Enter LLDB commands to investigate (type :help for assistance).
2> from python import Python
3> let sys = Python.import_module("sys")
4.
(PythonObject) sys = {
(PyObjectPtr) py_object = <parent is NULL>
}
Execution interrupted. Enter code to recover and continue.
Enter LLDB commands to investigate (type :help for assistance).
Do yo have any ideas of what might be the issue? (Interestingly when I installed Numpy on the default Python installation it worked just fine. This issue seems to be related to Conda envs)
JRX
JRX15mo ago
hi, I'm completely new to mojo, just installed it on a mac laptop and I'm trying to go through tutorials. Trying to go through the matrix multiplication example but when I try to import numpy I get this:
Traceback (most recent call last):
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/core/__init__.py", line 23, in <module>
from . import multiarray
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/core/multiarray.py", line 10, in <module>
from . import overrides
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/core/overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<string>", line 6, in <module>
File "<string>", line 25, in <module>
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/__init__.py", line 141, in <module>
from . import core
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/core/__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html
Traceback (most recent call last):
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/core/__init__.py", line 23, in <module>
from . import multiarray
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/core/multiarray.py", line 10, in <module>
from . import overrides
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/core/overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<string>", line 6, in <module>
File "<string>", line 25, in <module>
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/__init__.py", line 141, in <module>
from . import core
File "/Users/jt/.pyenv/versions/ml2/lib/python3.10/site-packages/numpy/core/__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html
I'm not fully sure what's the relationship between mojo and my system python, but it seems to be importing numpy from the virtualenv.
rdickert
rdickert15mo ago
I'm not fully sure what's the relationship between mojo and my system python, but it seems to be importing numpy from the virtualenv.
I have the same/similar question: Can I choose/activate a particular python env for mojo to work with? I normally do this in my notebooks by selecting a python kernel, but since I need to select Mojo as my kernel, the relationship is no longer clear to me @JRX the solution recommended to me for python import problems (and it did work) was to just install miniconda. Not sure if that applies to your situation, but mojo seems to find python packages after install.
GitHub
[BUG]: Importing the numpy C-extensions failed. (Macbook Pro M1) · ...
Bug description Running the command mojo matmul.mojo results in the following error output: $ mojo matmul.mojo Unhandled exception caught during execution: IMPORTANT: PLEASE READ THIS FOR ADVICE ON...
JRX
JRX15mo ago
I guess it makes sense, the trouble is that I already have pyenv installed on my system and it sounds like having both that and miniconda is asking for trouble
rdickert
rdickert15mo ago
I agree, I wasn't thrilled to add it, so up to you whether it's worth it. There also seems to be some detail in this post that I just found when I asked #mojo-bot-help - I'm going to give the a read, perhaps it will clear things up
Modular: Using Mojo🔥 with Python🐍
We are building a next-generation AI developer platform for the world. Read our latest post on how Using Mojo🔥 with Python🐍
Gio
Gio15mo ago
I used exactly that guide to set up everything . Nonetheless when I try to import any Python libraries from Mojo's REPL I get:
Execution interrupted. Enter code to recover and continue.
Enter LLDB commands to investigate (type :help for assistance.)
4> let sys = Python.import_module("sys")
(PythonObject) sys = {
(PyObjectPtr) py_object = <parent is NULL>

}
Execution interrupted. Enter code to recover and continue.
Enter LLDB commands to investigate (type :help for assistance.)
4> let sys = Python.import_module("sys")
(PythonObject) sys = {
(PyObjectPtr) py_object = <parent is NULL>

}
Jack Clayton
Jack ClaytonOP15mo ago
@Gio can you try activating your conda environment, then put this in a test.mojo and run it:
from python import Python

def main():
let sys = Python.import_module("sys")
print(sys.path)
from python import Python

def main():
let sys = Python.import_module("sys")
print(sys.path)
And if you still get an error run:
which -a python
echo $MOJO_PYTHON_LIBRARY
which -a python
echo $MOJO_PYTHON_LIBRARY
JRX
JRX15mo ago
I've tried to set up conda for myself and for python installed with conda mojo works. unfortunately for python from pyenv it doesnt 😢 ok, I managed to solve my problem. the issue comes from the fact that I had system python linked as python_lib in modular.cfg but in runtime I was using libraries from pyenv python. After setting the right python_lib mojo works well with pyenv python. I had to rebuild python with shared libraries though
nmn
nmn15mo ago
Is there a tutorial to help me integrate a mojo program within a native Mac app built with Swift?
ksandvik
ksandvik15mo ago
This is very early days of the compiler, no bindings from mojo to swift nor Apple APIs, in future...
TheMortalCoil
TheMortalCoil14mo ago
I was able to get some basic functionality in Jupyter
No description
Want results from more Discord servers?
Add your server