Version for MacOS with Apple M1 processor?

Moderators: Site Moderators, FAHC Science Team

Sara4711
Posts: 9
Joined: Fri Nov 20, 2020 4:59 pm

Version for MacOS with Apple M1 processor?

Post by Sara4711 »

Hi I have been using Folding at Home for some time but now that I purchased a new MacBook Air with the new Apple M1 processor it does not seem to work. Is this something that can be fixed easily or do I have to wait for a new version of Folding at Home?
Joe_H
Site Admin
Posts: 7867
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Version for MacOS with Apple M1 processor?

Post by Joe_H »

Welcome to the folding support forum.

There has been some discussion about this in another topic - viewtopic.php?f=16&t=36425. It then veers into discussion about the GPU provided as part of the M1.

My guess is if the emulation available through the Rosetta 2 translator is not able to handle the F@h client, then a new version will be needed. No idea when that might happen.

Can you provide any details on how the client fails to work?
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Sara4711
Posts: 9
Joined: Fri Nov 20, 2020 4:59 pm

Re: Version for MacOS with Apple M1 processor?

Post by Sara4711 »

Thans,

I will check that thread. I got my new MacBook Air with the M1 chip yesterday.

The client starts up but says

"Client: local Connecting Inactive"

It stays like that indefinately. Is there any logfile I can look in?
Sara4711
Posts: 9
Joined: Fri Nov 20, 2020 4:59 pm

Re: Version for MacOS with Apple M1 processor?

Post by Sara4711 »

I tried de deinstall and then install again and now I can´t start up the FAHControl at all. The web interface indicate says that I am using CPU 7 and it is ready but it does not seem like anythong is actually processed.

There is however a FAHClient process running in the computer that is consuming a small amount if CPU time.
Joe_H
Site Admin
Posts: 7867
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Version for MacOS with Apple M1 processor?

Post by Joe_H »

Log files along with other files related to running the F@h client are located in /Library/Application Support/FAHClient. The client apps are installed into a folder under Applications called Folding@home.

FAHControl and the Web Control connect with the background FAHClient process using port 36330 on the local network IP 127.0.0.1. Personally I am nowhere near running the most recent OS, Big Sur, so am not familiar with any issues that may come from changes in default security settings for the OS or Safari using Web Control.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Sara4711
Posts: 9
Joined: Fri Nov 20, 2020 4:59 pm

Re: Version for MacOS with Apple M1 processor?

Post by Sara4711 »

This is what can be found in the log. It repeats

19:39:52:WU00:FS00:Starting
ESC[93m19:39:52:WARNING:WU00:FS00:AS lowered CPUs from 7 to 3ESC[0m
19:39:52:WU00:FS00:Running FahCore: /usr/local/bin/FAHCoreWrapper "/Library/Application Support/FAHClient/cores/cores.foldingathome.org/osx/64bit-avx-256/a7-0.0.19/Core_a7.fah/FahCore_a7" -dir 00 -suffix 01 -version 706 -lifeline 5405 -checkpoint 15 -np 3
19:39:52:WU00:FS00:Started FahCore on PID 6291
19:39:52:WU00:FS00:Core PID:6292
19:39:52:WU00:FS00:FahCore 0xa7 started
19:39:53:WU00:FS00:FahCore returned: INTERRUPTED (102 = 0x66)
Joe_H
Site Admin
Posts: 7867
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Version for MacOS with Apple M1 processor?

Post by Joe_H »

Okay, that looks like where the problem with actually processing a WU might be. The client and server appear to be detecting the M1 as supporting AVX instructions, but my cursory look at what the Rosetta 2 emulation supports is just up to SSE 4.2. So it appears the wrong folding core was downloaded and installed for use. I could be wrong here, it has been a while since I did much digging through developer documentation on the Apple site, so quite likely have missed something.

On another bit, could you post the first 100 or so lines of the log file. That would at least let us see how the client detects the hardware and software when it starts up. That may give some clues for future development.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Sara4711
Posts: 9
Joined: Fri Nov 20, 2020 4:59 pm

Re: Version for MacOS with Apple M1 processor?

Post by Sara4711 »

Code: Select all

*********************** Log Started 2020-11-20T18:59:43Z ***********************
18:59:43:******************************* libFAH ********************************
18:59:43:       Date: Oct 20 2020
18:59:43:       Time: 13:36:42
18:59:43:   Revision: 5ca109d295a6245e2a2f590b3d0085ad5e567aeb
18:59:43:     Branch: master
18:59:43:   Compiler: GNU 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.8)
18:59:43:    Options: -std=c++11 -fsigned-char -O3 -funroll-loops
18:59:43:             -mmacosx-version-min=10.7 -Wno-unused-local-typedefs -stdlib=libc++
18:59:43:   Platform: darwin 19.2.0
18:59:43:       Bits: 64
18:59:43:       Mode: Release
18:59:43:****************************** FAHClient ******************************
18:59:43:    Version: 7.6.21
18:59:43:     Author: Joseph Coffland <joseph@cauldrondevelopment.com>
18:59:43:  Copyright: 2020 foldingathome.org
18:59:43:   Homepage: https://foldingathome.org/
18:59:43:       Date: Oct 20 2020
18:59:43:       Time: 13:39:56
18:59:43:   Revision: 6efbf0e138e22d3963e6a291f78dcb9c6422a278
18:59:43:     Branch: master
18:59:43:   Compiler: GNU 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.8)
18:59:43:    Options: -std=c++11 -fsigned-char -O3 -funroll-loops
18:59:43:             -mmacosx-version-min=10.7 -Wno-unused-local-typedefs -stdlib=libc++
18:59:43:   Platform: darwin 19.2.0
18:59:43:       Bits: 64
18:59:43:       Mode: Release
18:59:43:     Config: /Library/Application Support/FAHClient/config.xml
18:59:43:******************************** CBang ********************************
18:59:43:       Date: Oct 20 2020
18:59:43:       Time: 11:39:07
18:59:43:   Revision: 7e4ce85225d7eaeb775e87c31740181ca603de60
18:59:43:     Branch: master
18:59:43:   Compiler: GNU 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.8)
18:59:43:    Options: -std=c++11 -fsigned-char -O3 -funroll-loops
18:59:43:             -mmacosx-version-min=10.7 -Wno-unused-local-typedefs -stdlib=libc++
18:59:43:             -fPIC
18:59:43:   Platform: darwin 19.2.0
18:59:43:       Bits: 64
18:59:43:       Mode: Release
18:59:43:******************************* System ********************************
18:59:43:        CPU: VirtualApple @ 2.50GHz
18:59:43:     CPU ID: GenuineIntel Family 6 Model 44 Stepping 0
18:59:43:       CPUs: 8
18:59:43:     Memory: 16.00GiB
18:59:43:Free Memory: 108.08MiB
18:59:43:    Threads: POSIX_THREADS
18:59:43: OS Version: 10.16
18:59:43:Has Battery: true
18:59:43: On Battery: false
18:59:43: UTC Offset: 1
18:59:43:        PID: 5405
18:59:43:        CWD: /Library/Application Support/FAHClient
18:59:43:         OS: Darwin 20.2.0 x86_64
18:59:43:    OS Arch: AMD64
18:59:43:       GPUs: 1
18:59:43:      GPU 0: Bus:0 Slot:0 Func:0 AMD:5 Hawaii [Radeon R9 200 Series]
18:59:43:       CUDA: Not detected: Failed to open dynamic library 'libcuda.dylib':
18:59:43:             dlopen(libcuda.dylib, 1): no suitable image found. Did find:
18:59:43:               file system relative paths not allowed in hardened programs
18:59:43:     OpenCL: Not detected: Failed to open dynamic library 'libOpenCL.dylib':
18:59:43:             dlopen(libOpenCL.dylib, 1): no suitable image found. Did find:
18:59:43:               file system relative paths not allowed in hardened programs
18:59:43:***********************************************************************
18:59:43:<config>
18:59:43:  <!-- Folding Slot Configuration -->
18:59:43:  <cause v='COVID_19'/>
18:59:43:
18:59:43:  <!-- Network -->
18:59:43:  <proxy v=':8080'/>
18:59:43:
18:59:43:  <!-- Slot Control -->
18:59:43:  <power v='MEDIUM'/>
18:59:43:
18:59:43:  <!-- User Information -->
18:59:43:  <passkey v='*****'/>
18:59:43:  <team v='37451'/>
18:59:43:  <user v='Sara4711'/>
18:59:43:
18:59:43:  <!-- Folding Slots -->
18:59:43:  <slot id='0' type='CPU'/>
18:59:43:</config>
18:59:43:Trying to access database...
18:59:43:Successfully acquired database lock
18:59:43:FS00:Initialized folding slot 00: cpu:7
18:59:43:WU00:FS00:Starting
ESC[93m18:59:43:WARNING:WU00:FS00:AS lowered CPUs from 7 to 3ESC[0m
18:59:43:WU00:FS00:Running FahCore: /usr/local/bin/FAHCoreWrapper "/Library/Application Support/FAHClient/cores/cores.foldingathome.org/osx/64bit-avx-256/a7-0.0.19/Core_a7.fah/FahCore_a7" -dir 00 -suffix 01 -version 706 -lifeline 5405 -checkpoint 15 -np 3
18:59:43:WU00:FS00:Started FahCore on PID 5406
18:59:43:WU00:FS00:Core PID:5407
18:59:43:WU00:FS00:FahCore 0xa7 started
18:59:44:WU00:FS00:FahCore returned: INTERRUPTED (102 = 0x66)

And then it continues like that
Last edited by Joe_H on Fri Nov 20, 2020 10:28 pm, edited 1 time in total.
Reason: added Code tags to log
Joe_H
Site Admin
Posts: 7867
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Version for MacOS with Apple M1 processor?

Post by Joe_H »

Thanks for posting the log. From the CPU ID shown in the log, Intel Family 6 Model 44 Stepping 0, the Rosetta 2 emulation is of a family of Core i/Xeon processors from about 9-10 years ago. SSE 4.2 was the highest level of instruction support, AVX was added to the next generation of Intel chips.

Potentially the current client or server code could be updated so it properly detected the CPU and downloaded the non-AVX version of the core which should run. Or it might run into other issues. Not sure of the rest of the network communication issues between the client process and Web Control or FAHControl, not many reports yet on running the client on Intel Mac's running Big Sur.

So for now it looks like the Apple M1 will not be usable, it may take a while for it to be added to the supported hardware. Whether they will be coming out with a native version or just adapting the current client I don't have an idea on yet.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
calxalot
Site Moderator
Posts: 883
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Version for MacOS with Apple M1 processor?

Post by calxalot »

Interesting that it almost runs as-is.
Does FAHViewer run?
Sara4711
Posts: 9
Joined: Fri Nov 20, 2020 4:59 pm

Re: Version for MacOS with Apple M1 processor?

Post by Sara4711 »

Yes it runs but it can of course nor show any data being processed sine none is processed.
Sara4711
Posts: 9
Joined: Fri Nov 20, 2020 4:59 pm

Re: Version for MacOS with Apple M1 processor?

Post by Sara4711 »

Found the following on the apple page

What Can't Be Translated?
Rosetta can translate most Intel-based apps, including apps that contain just-in-time (JIT) compilers. However, Rosetta doesn’t translate the following executables:
  • Kernel extensions
  • Virtual Machine apps that virtualize x86_64 computer platforms
Rosetta translates all x86_64 instructions, but it doesn’t support the execution of some newer instruction sets and processor features, such as AVX, AVX2, and AVX512 vector instructions. If you include these newer instructions in your code, execute them only after verifying that they are available. For example, to determine if AVX512 vector instructions are available, use the sysctlbyname function to check the hw.optional.avx512f attribute.
Last edited by Sara4711 on Sat Nov 21, 2020 12:20 am, edited 2 times in total.
Sara4711
Posts: 9
Joined: Fri Nov 20, 2020 4:59 pm

Re: Version for MacOS with Apple M1 processor?

Post by Sara4711 »

Found the following also:

Porting your macOS apps to Apple Silicon
https://developer.apple.com/documentati ... le_silicon

Building a Universal macOS Binary
https://developer.apple.com/documentati ... cos_binary
Sara4711
Posts: 9
Joined: Fri Nov 20, 2020 4:59 pm

Re: Version for MacOS with Apple M1 processor?

Post by Sara4711 »

Joe_H wrote:Thanks for posting the log. From the CPU ID shown in the log, Intel Family 6 Model 44 Stepping 0, the Rosetta 2 emulation is of a family of Core i/Xeon processors from about 9-10 years ago. SSE 4.2 was the highest level of instruction support, AVX was added to the next generation of Intel chips.

Potentially the current client or server code could be updated so it properly detected the CPU and downloaded the non-AVX version of the core which should run. Or it might run into other issues. Not sure of the rest of the network communication issues between the client process and Web Control or FAHControl, not many reports yet on running the client on Intel Mac's running Big Sur.

So for now it looks like the Apple M1 will not be usable, it may take a while for it to be added to the supported hardware. Whether they will be coming out with a native version or just adapting the current client I don't have an idea on yet.
Before I was running the M1 MacBook I was running on a Intel based MacBook that was also running Big Sur and that worked so I think the issues is only related to the fact that the M1 CPU has to run Rosetta 2. So with a none-AVX version of the code it might run correctly.
JimboPalmer
Posts: 2573
Joined: Mon Feb 16, 2009 4:12 am
Location: Greenwood MS USA

Re: Version for MacOS with Apple M1 processor?

Post by JimboPalmer »

Sara4711 wrote:So with a non-AVX version of the code it might run correctly.
The M1 version of ARM does not necessarily emulate SSE2 fast enough to complete WUs.

Ideally, some one with deep pockets and intimate knowledge of the M1 would aid development.
Tsar of all the Rushers
I tried to remain childlike, all I achieved was childish.
A friend to those who want no friends
Post Reply