Error in installing c-pac on MacOS Monterey with Mac M1 chip

Hi,

I want to install c-pac on an apple studio (M1 Max chip, MacOS Monterey) and I’ve encountered a wondering fault presented below. I appreciate it if anyone can help me. And I have another question, is it generally possible to install c-pac on Mac M1 Max chip?

Traceback (most recent call last):
File “/Users/majid/opt/anaconda3/bin/cpac”, line 8, in
sys.exit(run())
File “/Users/majid/opt/anaconda3/lib/python3.9/site-packages/cpac/main.py”, line 446, in run
main(parsed)
File “/Users/majid/opt/anaconda3/lib/python3.9/site-packages/cpac/main.py”, line 339, in main
Backends(**arg_vars).run(
File “/Users/majid/opt/anaconda3/lib/python3.9/site-packages/cpac/backends/init.py”, line 24, in Backends
{
File “/Users/majid/opt/anaconda3/lib/python3.9/site-packages/cpac/backends/docker.py”, line 35, in init
self._collect_config(**kwargs)
File “/Users/majid/opt/anaconda3/lib/python3.9/site-packages/cpac/backends/docker.py”, line 78, in _collect_config
kwargs = self.collect_config_bindings(self.config, **kwargs)
File “/Users/majid/opt/anaconda3/lib/python3.9/site-packages/cpac/backends/platform.py”, line 243, in collect_config_bindings
os.makedirs(inner_binding, exist_ok=True)
File “/Users/majid/opt/anaconda3/lib/python3.9/os.py”, line 251, in makedirs
mkdir(name,mode)
OSError: [Errno 30] Read-only file system: ‘/output’

Hello,

What was the command that prompted this error? If you continue to have trouble, you can try installing C-PAC with Docker or Singularity.

Best,
Steven

Hi Majid,

That error message looks like you have successfully installed cpac (Python package) but are running into a runtime issue.

OSError: [Errno 30] Read-only file system is a known issue in Docker on MacOS ≥ 10.15 for cpac (Python package).

As Steven suggested, you could try using the Docker image directly (I suspect this may hit the same issue) or try with Singularity (if you already have Singularity installed on your system, you can run with the Python package by adding the --platform singularity flag, or you can run the Singularity image directly).

If you’re able to make sense of the Linux-in-Docker-on-Mac permissions issue, please let us know!

Thanks Steven and shnizzedy,

I used docker image to process a subject that takes about 2 hours on our other intel chip computer, the process was started but has been run very slow, and after more than 12 hours it stopped.
Generally, I think the docker image is not optimized for the apple chip.

Best,
Majid

Did you update docker settings to give it sufficient RAM/CPU?

Yes, I installed the last version of Docker.

That’s good, but that is not what I asked. Docker by default will only use a limited amount of available computer resources, so you would need to change the amount of memory and resources Docker can use.

1 Like

Very well. I’ll increase the resources and then perform it again. Thanks!

Unfortunately, it does not work!

Same error? How much resources did you devote to the job?

No it did not crush but freeze in below step for three days.
I assigned 6 cores and 20 GB RAM to docker for processing a subject and now it occupies about 1 GB RAM and 17% of CPUs of our system yet.

 stderr 2022-05-27T20:05:56.836358:++ 3dTstat: AFNI version=AFNI_22.0.09 (Feb 10 2022) [64-bit]

220527-20:05:56,845 nipype.interface INFO:
stderr 2022-05-27T20:05:56.836358:++ Authored by: KR Hammett & RW Cox
220527-20:06:19,715 nipype.interface INFO:
stderr 2022-05-27T20:06:19.715187:++ Output dataset ./sub-01_task-rest_run-1_bold_calc_tshift_resample_volreg_calc_maths_tstat.nii.gz
220527-20:06:20,263 nipype.workflow INFO:
[Node] Finished “cpac_sub-01_ses-1.nuisance_regressors_defaultNoGSR_163.functional_mean”.
220527-20:06:20,281 nipype.workflow INFO:
[Node] Setting-up “cpac_sub-01_ses-1.nuisance_regressors_default_163.GlobalSignal_mean” in “/tmp/cpac_sub-01_ses-1/nuisance_regressors_default_163/_scan_rest_run-1/GlobalSignal_mean”.
220527-20:06:20,334 nipype.workflow INFO:
[Node] Running “GlobalSignal_mean” (“nipype.interfaces.afni.preprocess.ROIStats”), a CommandLine Interface with command:
3dROIstats -1Dformat -mask /tmp/cpac_sub-01_ses-1/nuisance_regressors_default_163/_scan_rest_run-1/GlobalSignal_union_masks/sub-01_task-rest_run-1_bold_calc_tshift_resample_volreg_mask_mask.nii.gz /tmp/cpac_sub-01_ses-1/_scan_rest_run-1/func_normalize_123/sub-01_task-rest_run-1_bold_calc_tshift_resample_volreg_calc_maths.nii.gz > sub-01_task-rest_run-1_bold_calc_tshift_resample_volreg_calc_maths_roistat.1D

If you’re still interested in running cpac on an M1 chip, the latest release of each of cpac (1.8.6) and C-PAC (fcpindi/c-pac:release-v1.8.6) have improvements that should help (specifically here, addressing the Docker-on-MacOS issue in cpac and upgrading Ubuntu and AFNI in C-PAC