forked from pelagos-consulting/HIP_Course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv
49 lines (38 loc) · 1.43 KB
/
env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#/bin/bash
if [[ $HOSTNAME =~ "setonix" ]]
then
module load rocm/5.2.3 cmake/3.24.3 craype-accel-amd-gfx90a omnitrace/1.10.2 omniperf/1.0.6
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${ROCM_PATH}/lib:${ROCM_PATH}/llvm/lib
export LIBRARY_PATH=$LIBRARY_PATH:${ROCM_PATH}/lib:${ROCM_PATH}/llvm/lib
# Extra flags to enable GPU support
MPICH_GPU_SUPPORT_ENABLED=1
export HIP_PLATFORM=amd
export GPU_ARCH=gfx90a
else
# Load crucial modules
module load gcc rocm mpich
# Try to load cuda and use that as the deciding factor
if module load cuda 2>/dev/null; then
# We are using the nvidia backend
export HIP_PLATFORM=nvidia
# CUDA architectures to support
export GPU_ARCH="60;61;70;75;80;86;89;90"
else
# We are using the AMD backend
export HIP_PLATFORM=amd
# HIP architectures to support
export GPU_ARCH="gfx906;gfx908;gfx90a;gfx1035"
fi
fi
# Get the directory that this file is located in
COURSE_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Set the installation directory
INSTALL_DIR=$COURSE_DIR/install
# Set the runtime directory -- don't edit this one
RUN_DIR=$INSTALL_DIR/bin
# Add RUN_DIR to the path
export PATH=$PATH:$RUN_DIR
# Set the build type, options are DEBUG, COVERAGE, PROFILE, RELEASE
export BUILD_TYPE=RELEASE
# Force HIP compiler to accept -fPIC and -fopenmp
export HIPFLAGS="-fPIC -fopenmp"