Folding@Home on M4 Mac Mini - 0 GPU cores?

Moderators: Site Moderators, FAHC Science Team

Post Reply
kasdashdfjsah
Posts: 16
Joined: Tue Dec 26, 2023 5:58 pm

Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by kasdashdfjsah »

Just installed Folding@Home on my brand new M4 Mac Mini, with 10 CPU and 10 GPU cores.

The 10 CPU cores work fine, but in the Folding@home client, it says 0 GPU cores, even though this should say 10.

Compared to Windows, and or Intel Macs do the CPU and GPU cores of the Apple Silicon ARM chips work together on 1 project, cause there does not seem to be an option to have only the CPU or only the GPU fold, like there is on Windows?

Hope somebody can help me out with this 0 GPU cores issue.
calxalot
Site Moderator
Posts: 1273
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by calxalot »

GPU folding is not supported on macOS.
kasdashdfjsah
Posts: 16
Joined: Tue Dec 26, 2023 5:58 pm

Re: Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by kasdashdfjsah »

calxalot wrote: Sat Dec 21, 2024 11:06 pm GPU folding is not supported on macOS.
Any estimate on when it will be supported?
PaulTV
Posts: 223
Joined: Mon Jan 25, 2021 4:53 pm
Location: Netherlands

Re: Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by PaulTV »

The GPU folding cores support OpenCL for all GPUs and CUDA cores for Nvidia specifically. Apple does not provide (working) OpenCL support in their driver stack. GROMACS, which is the underlying mechanism used by the folding cores, added Mac GPU support (see https://manual.gromacs.org/2024.2/relea ... ility.html), but (if this suffices for F@h) it'll require work to add and test this with folding cores; no idea if that's on the roadmap.

So there is progress, but I don't think there's any (public) ETA.
Image

Ryzen 9800X3D / RTX 4090 / Windows 11
Ryzen 5600X / RTX 3070 Ti / Ubuntu 22.04
Ryzen 5600 / RTX 3060 Ti / Windows 11
kasdashdfjsah
Posts: 16
Joined: Tue Dec 26, 2023 5:58 pm

Re: Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by kasdashdfjsah »

Thanks for the detailed response, I appreciate it.
Joe_H
Site Admin
Posts: 7986
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: Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by Joe_H »

I would just add a correction, Apple at one time had broken OpenCL support in the OS. That was reported by F@h and other computing projects, after about 2 years or so Apple did release fixed OpenCL support. This was about 10 years ago. By that point almost all of the older GPUs Apple had included in systems were no longer supported by F@h. Most Apple systems by that point either used Intel iGPUs for video that were not supported by F@h or were sold in small numbers - Mac Pros. Older Mac Pros could have a supported card installed, but that was not counted on as being common.

Also at some point in the last decade Apple deprecated use of OpenCL in favor of Metal. OpenCL is still supported and available, including on the Apple M-series GPUs but not the CPUs, but there have been a few bugs in some recent OS versions. Apple has not given any clear end date for OpenCL support. Metal is not supported at this time in OpenMM which the GPU folding cores are based on, I don''t know if there are any plans to add support. The uncertain status of OpenCL also is not the most conducive towards adding a port of the GPU folding cores to run on macOS. I do recall mention that some researcher had done a quick and dirty test to fold using OpenMM on a Mac system they had and it worked after the OpenCL bug fix, but that is the most I ever heard. That was on an Intel Mac, and I don't recall if they did further testing.
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: 1273
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by calxalot »

OpenMM supports OpenCL on Apple silicon, but as far as I know nobody has tried building and testing a fahcore using it. Further complication is that the client currently scans the pci bus for gpus. The Apple silicon GPU is not a pci device. So another method is needed to detect and whitelist such gpus.
calxalot
Site Moderator
Posts: 1273
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by calxalot »

There is a Metal plugin for OpenMM, but development stopped when the expected performance increase over OpenCL did not appear.
kasdashdfjsah
Posts: 16
Joined: Tue Dec 26, 2023 5:58 pm

Re: Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by kasdashdfjsah »

Update

If I set my CPU core count utilization to only 4, matching my 4 performance cores, it is actually faster than using both my 4 P cores and 6 E cores together, I just learned of this, even though it makes no sense to me, it works.
Joe_H
Site Admin
Posts: 7986
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: Folding@Home on M4 Mac Mini - 0 GPU cores?

Post by Joe_H »

Yeah, that is one of the recommendations calxalot and I will usually make to use just as many threads as there are performance cores. The way a WU is divided up into multiple threads for processing involves a reconciliation step between the threads to account for forces between atoms in adjacent partitions. So processing gets limited by the slower threads. I understand some work is being done to make the underlying GROMACS code utilize mixed speed processing better, but that is not currently available.

Same issue shows up with processing F@h WUs on recent Intel processors with a mix of performance and economy cores. Depending on version of Windows processes for F@h may not stick to performance cores.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Post Reply