QSIPrep-Installation issues on HPC

Summary of what happened:

I’m new to the use of QSIPrep and I’m having major trouble installing QSIPrep using a cluster. It seems that the cluster can’t get the QSIPrep image because of network issues. I’m not sure if it’s possible to get the image locally now using docker, turn it into a singularity image, and then upload it to the cluster?

Command used (and if a helper script was used, a link to the helper script or the command generated):

module load /public/software/modules/tools/singularity/4.1.4
singularity build qsiprep-1.0.0.sif docker://pennlinc/qsiprep:1.0.0

Version:

qsiprep-1.0.0

Environment (Docker, Singularity / Apptainer, custom installation):

singularity/4.1.4

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

INFO:    Starting build...
INFO:    Fetching OCI image...
FATAL:   While performing build: conveyor failed to get: Get "https://index.docker.io/v2/": dial tcp 108.160.172.204:443: i/o timeout

Screenshots / relevant information:

Best,
YJia


I’ve probably finished downloading the qsiprep-1.0.0.sif image, and I’ve replaced it with other available image sources with the following commands:

singularity build qsiprep-1.0.0.sif docker://swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/pennlinc/qsiprep:latest

The following are the (partial) results of the image download after this command is executed:

===============================================================] 100 % 14.7 MiB/s 0s
155.8MiB / 155.8MiB [=============================================================================================================================================================================] 100 % 14.7 MiB/s 0s
111.2MiB / 111.2MiB [=============================================================================================================================================================================] 100 % 14.7 MiB/s 0s
87.3MiB / 87.3MiB [===============================================================================================================================================================================] 100 % 14.7 MiB/s 0s
199.1MiB / 199.1MiB [=============================================================================================================================================================================] 100 % 14.7 MiB/s 0s
INFO:    Extracting OCI image...
INFO:    Inserting Singularity configuration...
INFO:    Creating SIF file...
INFO:    Build complete: qsiprep-1.0.0.sif

After acquiring the image, I would like to test if QSIPrep is available using some prepared test data. The data I prepared is shown below with the root directory dMRI and the root directory for the BIDs data QSI.
image

I tried to define my own slurm script by referring to the posts of experienced QSIPrep users within the forum (QSIPrep Optimal Compute Resources):

#!/bin/bash
#SBATCH -J QSI
#SBATCH -p bme_cpu
#SBATCH --mail-type=fail
#SBATCH -o  QSI.out
#SBATCH -e  QSI.err
#SBATCH --mem=50G
#SBATCH -N 1
#SBATCH --time=24:00:00

module load /public/software/modules/tools/singularity/3.5.2
#module load /public/software/modules/tools/singularity/4.1.4

bids_dir=/public_bme2/bme-zhanghan/Jiayifan/dMRI/QSI
participant=S01
RESOLUTION=2
WORKDIR=/public_bme2/bme-zhanghan/Jiayifan/dMRI/work

# QSIPrep call
singularity run -e  \
    -B $bids_dir/derivatives:/derivatives:ro \
    -B $bids_dir/derivatives:/out \
    -B ${WORKDIR}:${WORKDIR} \
    -B /public_bme2/bme-zhanghan/Jiayifan/license.txt:/opt/freesurfer/license.txt \
    /public_bme2/bme-zhanghan/Jiayifan/dMRI/qsiprep-1.0.0.sif \
    /derivatives/nii /out participant \
    --fs-license-file /opt/freesurfer/license.txt \
    --output-resolution ${RESOLUTION} \
    --work-dir ${WORKDIR} \
    -v -v

But it didn’t run correctly and reported the following error:

INFO:    Mounting image with FUSE.
e[91mERROR  : Failed to create user namespace: user namespace disabled
e[0m

I also tried to refer to the posts of other experienced QSIPrep users I could find (Using QSIprep on Cheaha - Civitan International Neuroimaging Laboratory) and the modified script is as follows:

···
cd /public_bme2/bme-zhanghan/Jiayifan/dMRI

# run qsiprep
singularity run qsiprep-1.0.0.sif --participant_label $participant \
   --fs_license_file /public_bme2/bme-zhanghan/Jiayifan/license.txt \
    -v \
    --separate_all_dwis \
    --output_resolution 1.2 \
    --skip_bids_validation \
    $bids_dir \
    $bids_dir/derivatives \
    participant

The error is the same as the result of the last script run.

I’m not sure what went wrong, very much looking forward to your reply!
Best,
YJia

Hi @YJia and welcome to neurostars!

Not directly related to the error you listed, but it looks like you are missing the accompanying DWI json, so that may prevent you from running QSIPrep.

I would start with the earlier versino of the script you did, since that had the proper -e and -B flags for singularity run.

However,

This is an issue. 1) You shouldn’t bind a directory as two different things in the container. 2) The first positional argument for qsiprep is the BIDS root directory, not a derivatives directory.

Now for the error you mentioned:

This sounds like it is something specific to your compute cluster. You can try to add the --userns flag to your singularity run preamble, but more likely you should get in contact with your cluster manager to see if they can enable user namespaces, or if there is a way to run singularity in a privileged mode.

Best,
Steven