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.
| 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 a clean environment in a slurm batch file, using module purge in your Slurm batch file.
#!/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.0cuda/12.6.3cuda/12.8.2cuda/13.3.0
