Platform R: Environment Modules

 

Environment Modules provide a way to dynamically modify your shell environment ($PATH, $LD_LIBRARY_PATH, etc.) so you can load and unload different software packages and versions on demand without editing your shell startup files by hand or worrying about conflicts between versions.

Module Commands
Command Description
module avail List all available modules.
module list Show currently loaded modules.
module load <name> Load a module
(for example, module load cuda/12.4).
module unload <name> Unload previously loaded module.
module swap <old> <new> Replace one loaded module with another.
module show <name> Show what a module changes in your environment.
module whatis <name> Show the one-line description of a module.
module purge Unload every currently loaded module.
module help <name> Show the module's help text

Local Platform R modules have been written to prevent version conflicts for the same software. You are not able to accidentally load two different CUDA versions at the same time, for example.

Interactive Workflow

# See what is available 
module avail

# Load the version you need 
module load cuda/12.6.3

# Confirm it is active 
module list

# When finished, clean up 
module purge (or module unload cuda)

Slurm Batch Workflow

It's cleaner to start with an empty environment in a Slurm batch file, using module purge to prevent your batch file from inheriting any interactive environment changes, and then stating explicitly what modules you need.

#!/bin/bash
#SBATCH --partition=gpu
#SBATCH --job-name=cuda-job
#SBATCH --gres=gpu:1
#SBATCH --time=01:00:00

# Start from a clean environment for reproducibility
module purge

# Load the toolkit version your code was built against
module load cuda/12.6.3

# Run your application
srun my_cuda_program

Local Modules

Currently Platform R only has modules for supporting different versions of CUDA. These are only available on the login node and nodes with GPUs.

  • cuda/11.8.0
  • cuda/12.6.3
  • cuda/12.8.2
  • cuda/13.3.0


Keywords:
platform r, environment
Doc ID:
161907
Owned by:
William A. in SMPH Research Applications
Created:
2026-06-11
Updated:
2026-08-21
Sites:
SMPH Research Applications