Setup Intel One API framework on MacOS - how to decrease the loading time of conda when I do "source /opt/intel/oneapi/setvars.sh"

Viewed 260

I am on MacOS 11.3 Big Sur and I use the framework OneAPI from Intel.

To load all the environment variables, I put into my ~/.zshrc :

source /opt/intel/oneapi/setvars.sh

Before I used Conda of OneAPI, the time for launching a new Terminal and get the prompt was acceptable (2-3 seconds).

But since I use Conda of OneAPI, it takes a time very long to launch and get the prompt (at least 10 seconds): it is very annoying.

I tried to use a config file for setvars.sh sourcing:

source /opt/intel/oneapi/setvars.sh --config="/opt/intel/oneapi/config_setvars.txt" > /dev/null

with config_setvars.txt:

default=exclude
mkl=latest
idp=latest

But it takes still too much time (~ 8 seconds) to get the prompt of a launched terminal.

Is there a way to activate conda (and environment variables associated) with the file sourced setvars.sh or by modifying config_setvars.txt ?

Indeed, to know if conda is activated or not, I did a simple shell function:

function isconda() {
 answer=$(echo $CONDA_DEFAULT_ENV)
 if [ -z "$answer" ];
   then print "NO CONDA ACTIVATED"
   else
   print "YES CONDA ACTIVATED"
 fi
}

I do not have anaconda or miniconda and I wouldn't like to install them.

Here is my ~/.condarc:

auto_activate_base: false
auto_update_conda: false
channels:
  - conda-forge
  - https://conda.anaconda.org/intel/osx-64
  - https://conda.anaconda.org/jdblischak/osx-64
  - defaults
channel_priority: flexible

I suspect that sourcing /opt/intel/oneapi/setvars.sh calls all the environments, especially conda and that's why it takes a long time to load everything: how to prevent to load all these environments ?

I don't know what to do now, how can I get the prompt more quickly when I launch a new terminal on iTerm2?

Update

(1) I realize that since I am using Conda from Intel OneAPI, I have no more python Intel:

$ python
Python 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 15:59:12)
[Clang 11.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(.startup.py)

Is it normal?

(2) when I do a ls command into ls /opt/intel/oneapi/intelpython/python3.7 , I get a bunch of files:

extract_packages_ipy.sh
condainstall.py
ReleaseNotes.txt
setup_scripts
generate_urlstxt.sh
shell
envs
libexec
etc
var
fonts
man
sbin
share
env
licensing
include
sys_check
lib
ssl
pkgs
bin
conda-meta
condabin

Does this bunch of files cause the long time to load all intelpython libraries located in /opt/intel/oneapi/intelpython/python3.7?

Indeed, when I perform the sourcing of setvars.sh, the largest elapsed time is taken at the level of intelpython library, so I wonder if my issue could come from this.

Moreover, sourcing the following file takes a long time :

source /opt/intel/oneapi/intelpython/python3.7/env/vars.sh

Is there a relation?

0 Answers
Related