Working with Modules

Modules manage software environments on the cluster.

Note

All module names and versions are examples, be sure to use module spider and module avail to check what’s actually available on each cluster.

What are Modules?

Modules load software packages and their dependencies into your environment without permanent changes.

Basic Commands

# List available modules
module avail

# List loaded modules
module list

# Load a module
module load python

# Unload a module
module unload python

# Show module details
module show python

# Search for a module
module spider python

# Unload all modules and start fresh
module purge

Loading specific versions

With Lmod, you can load specific versions of software by suffixing it with /<version. Users should avoid specifying versions for software they intend to run. it can be helpful, however, to specify the version of software you’ve built against.

Example
# list available versions
ml av intel-oneapi-compilers

---- /apps/spack-managed/modulefiles/linux-rocky9-x86_64/Core -----
   intel-oneapi-compilers/2022.0.2
   intel-oneapi-compilers/2022.2.1 (D)
   intel-oneapi-compilers/2023.1.0
   intel-oneapi-compilers/2023.2.4
   intel-oneapi-compilers/2024.1.0

# now select a version
module load intel-oneapi-compilers/2024.1.0

Common Software

Python

module load python
python --version

R

module load r
R

Compilers

module load gcc intel

CUDA (GPU Clusters Only)

CUDA is only available on GPU clusters (Ptolemy, Atlas, Morrill):

module load cuda
nvcc --version
module load cuda
nvcc --version
module load cuda
nvcc --version

Cluster-Specific Software

Some software packages are only available on specific clusters:

GPU-specific modules:

  • cuda - NVIDIA CUDA toolkit

  • cudnn - CUDA Deep Neural Network library

  • nccl8 - NVIDIA Collective Communications Library

  • pytorch - PyTorch with GPU support

GPU-specific modules:

  • cuda - NVIDIA CUDA toolkit

  • cudnn - CUDA Deep Neural Network library

  • tensorflow2 - TensorFlow with GPU support

  • pytorch - PyTorch with GPU support

GPU-specific modules:

  • cuda - NVIDIA CUDA toolkit

  • cudnn - CUDA Deep Neural Network library

  • pytorch - PyTorch with GPU support

CPU-optimized modules:

  • openblas3 - Optimized BLAS library

  • fftw0 - FFT library

  • hypre6.0 - Parallel linear system solver

CPU-optimized modules:

  • openblas3 - Optimized BLAS library

  • fftw0 - FFT library

  • intel-mkl - Intel Math Kernel Library

Module Collections

Save and restore module sets:

# Save current modules
module save myproject

# Restore later
module restore myproject

# List saved collections
module savelist

# Remove a collection
module rm myproject

Finding Software

# Search for a package
module spider python

# Show dependencies
module display python

# Find which module provides a command
module whatis python

Common Issues

Module Not Found

# Check available versions
module avail python

# Try different version
module load python

# Refresh module cache
module purge
module avail

Conflicting Modules

# Unload conflicting module first
module unload old-python
module load new-python

# Or unload all and reload
module purge
module load python

Environment Not Updating

# Refresh shell
source ~/.bashrc

# Or start new shell
bash

CUDA Module Not Found on GPU Cluster

# Make sure you're on a GPU node
# Check your partition
sinfo --partition=<valid_gpu_partition>

# Load CUDA on GPU clusters only
# (not available on Orion or Hercules)
module load cuda