# Can I run FEniCSx in Apple silicon M3 max?

**URL:** <https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211>\
**Category:** installation\
**Tags:** conda, mac\
**Created:** [January 4, 2024, 1:59am UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211 "2024-01-04T01:59:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yankang\_Liu](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/yankang_liu/32/5392_2.png) [@Yankang\_Liu](https://fenicsproject.discourse.group/u/Yankang_Liu)\
**Post date:** [January 4, 2024, 1:59am UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211/1 "2024-01-04T01:59:23Z")

</div>

Hello I am using a MacBook pro with m3 max chip wishing to have a better performance. I am using vs code and jupyter notebook in anaconda. I download FEniCSx package using the way on [this page](https://fenicsproject.org/download/). But as I run `import dolfinx.fem`, the kernel crashed in both vscode and jupyter. I wonder what’s wrong. Here’s a screenshot if I run it in terminal

 ![1](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/1/11cc0ec90b54c119ff1ce7f0fac8d5a610f74632.png)

It looks something wrong with PETSC?

---

<div class="post-metadata">

**Author:** ![Yankang\_Liu](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/yankang_liu/32/5392_2.png) [@Yankang\_Liu](https://fenicsproject.discourse.group/u/Yankang_Liu)\
**Post date:** [January 4, 2024, 10:14pm UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211/2 "2024-01-04T22:14:56Z")

</div>

It turned out that migration from my old MacBook to this new one was the issue. The old one was from 2015 and really out of date. I solved this issue by erase everything in the new MacBook and set it up by hand, not use migration.

For a comparison, my old is 2.8GHz quad-core i7 MacBook pro mid 2015. The new one is 16 inch M3 max. For 10-iteration run time around 70s in my old device, it can take maybe a little less than 30s, not a huge improvement for me though.

I want to ask which platform you guys use, is linux more commonly used for heavy calculations, did you use parallel so two or more points can be ran at the same time? Since I am going to run for different parameters and in each parameter setting I have to adjust initial guess to get a convergence result. So a lot of running to do. The more efficient the more desired.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [January 5, 2024, 2:30am UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211/3 "2024-01-05T02:30:42Z")

</div>

> [@Yankang\_Liu](#):
>
> I want to ask which platform you guys use, is linux more commonly used for heavy calculations, did you use parallel so two or more points can be ran at the same time? Since I am going to run for different parameters and in each parameter setting I have to adjust initial guess to get a convergence result. So a lot of running to do. The more efficient the more desired.

Several core developers use Mac in their development.  
Most hpc clusters (which one use for really large problems) are Linux based.

Without having an example at hand, its hard to give guidance as to what can improve run-times of your code. Some things are mentioned in  
[https://jsdokken.com/dolfinx-tutorial/chapter4/compiler\_parameters.html](https://jsdokken.com/dolfinx-tutorial/chapter4/compiler_parameters.html)  
[http://jsdokken.com/FEniCS23-tutorial/src/form\_compilation.html](http://jsdokken.com/FEniCS23-tutorial/src/form_compilation.html)  
but there are plenty of other things to optimize as well.

---

<div class="post-metadata">

**Author:** ![Yankang\_Liu](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/yankang_liu/32/5392_2.png) [@Yankang\_Liu](https://fenicsproject.discourse.group/u/Yankang_Liu)\
**Post date:** [January 8, 2024, 8:01pm UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211/4 "2024-01-08T20:01:34Z")

</div>

> [@dokken](#):
>
> [Form compilation — FEniCS Tutorial @ Sorbonne](http://jsdokken.com/FEniCS23-tutorial/src/form_compilation.html)

Thank you very much! Your comments really gave me a picture.

---

<div class="post-metadata">

**Author:** ![ml7903](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@ml7903](https://fenicsproject.discourse.group/u/ml7903)\
**Post date:** [February 13, 2024, 7:54pm UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211/5 "2024-02-13T19:54:49Z")

</div>

Hello,

I wanted to ask how you were able to fix the migration issue to the M3 silicon chip. My dolfinx module does not import correctly and the kernel fails each time. I am wondering which lines you used in terminal to fix the issue when you downloaded the fenicsx modules. Thank you!

---

<div class="post-metadata">

**Author:** ![Yankang\_Liu](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/yankang_liu/32/5392_2.png) [@Yankang\_Liu](https://fenicsproject.discourse.group/u/Yankang_Liu)\
**Post date:** [February 13, 2024, 11:31pm UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211/6 "2024-02-13T23:31:15Z")

</div>

Hello can you also screenshot the error message? I just run the code on the [Download web page](https://fenicsproject.org/download/) of fenicsx. This is like an integrated installation. They packed everything and it will install every missing parts including some preliminaries like python. If install each library one by one, that would be more complicated for me.

---

<div class="post-metadata">

**Author:** ![ml7903](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@ml7903](https://fenicsproject.discourse.group/u/ml7903)\
**Post date:** [February 14, 2024, 4:52pm UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211/7 "2024-02-14T16:52:13Z")

</div>

Hi,

Yes, I have the screenshot below. When I run these other lines below there is no issue:

import numpy as np  
import matplotlib.pyplot as plt  
import basix  
import ffcx  
import ufl  
import pyvista  
import mpi4py

When I try to import dolfinx using `import dolfinx` I get this message:  
 ![Screenshot 2024-02-14 at 11.49.43 AM](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/0/0862267699c6c0c2da3cd90d3177489e596285f1.png)

Thank you!

---

<div class="post-metadata">

**Author:** ![Yankang\_Liu](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/yankang_liu/32/5392_2.png) [@Yankang\_Liu](https://fenicsproject.discourse.group/u/Yankang_Liu)\
**Post date:** [February 15, 2024, 12:21am UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211/8 "2024-02-15T00:21:10Z")

</div>

Did you follow exactly the instruction above to install it? Did you install in some other ways? The issue I had was because I transfer files from my old laptop to the new one and bug occured. So I wiped out the new laptop and installed everything by myself and it was fixed.

---

<div class="post-metadata">

**Author:** ![ml7903](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@ml7903](https://fenicsproject.discourse.group/u/ml7903)\
**Post date:** [February 15, 2024, 8:26pm UTC](https://fenicsproject.discourse.group/t/can-i-run-fenicsx-in-apple-silicon-m3-max/13211/9 "2024-02-15T20:26:44Z")

</div>

Hi,

Yes, I followed the steps exactly. Understood, it seems the migration would be the root cause of the issue then because of existing files. Thank you!
