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

{tools}[GCCcore/11.2.0] HIP v4.5.0 #14339

Merged
merged 7 commits into from
Dec 12, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
113 changes: 113 additions & 0 deletions easybuild/easyconfigs/h/HIP/HIP-4.5.0-GCCcore-11.2.0-amd.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
easyblock = 'CMakeMake'

name = 'HIP'
version = '4.5.0'
versionsuffix = '-amd'

homepage = 'https://github.com/ROCm-Developer-Tools/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']

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

sources = [
{
'source_urls': ['https://github.com/ROCm-Developer-Tools/hipamd/archive/'],
'download_filename': 'rocm-%(version)s.tar.gz',
'filename': 'hipamd-rocm-%(version)s.tar.gz',
},
{
'source_urls': ['https://github.com/ROCm-Developer-Tools/ROCclr/archive/'],
'download_filename': 'rocm-%(version)s.tar.gz',
'filename': 'ROCclr-rocm-%(version)s.tar.gz',
},
{
'source_urls': ['https://github.com/ROCm-Developer-Tools/HIP/archive/'],
'download_filename': 'rocm-%(version)s.tar.gz',
'filename': 'HIP-rocm-%(version)s.tar.gz',
},
{
'source_urls': ['https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/'],
'download_filename': 'rocm-%(version)s.tar.gz',
'filename': 'ROCm-OpenCL-Runtime-rocm-%(version)s.tar.gz',
},
]

patches = ['hipamd-rocm-%(version)s-remove-testing.patch']

checksums = [
'7b93ab64d6894ff9b5ba0be35e3ed8501d6b18a2a14223d6311d72ab8a9cdba6', # hipamd-rocm-4.5.0.tar.gz
'ca8d6305ff0e620d9cb69ff7ac3898917db9e9b6996a7320244b48ab6511dd8e', # ROCclr-rocm-4.5.0.tar.gz
'4026f31fb4f8050e9aa9d4294f29c3410bfb38422dbbae4236ccd65fed4d55b2', # HIP-rocm-4.5.0.tar.gz
'3a163aed24619b3faf5e8ba17325bdcedd1667a904ea20914ac6bdd33fcdbca8', # ROCm-OpenCL-Runtime-rocm-4.5.0.tar.gz
'b70636c7853c74d1fca3c71b73d48ff3a2c66d09382b2378900ee47f25ed2ae1', # hipamd-4.5.0-remove-testing.patch
]

builddependencies = [
('binutils', '2.37'),
('CMake', '3.21.1'),
]
dependencies = [
('Clang-AOMP', '%(version)s'),
('Perl', '5.34.0'),
('ROCR-Runtime', '%(version)s'),
('ROCm-CompilerSupport', '%(version)s'),
('libglvnd', '1.3.3'),
('libxml2', '2.9.10'),
('numactl', '2.0.14'),
('rocm-cmake', '%(version)s'),
('rocminfo', '%(version)s'),
('zlib', '1.2.11'),
]

# AMD uses 'gfx' to identify the GPU, the first number identifies the generation, according to
# https://www.x.org/wiki/RadeonFeature/#index5h2 while the rest identifies the specific GPU.
# In the context of EasyBuild this identifier can be thought of as equivalent to the 'sm_<xx>'
# nomenclature of Nvidia.
local_default_gfx = 'gfx900'

configopts = "-DAMD_OPENCL_PATH=%(builddir)s/ROCm-OpenCL-Runtime-rocm-%(version)s/"
configopts += " -DHIP_COMMON_DIR=%(builddir)s/HIP-rocm-%(version)s/"
configopts += " -DHIP_PLATFORM=amd"
configopts += " -DOFFLOAD_ARCH_STR='%s'" % local_default_gfx
configopts += " -DROCCLR_PATH=%(builddir)s/ROCclr-rocm-%(version)s/"

postinstallcmds = [
'sed -i "s|HIP_CLANG_INCLUDE_PATH = .*|'
'HIP_CLANG_INCLUDE_PATH = \\$ENV{\"HIP_CLANG_INCLUDE_PATH\"};|g" %(installdir)s/bin/hipcc',
'sed -i "s|ROCM_AGENT_ENUM = .*|ROCM_AGENT_ENUM = \"rocm_agent_enumerator\";|g" %(installdir)s/bin/hipcc',
]

sanity_check_paths = {
'files': ['bin/hipcc', 'bin/hipconfig', 'include/hip/hip_common.h', 'include/hip/hip_runtime.h',
'lib/libamdhip64.%s' % SHLIB_EXT],
'dirs': [],
}
sanity_check_commands = [
'hipcc --help',
'hipconfig --full'
]

modextravars = {
'DEVICE_LIB_PATH': '$EBROOTCLANGMINAOMP/amdgcn/bitcode',
'HIP_CLANG_INCLUDE_PATH': '$EBROOTCLANGMINAOMP/include',
'HIP_CLANG_PATH': '$EBROOTCLANGMINAOMP/bin',
'HIP_COMPILER': 'clang',
'HIP_INCLUDE_PATH': '%(installdir)s/include',
'HIP_LIB_PATH': '%(installdir)s/lib',
'HIP_PATH': '%(installdir)s',
'HIP_RUNTIME': 'rocclr',
'HSA_PATH': '$EBROOTROCRMINRUNTIME',
'ROCM_PATH': '%(installdir)s',
}

modluafooter = """
boegel marked this conversation as resolved.
Show resolved Hide resolved
setenv("DEVICE_LIB_PATH", os.getenv("EBROOTCLANGMINAOMP") .. "/amdgcn/bitcode")
setenv("HIP_CLANG_INCLUDE_PATH", os.getenv("EBROOTCLANGMINAOMP") .. "/include")
setenv("CLANG_PATH", os.getenv("EBROOTCLANGMINAOMP") .. "/bin")
setenv("HSA_PATH", os.getenv("EBROOTROCRMINRUNTIME"))
"""

moduleclass = 'tools'
34 changes: 34 additions & 0 deletions easybuild/easyconfigs/h/HIP/hipamd-rocm-4.5.0-remove-testing.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
--- hipamd-rocm-4.5.0/CMakeLists.txt.orig 2021-11-12 14:26:59.514400918 +0100
boegel marked this conversation as resolved.
Show resolved Hide resolved
+++ hipamd-rocm-4.5.0/CMakeLists.txt 2021-11-12 14:27:23.551183553 +0100
@@ -487,31 +487,6 @@
#############################
# Testing steps
#############################
-# HIT is not compatible with Windows
-if(NOT WIN32)
-set(HIP_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR})
-set(HIP_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
-if(HIP_PLATFORM STREQUAL "nvidia")
- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${HIP_ROOT_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-endif()
-execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_INCLUDE_DIR}/hip/" "${HIP_ROOT_DIR}/include/hip/" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_DIR}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-if(${RUN_HIT} EQUAL 0)
- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_BIN_DIR}" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-endif()
-if(HIP_CATCH_TEST EQUAL "1")
- enable_testing()
- add_subdirectory(${HIP_COMMON_DIR}/tests/catch ${PROJECT_BINARY_DIR}/catch)
-else()
- if(${RUN_HIT} EQUAL 0)
- set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
- include(${HIP_COMMON_DIR}/tests/hit/HIT.cmake)
- include(${HIP_COMMON_DIR}/tests/Tests.cmake)
- else()
- message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location")
- endif()
-endif()
-endif()

#############################
# Code analysis