Skip to content
Snippets Groups Projects
04-simple-test-source-torch1.13.1-rocm5.2.3.sh 903 B
Newer Older
  • Learn to ignore specific revisions
  • Milan Jaros's avatar
    Milan Jaros committed
    #!/bin/bash -e
    
    # Source: Tools in action by Samuel Antao (AMD)
    # Contribution: M. Jaros (IT4Innovations)
    
    wd=$(pwd)
    
    #
    # Example assume allocation was created, e.g.:
    # N=1 ; salloc -p standard-g  --threads-per-core 1 --exclusive -N $N --gpus $((N*8)) -t 4:00:00 --mem 0
    #
    
    module purge
    module load CrayEnv
    module load PrgEnv-cray/8.3.3
    module load craype-accel-amd-gfx90a
    
    # Default ROCm – more recent versions are preferable (e.g. ROCm 5.6.0).
    module load rocm/5.2.3.lua
    
    set -x
    
    # check dependencies
    if [ ! -d $wd/miniconda3/envs/pytorch-from-source ] ; then
        echo "use 04-install-source-torch1.13.1-rocm5.2.3.sh"
        exit 1
    else
        source $wd/miniconda3/bin/activate pytorch-from-source
    fi
    
    # Make sure conda libs can be loaded.
    export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH 
    
    
    Milan Jaros's avatar
    Milan Jaros committed
        python -c 'import torch; print("I have this many devices:", torch.cuda.device_count())'