The Lmod environment module system can be used to access some software on the CoE HPC cluster and on CoE linux hosts in general. This may include software that is not in your default executable path, or complex software that have multiple dependencies. Modules also provides a means to access different versions of software, say older versions of software than the default that you may require (e.g. Matlab 2022a or Cuda 10.2), or newer versions of software not provided by the operating system (e.g. Python 3.x or Cmake 3.x or GCC 5.x or higher). Here are some examples on how to use Lmod:

 

View available modules

To see which software is currently available as a module, type:

module avail
-or-
module av

Too view currently available python modules:

module av python

To search for available gcc modules:

module spider gcc

 

Load modules

To load a module so you can use the software, type:

module load {software}/{version}

For example, to load python version 3.10 and confirm its source and version, do:

module load python/3.10
which python
python --version

Or to load the default (often the latest) python module:

module load python
which python
python --version

To load multiple modules, e.g. the default version of cmake, gcc 9.3 and cuda 11.1 and confirm their versions:

module load cmake gcc/9.3 cuda/11.1
cmake --version
gcc --version
nvcc --version

To list currently loaded modules:

module list
-or-
ml

Note that if you use one or more software modules to build another software, then you may need to make sure those same modules are loaded whenever you run that other software.  For example, if you used cuda/11.3 and gcc/9.3 to build pytorch in your python environment, make sure to load cuda/11.3 and gcc/9.3 whenever you want to run pytorch.

 

Unload, replace or purge modules

To unload a currently loaded module, type:

module unload {software}/{version}
-or-
module unload {software}

For example, to unload a gcc module, do:

module unload gcc

To replace a currently loaded cuda module, say with 12.2, do:

module load cuda/12.2

To purge or unload all currently loaded modules:

module purge

 

 

For more information on Lmod, visit the site below:

https://lmod.readthedocs.io/en/latest