|
3 | 3 |
|
4 | 4 | set -eou pipefail |
5 | 5 |
|
6 | | -<<<<<<< HEAD |
7 | | -# Magma build scripts need `python` |
8 | | -ln -sf /usr/bin/python3 /usr/bin/python |
9 | | - |
10 | | -ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') |
11 | | -case "$ID" in |
12 | | - almalinux) |
13 | | - yum install -y gcc-gfortran |
14 | | - ;; |
15 | | - *) |
16 | | - echo "No preinstalls to build magma..." |
17 | | - ;; |
18 | | -esac |
19 | | - |
20 | | -MKLROOT=${MKLROOT:-/opt/conda/envs/py_$ANACONDA_PYTHON_VERSION} |
21 | | - |
22 | | -# "install" hipMAGMA into /opt/rocm/magma by copying after build |
23 | | -if [[ $(ver $ROCM_VERSION) -ge $(ver 7.0) ]]; then |
24 | | - git clone https://github.com/ROCm/utk-magma.git -b release/2.9.0_rocm70 magma |
25 | | - pushd magma |
26 | | - # version 2.9 + ROCm 7.0 related updates |
27 | | - git checkout 91c4f720a17e842b364e9de41edeef76995eb9ad |
28 | | -else |
29 | | - git clone https://bitbucket.org/icl/magma.git |
30 | | - pushd magma |
31 | | - # Version 2.7.2 + ROCm related updates |
32 | | - git checkout a1625ff4d9bc362906bd01f805dbbe12612953f6 |
33 | | -fi |
34 | | - |
35 | | -cp make.inc-examples/make.inc.hip-gcc-mkl make.inc |
36 | | -echo 'LIBDIR += -L$(MKLROOT)/lib' >> make.inc |
37 | | -if [[ -f "${MKLROOT}/lib/libmkl_core.a" ]]; then |
38 | | - echo 'LIB = -Wl,--start-group -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -lpthread -lstdc++ -lm -lgomp -lhipblas -lhipsparse' >> make.inc |
39 | | -fi |
40 | | -echo 'LIB += -Wl,--enable-new-dtags -Wl,--rpath,/opt/rocm/lib -Wl,--rpath,$(MKLROOT)/lib -Wl,--rpath,/opt/rocm/magma/lib -ldl' >> make.inc |
41 | | -echo 'DEVCCFLAGS += --gpu-max-threads-per-block=256' >> make.inc |
42 | | -export PATH="${PATH}:/opt/rocm/bin" |
43 | | -if [[ -n "$PYTORCH_ROCM_ARCH" ]]; then |
44 | | - amdgpu_targets=`echo $PYTORCH_ROCM_ARCH | sed 's/;/ /g'` |
45 | | -else |
46 | | - amdgpu_targets=`rocm_agent_enumerator | grep -v gfx000 | sort -u | xargs` |
47 | | -fi |
48 | | -for arch in $amdgpu_targets; do |
49 | | - echo "DEVCCFLAGS += --offload-arch=$arch" >> make.inc |
50 | | -done |
51 | | -# hipcc with openmp flag may cause isnan() on __device__ not to be found; depending on context, compiler may attempt to match with host definition |
52 | | -sed -i 's/^FOPENMP/#FOPENMP/g' make.inc |
53 | | -make -f make.gen.hipMAGMA -j $(nproc) |
54 | | -LANG=C.UTF-8 make lib/libmagma.so -j $(nproc) MKLROOT="${MKLROOT}" |
55 | | -make testing/testing_dgemm -j $(nproc) MKLROOT="${MKLROOT}" |
56 | | -popd |
57 | | -mv magma /opt/rocm |
58 | | -======= |
59 | 6 | function do_install() { |
60 | 7 | rocm_version=$1 |
61 | 8 | if [[ ${rocm_version} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then |
@@ -88,4 +35,3 @@ function do_install() { |
88 | 35 | } |
89 | 36 |
|
90 | 37 | do_install $1 |
91 | | ->>>>>>> 7ea396715b ([rocm7.1_internal_testing][SWDEV-554101] Fix bad merge of install_rocm_magma.sh (#2651)) |
0 commit comments