1212
1313set -eu -o pipefail
1414
15- # Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu
15+ # `man apt.conf`:
16+ # Number of retries to perform. If this is non-zero APT will retry
17+ # failed files the given number of times.
18+ echo ' Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
19+
20+ # Ref.: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/native-install/ubuntu.html
21+
22+ # Make the directory if it doesn't exist yet.
23+ # This location is recommended by the distribution maintainers.
24+ sudo mkdir --parents --mode=0755 /etc/apt/keyrings
25+
26+ # Download the key, convert the signing-key to a full
27+ # keyring required by apt and store in the keyring directory
28+ wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
29+ gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
30+
1631curl -O https://repo.radeon.com/rocm/rocm.gpg.key
1732sudo apt-key add rocm.gpg.key
18- echo " deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-debian} / ubuntu main" \
19- | sudo tee /etc/apt/sources.list.d/rocm.list
2033
34+ source /etc/os-release # set UBUNTU_CODENAME: focal or jammy or ...
35+
36+ VERSION=${1-6.3.2}
37+
38+ echo " deb [arch=amd64] https://repo.radeon.com/rocm/apt/${VERSION} ${UBUNTU_CODENAME} main" \
39+ | sudo tee /etc/apt/sources.list.d/rocm.list
2140echo ' export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' \
2241 | sudo tee -a /etc/profile.d/rocm.sh
42+
2343# we should not need to export HIP_PATH=/opt/rocm/hip with those installs
2444
45+ sudo apt-get clean
2546sudo apt-get update
2647
2748# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#installing-development-packages-for-cross-compilation
@@ -34,14 +55,16 @@ sudo apt-get install -y --no-install-recommends \
3455 libnuma-dev \
3556 libopenmpi-dev \
3657 openmpi-bin \
37- rocm-dev \
38- roctracer-dev \
39- rocprofiler-dev \
40- rocrand-dev \
41- rocprim-dev \
42- rocfft \
43- rocprim \
44- rocrand
58+ rocm-dev${VERSION} \
59+ roctracer-dev${VERSION} \
60+ rocprofiler-dev${VERSION} \
61+ rocrand-dev${VERSION} \
62+ rocfft-dev${VERSION} \
63+ rocprim-dev${VERSION} \
64+ rocsparse-dev${VERSION}
65+
66+ # hiprand-dev is a new package that does not exist in old versions
67+ sudo apt-get install -y --no-install-recommends hiprand-dev${VERSION} || true
4568
4669# activate
4770#
@@ -50,9 +73,4 @@ hipcc --version
5073hipconfig --full
5174which clang
5275which clang++
53-
54- # cmake-easyinstall
55- #
56- sudo curl -L -o /usr/local/bin/cmake-easyinstall https://git.io/JvLxY
57- sudo chmod a+x /usr/local/bin/cmake-easyinstall
58- export CEI_SUDO=" sudo"
76+ which flang
0 commit comments