Skip to content
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

Add ROCm 5.0.2 for x86_64 #7795

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmssw-tool-conf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ Requires: oracle
Requires: icc
Requires: icx
Requires: intel-vtune
Requires: rocm
Requires: cmsmon-tools
Requires: dip
%else
Expand Down
87 changes: 87 additions & 0 deletions rocm.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
### RPM external rocm 5.0.2
## 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)

%prep

%build

%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
# remove the OpenMP extra files
rm -f %{i}/bin/{aompcc,gputable.txt,mygpu,mymcpu}
# remove the MIGraphX tools
rm -f %{i}/bin/migraphx-driver

# ROCm/HIP core tools
DIRECTORIES="amdgcn hip hipcub hsa hsa-amd-aqlprofile include lib lib64 llvm rocthrust share"

# rocm-smi
DIRECTORIES+=" oam rocm_smi"

# hipBLAS / rocBLAS
DIRECTORIES+=" hipblas rocblas"

# hipSOLVER / rocSOLVER
DIRECTORIES+=" hipsolver rocsolver"

# hipSPARSE / rocSPARSE
DIRECTORIES+=" hipsparse rocsparse"

# hipFFT / rocFFT
DIRECTORIES+=" hipfft rocfft"

# hipRAND / rocRAND
DIRECTORIES+=" hiprand rocrand"

# ROCm Parallel Primitives (rocPRIM)
DIRECTORIES+=" rocprim"

# 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"

# ROCm Communication Collectives Library (RCCL)
#DIRECTORIES+=" rccl"

# iterative sparse solvers for ROCm platform (rocALUTION)
#DIRECTORIES+=" rocalution"

# Machine Intelligence Libraries
#DIRECTORIES+=" miopen miopengemm mivisionx"

# 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
12 changes: 12 additions & 0 deletions scram-tools.file/tools/rocm/rocm-rocrand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<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/hiprand"/>
<environment name="INCLUDE" default="$ROCM_ROCRAND_BASE/include/rocrand"/>
</client>
</tool>
36 changes: 36 additions & 0 deletions scram-tools.file/tools/rocm/rocm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<tool name="rocm" version="@TOOL_VERSION@">
<info url="https://docs.amd.com/"/>
<lib name="amdhip64"/>
<client>
<environment name="ROCM_BASE" default="@TOOL_ROOT@"/>
<environment name="ROCM_LLVM" default="$ROCM_BASE/llvm/lib/clang/14.0.0"/>
<environment name="HIPCC" default="$ROCM_BASE/bin/hipcc"/>
<environment name="BINDIR" default="$ROCM_BASE/bin"/>
<environment name="LIBDIR" default="$ROCM_BASE/lib"/>
<environment name="LIBDIR" default="$ROCM_BASE/lib64"/>
<environment name="LIBDIR" default="$ROCM_BASE/hip/lib"/>
<environment name="LIBDIR" default="$ROCM_BASE/hsa/lib"/>
<environment name="LIBDIR" default="$ROCM_LLVM/lib/linux"/>
<environment name="LIBDIR" default="$ROCM_BASE/llvm/lib"/>
<environment name="INCLUDE" default="$ROCM_BASE/include"/>
<environment name="INCLUDE" default="$ROCM_BASE/hip/include"/>
<environment name="INCLUDE" default="$ROCM_BASE/hsa/include"/>
<environment name="INCLUDE" default="$ROCM_LLVM"/>
</client>
<flags ROCM_FLAGS="-fno-gpu-rdc --amdgpu-target=gfx900 --gcc-toolchain=$COMPILER_PATH -D__HIP_PLATFORM_HCC__ -D__HIP_PLATFORM_AMD__"/>
<!-- REM_CXXFLAGS from llvm/llvm-cxxcompiler.xml -->
<flags ROCM_HOST_REM_CXXFLAGS="-Wno-non-template-friend"/>
<flags ROCM_HOST_REM_CXXFLAGS="-Werror=format-contains-nul"/>
<flags ROCM_HOST_REM_CXXFLAGS="-Werror=maybe-uninitialized"/>
<flags ROCM_HOST_REM_CXXFLAGS="-Werror=unused-but-set-variable"/>
<flags ROCM_HOST_REM_CXXFLAGS="-Werror=return-local-addr"/>
<flags ROCM_HOST_REM_CXXFLAGS="-fipa-pta"/>
<flags ROCM_HOST_REM_CXXFLAGS="-frounding-math"/>
<flags ROCM_HOST_REM_CXXFLAGS="-mrecip"/>
<flags ROCM_HOST_REM_CXXFLAGS="-fno-crossjumping"/>
<flags ROCM_HOST_REM_CXXFLAGS="-fno-aggressive-loop-optimizations"/>
<flags ROCM_HOST_REM_CXXFLAGS="-funroll-all-loops"/>
<flags ROCM_HOST_CXXFLAGS="-D__HIP_PLATFORM_HCC__ -D__HIP_PLATFORM_AMD__"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fwyzard , ROOT_INCLUDE_PATH is only needed if rocm headers are used for root dictionaries. I think we do not want to do this, so better to remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we have it for CUDA:

<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>

I'd like to keep it also for ROCm, until we figure out how to handle the (transient) data formats and their dictionaries.

<runtime name="PATH" value="$ROCM_BASE/bin" type="path"/>
</tool>