Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
easyblock = 'CMakeMake'

name = 'amdsmi'
version = '25.4.2'
_rocm_version = '6.4.1'
# amdsmi includes esmi as a component, which needs to be copied into the amdsmi sources.
# Required version can be found in amdsmi/CMakeLists.txt by searching for current_esmi_tag.
_esmi_version = '4.1.2'
versionsuffix = f'-ROCm-{_rocm_version}'

homepage = 'https://github.com/ROCm/amdsmi'
description = """
The AMD System Management Interface (AMD SMI) library offers a unified tool for managing and monitoring
GPUs, particularly in high-performance computing environments. It provides a user-space interface that
allows applications to control GPU operations, monitor performance, and retrieve information about the
system's drivers and GPUs."""
docurls = ['https://rocm.docs.amd.com/projects/amdsmi/en/latest/']

toolchain = {'name': 'GCCcore', 'version': '13.3.0'}

source_urls = [
'https://github.com/ROCm/amdsmi/archive/refs/tags/',
'https://github.com/amd/esmi_ib_library/archive/refs/tags/'
]
sources = [
f'rocm-{_rocm_version}.tar.gz',
f'esmi_pkg_ver-{_esmi_version}.tar.gz',
]
patches = ['amdsmi-25.4.2_handle-non-standard-rocm-paths.patch']
checksums = [
{'rocm-6.4.1.tar.gz':
'5e1030cebacf2c92e63a555db6433ce7bb4f91409910ec98947e459d36630401'},
{'esmi_pkg_ver-4.1.2.tar.gz':
'd95f12c1500c60dc01b500d8928864a276757bd3bbb4a6daa84fb8c028e2978b'},
{'amdsmi-25.4.2_handle-non-standard-rocm-paths.patch':
'97b9067a7702d8131b4c25fba990ebfa538a08de3180c5898271591470ea8d80'},
]

builddependencies = [
('binutils', '2.42'),
('CMake', '3.29.3'),
('pkgconf', '2.2.0'),
# Needed as amdsmi tries to find git to determine commit hash it was built from
('git', '2.45.1'),
('libdrm', '2.4.122'),
]

dependencies = [
('Python', '3.12.3'), # Needed as amdsmi is a python script
]

preconfigopts = (f"cp -r %(builddir)s/esmi_ib_library-esmi_pkg_ver-{_esmi_version} "
f"%(builddir)s/amdsmi-rocm-{_rocm_version}/esmi_ib_library && ")

sanity_check_paths = {
'files': [f'lib/libamd_smi.{SHLIB_EXT}',
'include/amd_smi/amdsmi.h'],
'dirs': ['lib/cmake/amd_smi',
'share/doc/amd_smi']
}

# Sanity check commands require kernel drivers to be loaded.
# The command itself will result in an exit code of non-zero, therefore try to grep
# the tool version, which is always present.
# Trying any amd-smi command without the correct kernel drivers loaded will fail with:
# ERROR:root:Unable to get devices, driver not initialized (amdgpu not found in modules)
# ERROR:root:Unable to detect any GPU devices, check amdgpu version and module status (sudo modprobe amdgpu)
# ERROR:root:Unable to detect any CPU devices, check amd_hsmp version and module status (sudo modprobe amd_hsmp)
# AMDSMI Tool: 25.4.2+unknown | AMDSMI Library version: 25.4.0 | ROCm version: N/A
sanity_check_commands = [
f'amd-smi version | grep "AMDSMI Tool: {version}"',
]

moduleclass = 'lib'
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name = 'Boost'
version = '1.85.0'

homepage = 'https://www.boost.org/'
description = """Boost provides free peer-reviewed portable C++ source libraries."""

toolchain = {'name': 'LLVMtc', 'version': '19.0.0-ROCm-6.4.1'}
toolchainopts = {'pic': True}

source_urls = ['https://archives.boost.io/release/%(version)s/source/']
sources = ['%%(namelower)s_%s.tar.gz' % '_'.join(version.split('.'))]
patches = ['Boost-1.85.0_fix-ppc-charconv.patch']
checksums = [
'be0d91732d5b0cc6fbb275c7939974457e79b54d6f07ce2e3dfdd68bef883b0b',
{'Boost-1.85.0_fix-ppc-charconv.patch': 'bb392cc087fe4951e2c427731020b541c3258ec75f113524303dfb44624f98bc'},
]

dependencies = [
('bzip2', '1.0.8'),
('zlib', '1.3.1'),
('XZ', '5.4.5'),
('zstd', '1.5.6'),
('ICU', '75.1'),
]

configopts = '--without-libraries=python,mpi'

# disable MPI, build Boost libraries with tagged layout
boost_mpi = False
tagged_layout = True

moduleclass = 'devel'
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
easyblock = 'PythonBundle'

name = 'CppHeaderParser'
version = '2.7.4'

homepage = 'https://senexcanis.com/open-source/cppheaderparser'
description = """CppHeaderParser is a pure python module that will parse C++
header files and generate a data structure representing the class."""

toolchain = {'name': 'GCCcore', 'version': '13.3.0'}

dependencies = [
('binutils', '2.42'),
('Python', '3.12.3'),
]

exts_list = [
('ply', '3.11', {
'checksums': ['00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3'],
}),
(name, version, {
'modulename': False,
'checksums': ['382b30416d95b0a5e8502b214810dcac2a56432917e2651447d3abe253e3cc42'],
}),
]

fix_python_shebang_for = [
'lib/python%(pyshortver)s/site-packages/CppHeaderParser/*.py',
'lib/python%(pyshortver)s/site-packages/CppHeaderParser/examples/*.py',
]

moduleclass = 'lib'
33 changes: 33 additions & 0 deletions easybuild/easyconfigs/g/glog/glog-0.7.1-GCCcore-13.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
easyblock = 'CMakeMake'

name = 'glog'
version = '0.7.1'

homepage = 'https://github.com/google/glog'
description = "A C++ implementation of the Google logging module."

toolchain = {'name': 'GCCcore', 'version': '13.3.0'}
toolchainopts = {'cstd': 'c++14'}

source_urls = ['https://github.com/google/glog/archive/']
sources = ['v%(version)s.tar.gz']
checksums = ['00e4a87e87b7e7612f519a41e491f16623b12423620006f59f5688bfd8d13b08']

builddependencies = [
('binutils', '2.42'),
('CMake', '3.29.3'),
]

dependencies = [
('gflags', '2.2.2'),
('libunwind', '1.8.1'),
]

configopts = '-DBUILD_SHARED_LIBS=ON '

sanity_check_paths = {
'files': ['include/glog/logging.h', 'include/glog/raw_logging.h', 'lib/libglog.%s' % SHLIB_EXT],
'dirs': [],
}

moduleclass = 'devel'
112 changes: 112 additions & 0 deletions easybuild/easyconfigs/h/HIP/HIP-6.4.43483-LLVMtc-19.0.0-ROCm-6.4.1.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
easyblock = 'EB_ROCmComponent'

name = 'HIP'
version = '6.4.43483'
_rocm_version = '6.4.1'

homepage = 'https://github.com/ROCm/HIP'
description = """HIP is a C++ Runtime API and Kernel Language that allows
developers to create portable applications for AMD and NVIDIA GPUs from single
source code."""
docurls = ['https://rocmdocs.amd.com/projects/HIP/']

toolchain = {'name': 'LLVMtc', 'version': '19.0.0-ROCm-6.4.1'}

builddependencies = [
('binutils', '2.42'),
('CMake', '3.29.3'),
('CppHeaderParser', '2.7.4'),
]

dependencies = [
('zlib', '1.3.1'),
('libxml2', '2.12.7'),
('numactl', '2.0.18'),
('Perl', '5.38.2'),
('libglvnd', '1.7.0'),
('rocminfo', '1.5.0'),
('rocm-cmake', '0.14.0'),
('rocprofiler-register', '0.5.0'),
]

default_easyblock = 'CMakeMake'

components = [
('HIPCC', 'rocm-%s' % _rocm_version, {
'sources': [
{
'source_urls': ['https://github.com/ROCm/llvm-project/archive/'],
'download_filename': '%(version)s.tar.gz',
'filename': 'llvm-project-%(version)s.tar.gz',
'alt_location': 'ROCm-LLVM',
'extract_cmd': 'tar xfz %s && mv llvm-project-%(version)s llvm-project-%(version)s.src',
},
],
'patches': [('HIP-6.4.43483-LLVMtc-19.0.0-ROCm-6.4.1_correct_paths_clang_and_rocm_agent_enum.patch',
'llvm-project-%(version)s.src')],
'checksums': [
# llvm-project-rocm-6.4.1.tar.gz
'460ad28677092b9eb86ffdc49bcb4d01035e32b4f05161d85f90c9fa80239f50',
# HIP-6.4.43483-LLVMtc-19.0.0-ROCm-6.4.1_correct_paths_clang_and_rocm_agent_enum.patch
'ab58ee1bae0b5c4cec293063758da119dd6c90f944e6821141205dfe1bdbb47e',
],
'srcdir': 'llvm-project-%(version)s.src/amd/hipcc',
}),
('HIP', 'rocm-%s' % _rocm_version, {
'sources': [
{
'source_urls': ['https://github.com/ROCm/clr/archive/'],
'download_filename': '%(version)s.tar.gz',
'filename': 'clr-%(version)s.tar.gz',
},
{
'source_urls': ['https://github.com/ROCm/HIP/archive/'],
'download_filename': '%(version)s.tar.gz',
'filename': 'HIP-%(version)s.tar.gz',
},
],
'checksums': [
'18ee75a04f6fc55e72f8b3fcad1e0d58eceb2ce0e0696ca76d9b3dfaf4bfd7ff', # clr-rocm-6.4.1.tar.gz
'f26f098b08504636c6f4e1da45b162f1df2ce6608eba85606fa7932d8fea960f', # HIP-rocm-6.4.1.tar.gz
],
'srcdir': 'clr-rocm-%s' % _rocm_version,
'configopts': '-DHIP_COMMON_DIR=%(builddir)s/hip-%(version)s/ -DHIP_PLATFORM=amd ' +
'-DHIPCC_BIN_DIR=%(installdir)s/bin -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF'
}),
]

sanity_check_paths = {
'files': ['bin/%s' % x for x in ['hipcc', 'hipcc.pl', 'hipconfig', 'hipconfig.pl']] +
['bin/%s' % x for x in ['roc-obj', 'roc-obj-extract', 'roc-obj-ls']] +
['include/hip/hip_common.h', 'include/hip/hip_runtime.h', 'lib/libamdhip64.%s' % SHLIB_EXT],
'dirs': [],
}
sanity_check_commands = [
'hipcc --help',
'hipconfig --full'
]

modextravars = {
'HIP_COMPILER': 'clang',
'HIP_INCLUDE_PATH': '%(installdir)s/include',
'HIP_LIB_PATH': '%(installdir)s/lib',
'HIP_PATH': '%(installdir)s',
'HIP_RUNTIME': 'rocclr',
'ROCM_PATH': '%(installdir)s',
}

modluafooter = """
setenv("DEVICE_LIB_PATH", os.getenv("EBROOTROCMMINLLVM") .. "/amdgcn/bitcode")
setenv("HIP_CLANG_INCLUDE_PATH", os.getenv("EBROOTROCMMINLLVM") .. "/include")
setenv("HIP_CLANG_PATH", os.getenv("EBROOTROCMMINLLVM") .. "/bin")
setenv("HSA_PATH", os.getenv("EBROOTROCMMINLLVM"))
"""

modtclfooter = """
setenv DEVICE_LIB_PATH $::env(EBROOTROCMMINLLVM)/amdgcn/bitcode
setenv HIP_CLANG_INCLUDE_PATH $::env(EBROOTROCMMINLLVM)/include
setenv HIP_CLANG_PATH $::env(EBROOTROCMMINLLVM)/bin
setenv HSA_PATH $::env(EBROOTROCMMINLLVM)
"""

moduleclass = 'tools'
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From 8d2e14328cd99bbad2eaa498c207cf41f688fc30 Mon Sep 17 00:00:00 2001
From: sreenivasa murthy kolam <[email protected]>
Date: Mon, 23 Sep 2024 10:34:16 +0000
Subject: [PATCH] Use the rocminfo_path and hipclang_path inside the hipcc.pl
and hipbin_amd.h

---
amd/hipcc/bin/hipcc.pl | 9 ++++++---
amd/hipcc/src/hipBin_amd.h | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/amd/hipcc/bin/hipcc.pl b/amd/hipcc/bin/hipcc.pl
index 27839e5..fcb8d4e 100755
--- a/amd/hipcc/bin/hipcc.pl
+++ b/amd/hipcc/bin/hipcc.pl
@@ -160,11 +160,13 @@ if ($HIP_PLATFORM eq "amd") {
if($isWindows) {
$execExtension = ".exe";
}
- $HIPCC=get_normalized_path("$HIP_CLANG_PATH/clang++" . $execExtension);
+ # hip_clang_path is set inside the hip recipe
+ $HIP_CLANG_PATH= $ENV{'HIP_CLANG_PATH'};
+ $HIPCC="${HIP_CLANG_PATH}/clang++" . $execExtension;

# If $HIPCC clang++ is not compiled, use clang instead
if ( ! -e $HIPCC ) {
- $HIPCC=get_normalized_path("$HIP_CLANG_PATH/clang" . $execExtension);
+ $HIPCC="${HIP_CLANG_PATH}/clang" . $execExtension;
$HIPLDFLAGS = "--driver-mode=g++";
}
# to avoid using dk linker or MSVC linker
@@ -480,7 +482,8 @@ if($HIP_PLATFORM eq "amd"){
$targetsStr = $ENV{HCC_AMDGPU_TARGET};
} elsif (not $isWindows) {
# Else try using rocm_agent_enumerator
- $ROCM_AGENT_ENUM = "${ROCM_PATH}/bin/rocm_agent_enumerator";
+ $ROCMINFO_PATH = $ENV{'EBROOTROCMINFO'} // $ROCMINFO_PATH;
+ $ROCM_AGENT_ENUM = "${EBROOTROCMINFO}/bin/rocm_agent_enumerator";
$targetsStr = `${ROCM_AGENT_ENUM} -t GPU`;
$targetsStr =~ s/\n/,/g;
}
diff --git a/amd/hipcc/src/hipBin_amd.h b/amd/hipcc/src/hipBin_amd.h
index 57d0098..d53d081 100644
--- a/amd/hipcc/src/hipBin_amd.h
+++ b/amd/hipcc/src/hipBin_amd.h
@@ -752,7 +752,7 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
} else if (os != windows) {
// Else try using rocm_agent_enumerator
string ROCM_AGENT_ENUM;
- ROCM_AGENT_ENUM = roccmPath + "/bin/rocm_agent_enumerator";
+ ROCM_AGENT_ENUM = string(getenv("EBROOTROCMINFO")) + "/bin/rocm_agent_enumerator";
targetsStr = ROCM_AGENT_ENUM +" -t GPU";
SystemCmdOut sysOut = hipBinUtilPtr_->exec(targetsStr.c_str());
regex toReplace("\n+");
--
2.39.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
easyblock = 'EB_ROCmComponent'

name = 'hipBLAS-common'
version = '1.3.0'
_rocm_version = '6.4.1'

homepage = 'https://github.com/ROCm/hipBLAS-common'
description = """hipBLAS-common is a header-only library that provides common files for hipBLAS and hipBLASLt."""

toolchain = {'name': 'LLVMtc', 'version': '19.0.0-ROCm-6.4.1'}

github_account = 'ROCm'
source_urls = [GITHUB_SOURCE]
sources = [f'rocm-{_rocm_version}.tar.gz']
checksums = ['ba3cb314ceab9183aeac851e536c5d143933986f3099533edd327ffeb4b48e9b']

builddependencies = [
('binutils', '2.42'),
('CMake', '3.29.3'),
]

sanity_check_paths = {
'files': ['lib/cmake/hipblas-common/hipblas-common-config.cmake',
'include/hipblas-common/hipblas-common.h'],
'dirs': ['lib/cmake/hipblas-common',
'share/doc/hipblas-common',
'include/hipblas-common'],
}

moduleclass = 'lib'
Loading