-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package the HIP/ROCm and ROCrand libraries [13.0.x] #8371
Merged
cmsbuild
merged 3 commits into
cms-sw:IB/CMSSW_13_0_X/master
from
fwyzard:IB/CMSSW_13_0_X/master_repackage_rocm
Mar 22, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
### RPM external rocm-rocrand 5.4.3 | ||
## NOCOMPILER | ||
|
||
%if "%{rhel}" == "7" | ||
# allow rpm2cpio dependency on the bootstrap bundle | ||
%undefine drop_bootstrap_lib | ||
%define drop_bootstrap_lib true | ||
%define repository repo.radeon.com/rocm/yum | ||
%else | ||
%define repository repo.radeon.com/rocm/rhel%{rhel} | ||
%endif | ||
|
||
Source0: https://%{repository}/%{realversion}/main/rocrand-2.10.9.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source1: https://%{repository}/%{realversion}/main/rocrand-devel-2.10.9.50403-121.el%{rhel}.%{_arch}.rpm | ||
Requires: rocm | ||
|
||
%prep | ||
|
||
%build | ||
rpm2cpio %{SOURCE0} | cpio -idmv | ||
rpm2cpio %{SOURCE1} | cpio -idmv | ||
|
||
%install | ||
rmdir %{i} | ||
mv opt/rocm-%{realversion} %{i} | ||
rm -rf opt | ||
rm -rf usr | ||
|
||
%post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,77 @@ | ||
### RPM external rocm 5.4.3 | ||
## NOCOMPILER | ||
Source: none | ||
Provides: libamd_comgr.so.2()(64bit) | ||
Provides: libhsa-runtime64.so.1()(64bit) | ||
Provides: librocm-core.so.1()(64bit) | ||
Provides: librocm_smi64.so.5()(64bit) | ||
Provides: libamdhip64.so.5()(64bit) | ||
Provides: libamdhip64.so.5(hip_4.2)(64bit) | ||
|
||
# This rpm packages only symlinks to an installation that is already on CVMFS. | ||
# Configure pkgtools to keep the static libraries, to avoid actually trying to | ||
# delete them from CVMFS. | ||
%define keep_archives true | ||
%if "%{rhel}" == "7" | ||
# allow rpm2cpio dependency on the bootstrap bundle | ||
%undefine drop_bootstrap_lib | ||
%define drop_bootstrap_lib true | ||
%define repository repo.radeon.com/rocm/yum | ||
%else | ||
%define repository repo.radeon.com/rocm/rhel%{rhel} | ||
%endif | ||
|
||
Source0: https://%{repository}/%{realversion}/main/comgr-2.4.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source1: https://%{repository}/%{realversion}/main/hip-devel-5.4.22804.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source2: https://%{repository}/%{realversion}/main/hip-runtime-amd-5.4.22804.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source3: https://%{repository}/%{realversion}/main/hsa-rocr-1.7.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source4: https://%{repository}/%{realversion}/main/rocm-core-5.4.3.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source5: https://%{repository}/%{realversion}/main/rocm-dbgapi-0.68.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source6: https://%{repository}/%{realversion}/main/rocm-device-libs-1.0.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source7: https://%{repository}/%{realversion}/main/rocm-llvm-15.0.0.23045.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source8: https://%{repository}/%{realversion}/main/rocm-smi-lib-5.0.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Source9: https://%{repository}/%{realversion}/main/rocminfo-1.0.0.50403-121.el%{rhel}.%{_arch}.rpm | ||
Requires: numactl | ||
Requires: python3 | ||
|
||
%prep | ||
|
||
%build | ||
rpm2cpio %{SOURCE0} | cpio -idmv | ||
rpm2cpio %{SOURCE1} | cpio -idmv | ||
rpm2cpio %{SOURCE2} | cpio -idmv | ||
rpm2cpio %{SOURCE3} | cpio -idmv | ||
rpm2cpio %{SOURCE4} | cpio -idmv | ||
rpm2cpio %{SOURCE5} | cpio -idmv | ||
rpm2cpio %{SOURCE6} | cpio -idmv | ||
rpm2cpio %{SOURCE7} | cpio -idmv | ||
rpm2cpio %{SOURCE8} | cpio -idmv | ||
rpm2cpio %{SOURCE9} | cpio -idmv | ||
|
||
%install | ||
OSDIR=/cvmfs/patatrack.cern.ch/externals/%{_arch}/rhel%{rhel} | ||
if ! [ -d $OSDIR ]; then | ||
OSDIR=/cvmfs/patatrack.cern.ch/externals/%{_arch}/unknown | ||
fi | ||
BASEDIR=${OSDIR}/amd/%{n}-%{realversion} | ||
|
||
# Symlink individual files from ${BASEDIR}/bin/ | ||
mkdir %{i}/bin | ||
test -d ${BASEDIR}/bin | ||
test -e ${BASEDIR}/bin/hipcc | ||
ln -s ${BASEDIR}/bin/* %{i}/bin/ | ||
# Remove the OpenCL extra files | ||
rm -f %{i}/bin/{clang-ocl,clinfo} | ||
# Remove the OpenMP extra files | ||
rm -f %{i}/bin/{aompcc,mygpu,mymcpu} | ||
# Remove the Fortran files | ||
rm -f %{i}/bin/hipfc | ||
# Remove the MI tools | ||
rm -f %{i}/bin/{MIOpenDriver,migraphx-driver,runvx} | ||
# Remove the datacenter tools and validation suite binaries | ||
rm -f %{i}/bin/{rdcd,rdci,rvs} | ||
# Remove some of the prebuilt samples | ||
rm -f %{i}/bin/{sgemmv,simple_dlrm,simple_gemm} | ||
|
||
# ROCm/HIP core tools | ||
DIRECTORIES="amdgcn hip hsa hsa-amd-aqlprofile include lib libexec llvm share" | ||
|
||
# rocm-smi | ||
DIRECTORIES+=" oam rocm_smi" | ||
|
||
# ROCm Tracer Callback/Activity Library (rocTRACER) and profiler library (ROC-profiler) | ||
DIRECTORIES+=" rocprofiler roctracer" | ||
|
||
# Asynchronous Task and Memory Interface (ATMI) | ||
#DIRECTORIES+=" atmi" | ||
|
||
# OpenCL support | ||
#DIRECTORIES+=" opencl tests" | ||
|
||
# ROCm Communication Collectives Library (RCCL) | ||
#DIRECTORIES+=" rccl" | ||
|
||
# Machine Intelligence Libraries | ||
#DIRECTORIES+=" miopen miopengemm" | ||
|
||
# HIP Fortran interface (hipfort) | ||
#DIRECTORIES+=" hipfort" | ||
|
||
# ROCm Data Center Tool (RDC) | ||
#DIRECTORIES+=" rdc" | ||
|
||
# ROCm Validation Suite (RVS) | ||
#DIRECTORIES+=" rvs" | ||
|
||
# symlink the other directories from ${BASEDIR}/ | ||
for D in ${DIRECTORIES}; do | ||
ln -s ${BASEDIR}/${D} %{i}/ | ||
test -L %{i}/${D} | ||
done | ||
rmdir %{i} | ||
mv opt/rocm-%{realversion} %{i} | ||
rm -rf opt | ||
rm -rf usr | ||
|
||
# the hip directory is deprecated in favour of the main directory | ||
rm -r -f %{i}/hip/ | ||
|
||
# hip-devel postinstall | ||
ln -s -f amd_detail %{i}/include/hip/hcc_detail | ||
ln -s -f nvidia_detail %{i}/include/hip/nvcc_detail | ||
# deprecated | ||
#ln -s -f amd_detail %{i}/hip/include/hip/hcc_detail | ||
#ln -s -f nvidia_detail %{i}/hip/include/hip/nvcc_detail | ||
|
||
# hip-runtime-amd postinstall | ||
# deprecated | ||
#mkdir -p %{i}/hip/lib/cmake/hip | ||
#mkdir -p %{i}/hip/lib/cmake/hip-lang | ||
#ln -r -s -f %{i}/lib/cmake/hip/hip-targets* %{i}/hip/lib/cmake/hip/ | ||
#ln -r -s -f %{i}/lib/cmake/hip-lang/hip-lang-targets* %{i}/hip/lib/cmake/hip-lang/ | ||
|
||
# rocm-llvm postinstall | ||
mkdir -p %{i}/bin | ||
ln -r -s -f %{i}/llvm/bin/amdclang %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdclang++ %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdclang-cl %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdclang-cpp %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdflang %{i}/bin/ | ||
ln -r -s -f %{i}/llvm/bin/amdlld %{i}/bin/ | ||
|
||
# replace '/usr/libexec/platform-python' with '/usr/bin/env python3' | ||
find %{i}/bin/ %{i}/libexec/ %{i}/llvm/bin/ %{i}/llvm/lib/ -type f | xargs -r \ | ||
grep '#! */usr/libexec/platform-python' -l | xargs -r \ | ||
sed -e'1 s|#! */usr/libexec/platform-python|#!/usr/bin/env python3|' -s -i | ||
|
||
%post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<tool name="rocm-rocrand" version="@TOOL_VERSION@"> | ||
<info url="https://github.com/ROCmSoftwarePlatform/rocRAND"/> | ||
<use name="rocm"/> | ||
<lib name="hiprand"/> | ||
<lib name="rocrand"/> | ||
<client> | ||
<environment name="ROCM_ROCRAND_BASE" default="@TOOL_ROOT@"/> | ||
<environment name="LIBDIR" default="$ROCM_ROCRAND_BASE/lib"/> | ||
<environment name="INCLUDE" default="$ROCM_ROCRAND_BASE/include"/> | ||
</client> | ||
<!-- use -isystem instead of -I to silence warnings in the HIP/ROCm headers --> | ||
<flags SYSTEM_INCLUDE="1"/> | ||
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path" join="1"/> | ||
</tool> |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smuzaffar is this the right way to have different
cmssw-tool-conf
files for CMSSW 13.0.x vs 13.1.x ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I just increment the major version when a new tool is added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes... but
54.0
is already used in 13.1.x, which adds tools I think we do not want to backport to 13.0.x.So I've used
55.0
for the 13.1.x branch, and53.1
for the 13.0.x branch.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, sorry I did not realize that it is 13.0.x PR. yes
53.1
seems right