calab-ntu / gpu-cluster

Eureka and Spock GPU clusters
3 stars 0 forks source link

Support module in eureka #34

Closed xuanweishan closed 11 months ago

xuanweishan commented 2 years ago

Referenct: https://modules.readthedocs.io/en/latest/module.html

xuanweishan commented 2 years ago

Steps of installing Module:

  1. Check necessary packages.
    1. yum list tcl-devel (>=8.5)
  2. Install module
    1. Download module and unzip the file
      curl -LJO https://github.com/cea-hpc/modules/releases/download/v5.1.1/modules-5.1.1.tar.gz
      tar xfz modules-5.1.1.tar.gz
    2. Create directory for module files
      mkdir /software/modulefiles
    3. Install module
      cd modules-5.1.1
      make clean
      ./configure --modulefilesdir=/software/modulefiles
      make
      make install
  3. configure
    cp [module path]/init/profile.sh /etc/profile.d/modules.sh
    cp [module path]/init/profile.csh /etc/profile.d/modules.csh
    source [module path]/init/bash
xuanweishan commented 2 years ago

Creating modulfiles (example):

#%Module1.0#

## Change library path to different version
remove-path LD_LIBRARY_PATH [origin_version_path]
append-path LD_LIBRARY_PATH [version_want_to_load]

## Change the command 
set-alias [command] command1

Usage:

xuanweishan commented 2 years ago

Modulefiles in Taiwania Template:

#%Module1.0
##
## Modulename [modulename]
##

proc ModulesHelp {} {
  puts stderr "/tAdd CUDA 10.2 to your environment variables"
}
module-whatis "\tAdd CUDA 10.2 to your environment variables"

remove-path LD_LIBRARY_PATH /software/cuda/default/lib64 --append-on-unload

set          version         10.2
set          root            /software/cuda/10.2
prepend-path PATH            $root/bin
prepend-path LD_LIBRARY_PATH $root/lib64
prepend-path MANPATH         $root/doc/man
setenv       CUDA_PATH       $root
setenv       CUDA_HOME       $root

family       "cuda"
## module within the same family will automatically set as conflict 

## optional
always-load [dependence package]
xuanweishan commented 2 years ago

Default version setting

  1. make modulefiles for different versions in a directory
  2. create .version file in the directory with following content
    #%Module1.0
    set ModulesVersion "[default version]"
xuanweishan commented 1 year ago

Procedure: