Apple Silicon version of PsychoPy

The current version of PsychoPy is using Rosetta 2 on M1 Macs. With some hacks it is possible to create an Apple Silicon native version of PsychoPy for M1 Macs using pip. This version is highly experimental and not yet everything works. The Apple Silicon version runs a lot faster than the Intel version. Hopefully an official M1 native Mac version of PsychoPy will be released in the near future.

Instructions how to get pip install psychopy working for M1 Macs can be found here:
https://github.com/waltervanheuven/psychopy_on_M1.

sysinfo.py output:

System info:
macOS-11.5.2-arm64-arm-64bit
macOS 11.5.2 running on arm64

Python info
/Users/waltervh/venv/psychopy/bin/python3.9
3.9.7 (default, Sep  3 2021, 04:31:11) 
[Clang 12.0.5 (clang-1205.0.22.9)]
numpy 1.21.2
scipy 1.7.1
matplotlib 3.4.3
pyglet 1.5.19
pyo 1.0.4

PsychoPy 2021.2.3
have shaders: True

OpenGL info:
vendor: Apple
rendering engine: Apple M1
OpenGL version: 2.1 Metal - 71.7.1
(Selected) Extensions:
     True GL_ARB_multitexture
     True GL_EXT_framebuffer_object
     True GL_ARB_fragment_program
     True GL_ARB_shader_objects
     True GL_ARB_vertex_shader
     True GL_ARB_texture_non_power_of_two
     True GL_ARB_texture_float
     False GL_STEREO
    max vertices in vertex array: 1048575
3 Likes

Very cool Walter. I just assumed that this wouldn’t be possible until all the underlying libs (there are many) were all converted to M1 native. If it’s actually possible to use M1-native Python and combine with Intel dylibs for some of the packages then we could be in business

All underlying libs are now M1-native. clock.py needs a patch and there is an issue with psychtoolbox, details can be found here. Thus, PsychoPy runs completely M1 native. I have not yet done extensive testing but the several PsychoPy experiments with audio and video that I tested worked well.

Alternatively, it is possible to run PsychoPy native on M1 using a Docker container (running Ubuntu for M1). Instructions can be found here. This option is still work in progress. Passing audio through to macOS is tricky and graphics not as smooth as running it native on macOS.

I’m thinking about libs like supporting hardware options (eyetrackers etc.). When we’ve switched Python versions in the past the main issue has been around waiting for hardware manufacturers to update their dylibs

Yes, those are not yet native. Hopefully, hardware manufacturers will update their dylibs soon.

Apple Silicon Update.

PsychoPy version 2022.1.1 is running well. It requires a patch for clock.py in order to get correct timings as well as a patch for pyo. Unfortunately, microphone and eyetracking components are not yet working. Installation instructions can be found here.

1 Like