Skip to content

OMP: Error #13: Assertion failure at kmp_affinity.cpp(981). #133158

Open
@kjobson-neuro

Description

@kjobson-neuro

I am compiling a Docker container to run neuroimaging software. When I execute one of my commands to use FSL, the above error occurs. I will include my Dockerfile below that I use to compile the container. Happy to provide more information, I am not a programmer and do not really understand what is happening here or what info would be most helpful. I do not have this issue on Linux OS.

MacOS: 15.3.2 (24D81)
Docker v4.39.0
Command causing the error: fslmerge -t ${workdir}/all_data.nii.gz $m0_file $asl_file

ARG TARGETARCH

FROM --platform=linux/amd64 ubuntu:jammy

Download stages

Utilities for downloading packages

RUN apt-get update &&
apt-get install -y --no-install-recommends
binutils
bzip2
ca-certificates
curl
unzip &&
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

FreeSurfer 7.3.2

COPY freesurfer7.3-exclude.txt /usr/local/etc/freesurfer7.3-exclude.txt
RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.2/freesurfer-linux-ubuntu22_amd64-7.3.2.tar.gz
| tar zxv --no-same-owner -C /opt --exclude-from=/usr/local/etc/freesurfer7.3-exclude.txt

ANTs 2.5.3

Old ANTs code, save in case new doesn't work

RUN mkdir /opt/ants &&
curl -fsSL https://github.com/ANTsX/ANTs/releases/download/v2.4.3/ants-2.4.3-centos7-X64-gcc.zip -o ants.zip &&
unzip ants.zip -d /opt &&
rm ants.zip

ENV FSLDIR="/opt/fsl-6.0.7.1"
PATH="/opt/fsl-6.0.7.1/bin:$PATH"
FSLOUTPUTTYPE="NIFTI_GZ"
FSLMULTIFILEQUIT="TRUE"
FSLTCLSH="/opt/fsl-6.0.7.1/bin/fsltclsh"
FSLWISH="/opt/fsl-6.0.7.1/bin/fslwish"
FSLLOCKDIR=""
FSLMACHINELIST=""
FSLREMOTECALL=""
FSLGECUDAQ="cuda.q"
RUN apt-get update -qq
&& apt-get install -y -q --no-install-recommends
bc
ca-certificates
curl
dc
file
libfontconfig1
libfreetype6
libgl1-mesa-dev
libgl1-mesa-dri \
libglu1-mesa-dev
libice6
libopenblas-base
libxcursor1
libxft2
libxinerama1
libxrandr2
libxrender1
libxt6
nano
python3
sudo
wget
&& rm -rf /var/lib/apt/lists/*
&& echo "Installing FSL ..."
&& curl -fsSL https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py | python3 - -d /opt/fsl-6.0.7.1 -V 6.0.7.1

Main stage

Create the FW environment

ENV FLYWHEEL=/flywheel/v0
RUN mkdir -p ${FLYWHEEL}

WORKDIR ${FLYWHEEL}

Configure APT

ENV DEBIAN_FRONTEND="noninteractive"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

RUN apt-get update &&
apt-get install -y --no-install-recommends
ca-certificates
curl
gnupg &&
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Configure PPAs for libpng12 and libxp6

RUN GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/linuxuprising.gpg --recv 0xEA8CACC073C3DB2A
&& GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/zeehio.gpg --recv 0xA1301338A3A48C4A
&& echo "deb [signed-by=/usr/share/keyrings/linuxuprising.gpg] https://ppa.launchpadcontent.net/linuxuprising/libpng12/ubuntu jammy main" > /etc/apt/sources.list.d/linuxuprising.list
&& echo "deb [signed-by=/usr/share/keyrings/zeehio.gpg] https://ppa.launchpadcontent.net/zeehio/libxp/ubuntu jammy main" > /etc/apt/sources.list.d/zeehio.list

Simulate SetUpFreeSurfer.sh

ENV OS="Linux"
FS_OVERRIDE=0
FIX_VERTEX_AREA=""
FSF_OUTPUT_FORMAT="nii.gz"
FREESURFER_HOME="/opt/freesurfer"
FSLDIR="/opt/fsl-6.0.7.1/"
ENV SUBJECTS_DIR="$FREESURFER_HOME/subjects"
FUNCTIONALS_DIR="$FREESURFER_HOME/sessions"
MNI_DIR="$FREESURFER_HOME/mni"
LOCAL_DIR="$FREESURFER_HOME/local"
MINC_BIN_DIR="$FREESURFER_HOME/mni/bin"
MINC_LIB_DIR="$FREESURFER_HOME/mni/lib"
MNI_DATAPATH="$FREESURFER_HOME/mni/data"
ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5"
MNI_PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5"
PATH="$FREESURFER_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH"

ANTs config

ENV ANTSPATH="/opt/ants-2.4.3/bin"
PATH="$ANTSPATH:$PATH"

FSL environment

ENV LANG="C.UTF-8"
LC_ALL="C.UTF-8"
LC_NUMERIC="en_US.UTF-8"
PYTHONNOUSERSITE=1
FSLDIR="/opt/fsl-6.0.7.1"
FSLOUTPUTTYPE="NIFTI_GZ"
FSLMULTIFILEQUIT="TRUE"
FSLLOCKDIR=""
FSLMACHINELIST=""
FSLREMOTECALL=""
FSLGECUDAQ="cuda.q"
PATH="/opt/fsl-6.0.7.1/bin:$PATH"
LD_LIBRARY_PATH=""

Unless otherwise specified each process should only use one thread - nipype

will handle parallelization

ENV MKL_NUM_THREADS=1
OMP_NUM_THREADS=1

#################
RUN apt-get update &&
apt-get install -y --no-install-recommends
binutils
bzip2
ca-certificates
curl
python3
python3-pip
zip
jq
gnupg
lsb-release
netbase
pipx
dcm2niix
libc6-amd64-cross
bsdmainutils
unzip &&
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Installing and setting up python packages

RUN pipx ensurepath
RUN pipx install numpy
&& pipx install scipy --include-deps
&& pipx install nibabel
&& pipx install matplotlib --include-deps
&& pipx install transforms3d --include-deps
&& pipx install flywheel-sdk --include-deps
&& pip3 install aspose-words

Copy stuff over & change permissions

COPY ./input/ ${FLYWHEEL}/input/
COPY ./workflows/ ${FLYWHEEL}/workflows/
COPY ./pipeline_singlePLD.sh ${FLYWHEEL}/
RUN chmod -R 777 ${FLYWHEEL}

Configure entrypoints-

ENTRYPOINT ["/bin/bash", "/flywheel/v0/pipeline_singlePLD.sh"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions