Compare commits

...

1 Commits

Author SHA1 Message Date
David Galiffi
debfa72f1f Create submodules to the ROCm 6.1.2 components.
- Synced to rocm-6.1.2.
- Saved to the ./libs folder
- Add a script to help update submodules when the next version
of ROCm is released. Saved in ./tools/submodules
- Update README to remove `repo` instructions and add
`git submodule` instructions.

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
2024-06-11 22:43:37 -04:00
60 changed files with 382 additions and 28 deletions

171
.gitmodules vendored Normal file
View File

@@ -0,0 +1,171 @@
[submodule "libs/ROCK-Kernel-Driver"]
path = libs/ROCK-Kernel-Driver
url = ../ROCK-Kernel-Driver
[submodule "libs/ROCT-Thunk-Interface"]
path = libs/ROCT-Thunk-Interface
url = ../ROCT-Thunk-Interface
[submodule "libs/ROCR-Runtime"]
path = libs/ROCR-Runtime
url = ../ROCR-Runtime
[submodule "libs/amdsmi"]
path = libs/amdsmi
url = ../amdsmi
[submodule "libs/rocm_smi_lib"]
path = libs/rocm_smi_lib
url = ../rocm_smi_lib
[submodule "libs/rocm-core"]
path = libs/rocm-core
url = ../rocm-core
[submodule "libs/rocm-cmake"]
path = libs/rocm-cmake
url = ../rocm-cmake
[submodule "libs/rocminfo"]
path = libs/rocminfo
url = ../rocminfo
[submodule "libs/rocm_bandwidth_test"]
path = libs/rocm_bandwidth_test
url = ../rocm_bandwidth_test
[submodule "libs/rocprofiler"]
path = libs/rocprofiler
url = ../rocprofiler
[submodule "libs/roctracer"]
path = libs/roctracer
url = ../roctracer
[submodule "libs/clang-ocl"]
path = libs/clang-ocl
url = ../clang-ocl
[submodule "libs/rdc"]
path = libs/rdc
url = ../rdc
[submodule "libs/HIP"]
path = libs/HIP
url = ../HIP
[submodule "libs/HIP-Examples"]
path = libs/HIP-Examples
url = ../HIP-Examples
[submodule "libs/clr"]
path = libs/clr
url = ../clr
[submodule "libs/hipother"]
path = libs/hipother
url = ../hipother
[submodule "libs/HIPIFY"]
path = libs/HIPIFY
url = ../HIPIFY
[submodule "libs/HIPCC"]
path = libs/HIPCC
url = ../HIPCC
[submodule "libs/llvm-project"]
path = libs/llvm-project
url = ../llvm-project
[submodule "libs/ROCm-Device-Libs"]
path = libs/ROCm-Device-Libs
url = ../ROCm-Device-Libs
[submodule "libs/ROCm-CompilerSupport"]
path = libs/ROCm-CompilerSupport
url = ../ROCm-CompilerSupport
[submodule "libs/half"]
path = libs/half
url = ../half
[submodule "libs/ROCgdb"]
path = libs/ROCgdb
url = ../ROCgdb
[submodule "libs/ROCdbgapi"]
path = libs/ROCdbgapi
url = ../ROCdbgapi
[submodule "libs/rocr_debug_agent"]
path = libs/rocr_debug_agent
url = ../rocr_debug_agent
[submodule "libs/rocBLAS"]
path = libs/rocBLAS
url = ../rocBLAS
[submodule "libs/Tensile"]
path = libs/Tensile
url = ../Tensile
[submodule "libs/hipTensor"]
path = libs/hipTensor
url = ../hipTensor
[submodule "libs/hipBLAS"]
path = libs/hipBLAS
url = ../hipBLAS
[submodule "libs/hipBLASLt"]
path = libs/hipBLASLt
url = ../hipBLASLt
[submodule "libs/rocFFT"]
path = libs/rocFFT
url = ../rocFFT
[submodule "libs/hipFFT"]
path = libs/hipFFT
url = ../hipFFT
[submodule "libs/rocRAND"]
path = libs/rocRAND
url = ../rocRAND
[submodule "libs/hipRAND"]
path = libs/hipRAND
url = ../hipRAND
[submodule "libs/rocSPARSE"]
path = libs/rocSPARSE
url = ../rocSPARSE
[submodule "libs/hipSPARSELt"]
path = libs/hipSPARSELt
url = ../hipSPARSELt
[submodule "libs/rocSOLVER"]
path = libs/rocSOLVER
url = ../rocSOLVER
[submodule "libs/hipSOLVER"]
path = libs/hipSOLVER
url = ../hipSOLVER
[submodule "libs/hipSPARSE"]
path = libs/hipSPARSE
url = ../hipSPARSE
[submodule "libs/rocALUTION"]
path = libs/rocALUTION
url = ../rocALUTION
[submodule "libs/rocThrust"]
path = libs/rocThrust
url = ../rocThrust
[submodule "libs/hipCUB"]
path = libs/hipCUB
url = ../hipCUB
[submodule "libs/rocPRIM"]
path = libs/rocPRIM
url = ../rocPRIM
[submodule "libs/rocWMMA"]
path = libs/rocWMMA
url = ../rocWMMA
[submodule "libs/rccl"]
path = libs/rccl
url = ../rccl
[submodule "libs/MIOpen"]
path = libs/MIOpen
url = ../MIOpen
[submodule "libs/composable_kernel"]
path = libs/composable_kernel
url = ../composable_kernel
[submodule "libs/MIVisionX"]
path = libs/MIVisionX
url = ../MIVisionX
[submodule "libs/rpp"]
path = libs/rpp
url = ../rpp
[submodule "libs/hipfort"]
path = libs/hipfort
url = ../hipfort
[submodule "libs/AMDMIGraphX"]
path = libs/AMDMIGraphX
url = ../AMDMIGraphX
[submodule "libs/ROCmValidationSuite"]
path = libs/ROCmValidationSuite
url = ../ROCmValidationSuite
[submodule "libs/openmp-extras/aomp"]
path = libs/openmp-extras/aomp
url = ../aomp
[submodule "libs/openmp-extras/aomp-extras"]
path = libs/openmp-extras/aomp-extras
url = ../aomp-extras
[submodule "libs/openmp-extras/flang"]
path = libs/openmp-extras/flang
url = ../flang
[submodule "libs/rocDecode"]
path = libs/rocDecode
url = ../rocDecode

View File

@@ -21,19 +21,7 @@ source software compilers, debuggers, and libraries. ROCm is fully integrated in
## Getting the ROCm Source Code
AMD ROCm is built from open source software. It is, therefore, possible to modify the various components of ROCm by downloading the source code and rebuilding the components. The source code for ROCm components can be cloned from each of the GitHub repositories using git. For easy access to download the correct versions of each of these tools, the ROCm repository contains a repo manifest file called [default.xml](./default.xml). You can use this manifest file to download the source code for ROCm software.
### Installing the repo tool
The repo tool from Google allows you to manage multiple git repositories simultaneously. Run the following commands to install the repo tool:
```bash
mkdir -p ~/bin/
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
```
**Note:** The ```~/bin/``` folder is used as an example. You can specify a different folder to install the repo tool into if you desire.
AMD ROCm is built from open source software. It is, therefore, possible to modify the various components of ROCm by downloading the source code and rebuilding the components. The source code for ROCm components can be cloned from each of the GitHub repositories using git. For easy access to download the correct versions of each of these tools, the ROCm repository contains submodules that point to the correct versions of each of the ROCm components. They can be found in the `/libs` directory of the ROCm repository.
### Installing git-lfs
@@ -45,17 +33,12 @@ sudo apt-get install git-lfs
### Downloading the ROCm source code
The following example shows how to use the repo tool to download the ROCm source code. If you choose a directory other than ~/bin/ to install the repo tool, you must use that chosen directory in the code as shown below:
The following example shows how to download the ROCm source from this repository.
```bash
mkdir -p ~/ROCm/
cd ~/ROCm/
~/bin/repo init -u http://github.com/ROCm/ROCm.git -b roc-6.0.x
~/bin/repo sync
git clone https://github.com/ROCm/ROCm -b amd/dgaliffi/submodules-6-1-2 --recurse-submodules
```
**Note:** Using this sample code will cause the repo tool to download the open source code associated with the specified ROCm release. Ensure that you have ssh-keys configured on your machine for your GitHub ID prior to the download as explained at [Connecting to GitHub with SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
## Building the ROCm source code
Each ROCm component repository contains directions for building that component, such as the rocSPARSE documentation [Installation and Building for Linux](https://rocm.docs.amd.com/projects/rocSPARSE/en/latest/install/Linux_Install_Guide.html). Refer to the specific component documentation for instructions on building the repository.
@@ -77,8 +60,7 @@ The Build time will reduce significantly if we limit the GPU Architecture/s agai
mkdir -p ~/WORKSPACE/ # Or any folder name other than WORKSPACE
cd ~/WORKSPACE/
export ROCM_VERSION=6.1.0 # or 6.1.1 6.1.2
~/bin/repo init -u http://github.com/ROCm/ROCm.git -b roc-6.1.x -m rocm-build/rocm-${ROCM_VERSION}.xml
~/bin/repo sync
git clone https://github.com/ROCm/ROCm -b amd/dgaliffi/submodules-${ROCM_VERSION} --recurse-submodules
# --------------------------------------
# Step 2: Prepare build environment
@@ -155,12 +137,6 @@ Note: [Overview for ROCm.mk](rocm-build/README.md)
## ROCm documentation
This repository contains the [manifest file](https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md)
for ROCm releases, changelogs, and release information.
The `default.xml` file contains information for all repositories and the associated commit used to build
the current ROCm release; `default.xml` uses the [Manifest Format repository](https://gerrit.googlesource.com/git-repo/).
Source code for our documentation is located in the `/docs` folder of most ROCm repositories. The
`develop` branch of our repositories contains content for the next ROCm release.

1
libs/AMDMIGraphX Submodule

Submodule libs/AMDMIGraphX added at c38a587edf

1
libs/HIP Submodule

Submodule libs/HIP added at 900a5e9828

1
libs/HIP-Examples Submodule

Submodule libs/HIP-Examples added at 41b0cff807

1
libs/HIPCC Submodule

Submodule libs/HIPCC added at 7ae382ceec

1
libs/HIPIFY Submodule

Submodule libs/HIPIFY added at ebd56ad4c8

1
libs/MIOpen Submodule

Submodule libs/MIOpen added at bd953f0e94

1
libs/MIVisionX Submodule

Submodule libs/MIVisionX added at f473741012

1
libs/ROCR-Runtime Submodule

Submodule libs/ROCR-Runtime added at 397fa1dd40

1
libs/ROCdbgapi Submodule

Submodule libs/ROCdbgapi added at 7e22c4d4a8

1
libs/ROCgdb Submodule

Submodule libs/ROCgdb added at 56d2ca6637

1
libs/ROCm-Device-Libs Submodule

Submodule libs/ROCm-Device-Libs added at e44fe3aa41

1
libs/Tensile Submodule

Submodule libs/Tensile added at bf05992514

1
libs/amdsmi Submodule

Submodule libs/amdsmi added at c5106a97f7

1
libs/clang-ocl Submodule

Submodule libs/clang-ocl added at d02676b7bd

1
libs/clr Submodule

Submodule libs/clr added at bd86f17082

1
libs/half Submodule

Submodule libs/half added at 10abd99e78

1
libs/hipBLAS Submodule

Submodule libs/hipBLAS added at 8ca4bffdda

1
libs/hipBLASLt Submodule

Submodule libs/hipBLASLt added at 77e0580154

1
libs/hipCUB Submodule

Submodule libs/hipCUB added at 44aa2e07b7

1
libs/hipFFT Submodule

Submodule libs/hipFFT added at d2747245c6

1
libs/hipRAND Submodule

Submodule libs/hipRAND added at eab84d8be3

1
libs/hipSOLVER Submodule

Submodule libs/hipSOLVER added at 7f1530a849

1
libs/hipSPARSE Submodule

Submodule libs/hipSPARSE added at ecf8595094

1
libs/hipSPARSELt Submodule

Submodule libs/hipSPARSELt added at 46771a6761

1
libs/hipTensor Submodule

Submodule libs/hipTensor added at a84615727b

1
libs/hipfort Submodule

Submodule libs/hipfort added at 13beae8adb

1
libs/hipother Submodule

Submodule libs/hipother added at ee2893ac63

1
libs/llvm-project Submodule

Submodule libs/llvm-project added at 669db88497

1
libs/rccl Submodule

Submodule libs/rccl added at 2fbe387c0b

1
libs/rdc Submodule

Submodule libs/rdc added at 5082d269b8

1
libs/rocALUTION Submodule

Submodule libs/rocALUTION added at 7904b7c942

1
libs/rocBLAS Submodule

Submodule libs/rocBLAS added at 8443539677

1
libs/rocDecode Submodule

Submodule libs/rocDecode added at da2d9d2db9

1
libs/rocFFT Submodule

Submodule libs/rocFFT added at 30044d1322

1
libs/rocPRIM Submodule

Submodule libs/rocPRIM added at 85253f879c

1
libs/rocRAND Submodule

Submodule libs/rocRAND added at 77858b5ff1

1
libs/rocSOLVER Submodule

Submodule libs/rocSOLVER added at dd3822956f

1
libs/rocSPARSE Submodule

Submodule libs/rocSPARSE added at edb2770899

1
libs/rocThrust Submodule

Submodule libs/rocThrust added at 41defe7fc0

1
libs/rocWMMA Submodule

Submodule libs/rocWMMA added at 7dbd52461d

1
libs/rocm-cmake Submodule

Submodule libs/rocm-cmake added at f6fcfe7011

1
libs/rocm-core Submodule

Submodule libs/rocm-core added at 5fabb4cfde

1
libs/rocm_smi_lib Submodule

Submodule libs/rocm_smi_lib added at 193294b1c4

1
libs/rocminfo Submodule

Submodule libs/rocminfo added at 7b59f24005

1
libs/rocprofiler Submodule

Submodule libs/rocprofiler added at bb98838ec6

1
libs/rocr_debug_agent Submodule

Submodule libs/rocr_debug_agent added at c930232714

1
libs/roctracer Submodule

Submodule libs/roctracer added at aa3c07c257

1
libs/rpp Submodule

Submodule libs/rpp added at a672de89f5

View File

@@ -0,0 +1,150 @@
#!/usr/bin/bash
# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
printHelp() {
# Print the help message
printf -- \
"
Usage: update-submodules.sh [-t <tag>] [-p <path>]
Description: Update submodules to the ROCm release tag
Options:
-h, --help: Print the help message
-t, --tag: The ROCm release tag to update the submodules to
-p, --path: The path to the submodules directory
Example:
./update-submodules.sh -t rocm-6.1.0 -p ../../libs"
}
updateSubmodules() {
# Update the submodules in the given directory to the desired tag
# $1: The directory to update the submodules in
local directory=$1
pushd "$directory" >> /dev/null || exit
for d in */
do
pushd "$d" >> /dev/null || exit
if [[ -e .git ]]; then
echo -e "${GREEN}${d} is a git folder${NC}"
if ! git fetch --all; then
echo -e "${RED}Failed to fetch for ${d}${NC}"
# Save the current directory to an array to output the list of
# failed fetches at the end.
gitFetchErrors+=("$d")
fi
# Checkout the desired tag
if ! git checkout tags/"${RocmRelease}"; then
echo -e "${RED}Failed to checkout tag ${RocmRelease} for ${d}${NC}"
# Save the current directory to an array to output the list of
# failed checkouts at the end.
gitCheckoutErrors+=("$d")
fi
else
echo -e "${RED}${d} is NOT a git folder${NC}"
# Save the current directory to an array to output the list of
# non-git folders at the end.
nonGitFolders+=("$d")
fi
echo -e "${NC}"
popd >> /dev/null || exit
done
popd >> /dev/null || exit
}
#######
# MAIN PROGRAM
#######
# Default values
RocmRelease=rocm-6.1.0
PathToSubmodules=../../libs
# Parse command line parameters.
while [ $# -gt 0 ]; do
case $1 in
-h | --help )
printHelp
exit 0
;;
-t | --tag )
shift
RocmRelease=$1
shift
;;
-p | --path )
shift
PathToSubmodules=$1
shift
;;
* )
shift
;;
esac
done
echo "********************************"
echo -e "${BLUE}Path to Submodules: ${PathToSubmodules}${NC}"
pushd "$PathToSubmodules" >> /dev/null || exit
echo -e "${BLUE}Syncing to Tag: ${RocmRelease}.${NC}"
echo "********************************"
echo
# Update submodules in the current directory
updateSubmodules "."
# Update the `openmp-extras` modules
updateSubmodules "openmp-extras"
popd >> /dev/null || exit
# Output summary of errors
echo "********************************"
echo -e "${BLUE}*** Error Report ***${NC}"
echo "********************************"
echo
if [ ${#nonGitFolders[@]} -gt 0 ]; then
echo -e "${RED}The following folders are not git folders:${NC}"
for d in "${nonGitFolders[@]}"
do
echo "${d}"
done
echo
fi
if [ ${#gitFetchErrors[@]} -gt 0 ]; then
echo -e "${RED}The following folders failed to fetch:${NC}"
for d in "${gitFetchErrors[@]}"
do
echo "${d}"
done
echo
fi
if [ ${#gitCheckoutErrors[@]} -gt 0 ]; then
echo -e "${RED}The following folders failed to checkout tag ${RocmRelease}:${NC}"
for d in "${gitCheckoutErrors[@]}"
do
echo "${d}"
done
echo
fi