Intel oneAPI fails to work with Singularity

211 views
Skip to first unread message

Samy

unread,
Dec 14, 2021, 6:01:06 PM12/14/21
to singularity
Hello,

I upgraded my containers to run with intel onAPI but I'm having issues. it looks like the oneApi script breaks my singularity container  environment and runscripts.

How to set  up shell in %environment and %app (scfi) in the definition files for this scenario to work please?

Here is an example def file:
Bootstrap: localimage
From: /tmp/base.sif
%environment
source /opt/intel/oneapi/setvars.sh --force

%apprun lammps
mpirun --version
mpiexec.hydra --version
~


Here is the error when sourcing the script. I tried other ways to source the script (bash, /bin/bash) but they all failed):

oneapi.PNG

Thank you,

Samy

unread,
Dec 14, 2021, 6:03:32 PM12/14/21
to singularity, Samy

Fatih Ertinaz

unread,
Dec 14, 2021, 6:58:19 PM12/14/21
to singu...@lbl.gov, Samy
Hi

Is there a file called mpivars.sh you can source?

Fatih

--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.
To view this discussion on the web visit https://groups.google.com/a/lbl.gov/d/msgid/singularity/e52d47a5-76b9-4397-91bf-4b29209b10a6n%40lbl.gov.

smahane douyeb

unread,
Dec 14, 2021, 7:01:56 PM12/14/21
to Fatih Ertinaz, singu...@lbl.gov
I need many other libraries like mil, tbb, ICC ..

v

unread,
Dec 14, 2021, 9:49:25 PM12/14/21
to singu...@lbl.gov, Fatih Ertinaz
It’s hard to help you debug this without having the base image to work with.

Samy

unread,
Dec 15, 2021, 1:37:26 AM12/15/21
to singularity, vanessa, Fatih Ertinaz
Hello Vanessa,

This is the definition file for the base image:

BootStrap: docker  
From: intel/oneapi-runtime
Include: apt-get

%post
#####
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install apt-file -y && apt-file update
apt install -y build-essential
apt-get install -y sudo git wget #vim which tree
apt-get install -y hostname #lscpu uptime numactl
apt-get install bc -y
apt-get -y install software-properties-common

apt-get install -y libnl*



Thank you,

v

unread,
Dec 15, 2021, 2:09:43 PM12/15/21
to Samy, singularity, Fatih Ertinaz
Some quick feedback - there is no "setvars.sh" in the folder you are trying to source.

Singularity> ls /opt/intel/oneapi/
lib

Just a folder named lib.

Glenn (Gedaliah) Wolosh

unread,
Dec 15, 2021, 2:28:24 PM12/15/21
to singu...@lbl.gov
Hello,

If this is an ubuntu image it is quite possible that dash rather than bash is being used to execute setvars.sh.  You can configure the container to use bash.

In your def file for the bas image:

    echo "dash dash/sh boolean false" | debconf-set-selections
    DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash




NJIT logo
Glenn (Gedaliah) Wolosh, Ph.D.
Ass't Director Research Software and Cloud Computing
Acad & Research Computing Systems
gwo...@njit.edu • (973) 596-5437

A Top 100 National University
U.S. News & World Report





<oneapi.PNG>

Thank you,

--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

Glenn (Gedaliah) Wolosh

unread,
Dec 15, 2021, 2:50:49 PM12/15/21
to singu...@lbl.gov, Samy, Fatih Ertinaz
This is because Samy is binding /opt/intel to the container.  I assume /opt/intel has the full installation.



NJIT logo
Glenn (Gedaliah) Wolosh, Ph.D.
Ass't Director Research Software and Cloud Computing
Acad & Research Computing Systems
gwo...@njit.edu • (973) 596-5437

A Top 100 National University
U.S. News & World Report




v

unread,
Dec 15, 2021, 2:53:37 PM12/15/21
to singularity
Ah, so I'll say again... you have to provide enough for me to reproduce if I am able to help! How could I otherwise?

Glenn (Gedaliah) Wolosh

unread,
Dec 15, 2021, 2:56:41 PM12/15/21
to singu...@lbl.gov
v,

I know what you mean. I happened to have caught it in the screenshot Samy provided.

Fatih Ertinaz

unread,
Dec 15, 2021, 4:46:36 PM12/15/21
to singu...@lbl.gov
Looks like Samy pulls the wrong image.

$ docker run -it intel/oneapi-runtime bash
root@9f51d9ca772d:/# find . -iname "*vars*" -type f
./lib/init/vars.sh
./opt/intel/oneapi/lib/env/compiler_rt_vars.sh
./usr/share/perl5/Dpkg/Vars.pm
./usr/share/perl5/Dpkg/Substvars.pm
./usr/share/perl/5.26.1/vars.pm
./usr/lib/x86_64-linux-gnu/perl/5.26.1/CORE/perlvars.h
./usr/lib/x86_64-linux-gnu/perl-base/vars.pm

Apparently, there is no setvars.sh file in this image. However, if you pull the hpc version;

$ docker run -it intel/oneapi-hpckit bash

You can see that there are a lot of source files for compilers, mpi, mkl etc. Then, sourcing setvars.sh gives access to these binaries;

root@955d496c4ecd:/# source ./opt/intel/oneapi/setvars.sh
root@955d496c4ecd:/# which mpirun
/opt/intel/oneapi/mpi/2021.4.0//bin/mpirun
root@955d496c4ecd:/# which icc
/opt/intel/oneapi/compiler/2021.4.0/linux/bin/intel64/icc

Fatih

smahane douyeb

unread,
Dec 15, 2021, 5:45:33 PM12/15/21
to singu...@lbl.gov, vanessa sochat, Fatih Ertinaz
Hello @vanessa sochat and @Fatih Ertinaz ,

Sorry for the lack of details. 
I'm not using the intel one API that is installed inside the container because I couldn't get it to work.
I installed it on the host as :

Built the container. This recipe should reproduce my issue:
$ sudo singularity build lammps.sif lammps.def

$ cat lammps.def
BootStrap: docker  
From: ubuntu:20.04
%environment
source /opt/intel/oneapi/setvars.sh --force
%apprun lammps
mpirun --version
mpiexec.hydra --version
~
Run the container as:
$ singularity run --writable-tmpfs -B /opt/intel --app lammps lammps.sif

Output:
image.png

Reply all
Reply to author
Forward
0 new messages