# Does GROMACS supports GPU acceleration on M1 Mac？

**URL:** <https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466>\
**Category:** User discussions\
**Tags:** gpu\
**Created:** [January 12, 2022, 10:27am UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466 "2022-01-12T10:27:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirakiral](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@kirakiral](https://gromacs.bioexcel.eu/u/kirakiral)\
**Post date:** [January 12, 2022, 10:27am UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/1 "2022-01-12T10:27:17Z")

</div>

GROMACS version:2021.4  
GROMACS modification: No  
I have installed the GROMACS 2021.4 on my Macbook with M1, OpenCL supported. However it seems the GPU is not supported.  
The log shows:

> Running on 1 node with total 8 cores, 8 logical cores, 0 compatible GPUs  
> Hardware detected:  
> CPU info:  
> Vendor: ARM  
> Brand: Unknown CPU brand  
> Family: 0 Model: 0 Stepping: 0  
> Features: neon neon\_asimd  
> Hardware topology: Only logical processor count  
> GPU info:  
> Number of GPUs detected: 1  
> #0: name: Apple M1 Pro, vendor: Apple, device version: OpenCL 1.2 , status: incompatible

Is this means the GPU acceletate doesn’t support M1?

---

<div class="post-metadata">

**Author:** ![pszilard](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pszilard/32/21_2.png) [@pszilard](https://gromacs.bioexcel.eu/u/pszilard)\
**Post date:** [January 17, 2022, 5:22pm UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/2 "2022-01-17T17:22:18Z")

</div>

No it is not supported. You can try to see if it works at all by setting the `GMX_GPU_DISABLE_COMPATIBILITY_CHECK` environment variable which disables the compatibility check. Let us know what you find!  
If that seems to work, do make sure that you run extensive tests before you proceed to use the GPU.

---

<div class="post-metadata">

**Author:** ![tianyishi](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@tianyishi](https://gromacs.bioexcel.eu/u/tianyishi)\
**Post date:** [June 10, 2022, 10:01pm UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/5 "2022-06-10T22:01:25Z")

</div>

Thank you! After setting `GMX_GPU_DISABLE_COMPATIBILITY_CHECK=1` and with a OpenCL-enabled build, GROMACS is indeed able to find and utilize the GPU in M1 chip.

---

<div class="post-metadata">

**Author:** ![pszilard](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pszilard/32/21_2.png) [@pszilard](https://gromacs.bioexcel.eu/u/pszilard)\
**Post date:** [June 14, 2022, 6:21pm UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/6 "2022-06-14T18:21:49Z")

</div>

Can you please report back whether tests pass and everything seems to run correctly?

---

<div class="post-metadata">

**Author:** ![tpduy](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@tpduy](https://gromacs.bioexcel.eu/u/tpduy)\
**Post date:** [June 15, 2022, 2:40am UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/7 "2022-06-15T02:40:14Z")

</div>

Hi there,  
I did install yesterday and `make check` passed all the test 100%

```auto
100% tests passed, 0 tests failed out of 90

Label Time Summary:
GTest = 117.59 sec*proc (83 tests)
IntegrationTest = 45.68 sec*proc (27 tests)
MpiTest = 30.27 sec*proc (21 tests)
SlowTest = 29.23 sec*proc (13 tests)
UnitTest = 42.68 sec*proc (43 tests)

Total Test time (real) = 701.14 sec
[100%] Built target run-ctest-nophys
[100%] Built target check

```

cmake command I used:

```auto
CC=/opt/homebrew/bin/mpicc CXX=/opt/homebrew/bin/mpic++ cmake ../ -DCMAKE_INSTALL_PREFIX=/Users/duy/soft/gromacs -DGMX_FFT_LIBRARY=fftw3 -DGMX_MPI=ON -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=OpenCL

```

Compiler: GNU, opencl, libomp from homebrew

Version: 2022.1

This is the benchmarking for M1 Pro

```auto
Particles Speed (ns/day)
214305 5.546
77788 14.677

```

Enjoy MDs

---

<div class="post-metadata">

**Author:** ![pszilard](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pszilard/32/21_2.png) [@pszilard](https://gromacs.bioexcel.eu/u/pszilard)\
**Post date:** [June 15, 2022, 4:53pm UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/8 "2022-06-15T16:53:22Z")

</div>

Hi,

Thanks for the feedback. Note however that running just `make check` will not use the GPU, you need to disable the compatibility check as you did for `mdrun`. Do the tests still pass if you run `GMX_GPU_DISABLE_COMPATIBILITY_CHECK=1 make check`?

Cheers,  
Szilárd

---

<div class="post-metadata">

**Author:** ![tpduy](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@tpduy](https://gromacs.bioexcel.eu/u/tpduy)\
**Post date:** [June 18, 2022, 12:49am UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/9 "2022-06-18T00:49:50Z")

</div>

Hi.  
For me it passed.

---

<div class="post-metadata">

**Author:** ![teonexone](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@teonexone](https://gromacs.bioexcel.eu/u/teonexone)\
**Post date:** [May 18, 2023, 10:48am UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/10 "2023-05-18T10:48:23Z")

</div>

Hi,  
I have installed Gromacs 2023.1 on a Mac M1 Pro using Homebrew.  
Do you know if it is possible to enable GPU support with this type of installation?  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [May 18, 2023, 12:05pm UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/11 "2023-05-18T12:05:56Z")

</div>

I’m not an expert on Mac things, but judging by the [Homebrew formula for GROMACS](https://github.com/Homebrew/homebrew-core/blob/86eb54b86321d26cff15fcd8f9c1368a595d507b/Formula/gromacs.rb), no, it does not support OpenCL.

You will have to compile GROMACS yourself with `-DGMX_GPU=OpenCL`.

---

<div class="post-metadata">

**Author:** ![teonexone](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@teonexone](https://gromacs.bioexcel.eu/u/teonexone)\
**Post date:** [May 18, 2023, 12:42pm UTC](https://gromacs.bioexcel.eu/t/does-gromacs-supports-gpu-acceleration-on-m1-mac/3466/12 "2023-05-18T12:42:59Z")

</div>

Thank you so much!
