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

Respect CMAKE_PLATFORM_NO_VERSIONED_SONAME when installing libraries. #65

Open
wants to merge 36 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8c8c00f
Promote till commit '667f048d187af06e1ed8aa84a387da68a1ba0e76'
mangupta Apr 21, 2023
5cba302
Promote till commit '636983de499beb115e88e72f84f6d1e32f2c6b59'
mangupta May 2, 2023
53bdffa
SWDEV-1 - - Switch to new patch version
mangupta May 2, 2023
2079243
SWDEV-403384 - Change OpenCL version number from 3581 to 3582
gargrahul May 31, 2023
07a6392
Promote till commit '15bafc9a935cfbdf3ea4878ee8ef8ec2db521e96'
mangupta Jun 7, 2023
c080c14
SWDEV-1 - Bump OpenCL build number to 3583
gargrahul Jun 15, 2023
cc9c187
Promote till commit '90f53925a3c39d0855a903ccc97f2ba5d5258ba6'
mangupta Jul 12, 2023
276d659
SWDEV-2 - Change OpenCL version number from 3583 to 3588
mangupta Jul 12, 2023
a835d18
Promote till commit '7912f3af89e1afdb856da24f5ebc9f60283951e0'
mangupta Jul 19, 2023
f5021ed
SWDEV-2 - Change OpenCL version number from 3588 to 3590
mangupta Jul 19, 2023
1a52c4f
Promote till commit d18f4b1ad406b6ab6d28e44437adf7928c42148e
rakesroy Aug 24, 2023
cefafdb
SWDEV-2 - Change OpenCL version number from 3590 to 3594
rakesroy Aug 24, 2023
a09af41
Promote till commit 9bd592e2ff3c99cdf26dbd4d1b1e1b181f605609
rakesroy Sep 5, 2023
fe4cce8
SWDEV-2 - Change OpenCL version number from 3594 to 3596
rakesroy Sep 5, 2023
315c7d0
Promote till commit 'fbea58ba117c96f80f6d5a2911bb941f7b1f7d23'
rakesroy Sep 29, 2023
dd55732
SWDEV-2 - Change OpenCL version number from 3596 to 3600
rakesroy Sep 29, 2023
c87c347
Promote till commit 2535fac29634a06c7da5cc570e4645cf8481fd8d
rakesroy Oct 16, 2023
a505a6a
SWDEV-2 - Change OpenCL version number from 3600 to 3602
rakesroy Oct 16, 2023
e8a5220
SWDEV-418100 - Move nv headers to hipother repo
mangupta Oct 7, 2023
9a64e55
SWDEV-422808 - Add entries for missing hipDataType
cjatin Nov 1, 2023
348f1a1
SWDEV-389530 - [ABI Break]Match error with cuda
shadidashmiz Oct 12, 2023
0bf2a98
SWDEV-388256 - Add support of hipExtGetLastError
gargrahul Nov 9, 2023
2c7230d
SWDEV-332969 - [ABI Break]Substitute hipArray* with hipArray_t
shadidashmiz Jul 25, 2023
c4f3303
SWDEV-371332 - [ABI Break] Return success for unregistered ptr
shadidashmiz Aug 2, 2023
037fae9
SWDEV-415029 - [ABI Break] Remove hcc symbols
tomsang Aug 2, 2023
50b6ef2
SWDEV-427522 - Address MIGraphX failures due to unsafe buffer access …
satyanveshd Nov 7, 2023
9a6a352
SWDEV-431560 - use XCC_ID in __smid() for gfx941 and gfx942
jlgreathouse Nov 8, 2023
1a0330d
SWDEV-430415 - Bundle libamdhip64.so.5 in runtime package
mangupta Nov 2, 2023
4d0aa65
SWDEV-427855, SWDEV-306642 - CLR change for profiler, and Add texture…
jiabaxie Nov 14, 2023
0b5cd74
SWDEV-433937 - Bundling libamdhip64.so.5 is optional
mangupta Nov 24, 2023
b1765c4
SWDEV-425568, SWDEV-433511 - Do cpu wait for device sync.
jaydeeppatel1111 Oct 18, 2023
c2bf552
SWDEV-425449 - Move ptrdiff_t & clock_t to hiprtc.cmake.
jaydeeppatel1111 Oct 10, 2023
d62f6a1
SWDEV-422771 - Update Change Log
gargrahul Dec 6, 2023
a75072c
SWDEV-438181 - check stream associated with event
cjatin Dec 20, 2023
204d35d
SWDEV-434170 /SWDEV-432684 /SWDEV-433437 - Fix test_gpu_jit MIGraphx…
satyanveshd Dec 7, 2023
782f954
Respect CMAKE_PLATFORM_NO_VERSIONED_SONAME when installing libraries.
stellaraccident Mar 12, 2024
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
85 changes: 84 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,97 @@

Full documentation for HIP is available at [docs.amd.com](https://docs.amd.com/)

## (Unreleased) HIP 6.0 (For ROCm 6.0)
## HIP 6.0 (For ROCm 6.0)
### Optimizations

### Added
- Addition of hipExtGetLastError
- AMD backend specific API, to return error code from last HIP API called from the active host thread

- New fields for external resource interoperability,
- Structs
- hipExternalMemoryHandleDesc_st
- hipExternalMemoryBufferDesc_st
- hipExternalSemaphoreHandleDesc_st
- hipExternalSemaphoreSignalParams_st
- hipExternalSemaphoreWaitParams_st
- Enumerations
- hipExternalMemoryHandleType_enum
- hipExternalSemaphoreHandleType_enum
- hipExternalMemoryHandleType_enum

- New members are added in HIP struct hipDeviceProp_t, for new feature capabilities including,
- Texture
- int maxTexture1DMipmap;
- int maxTexture2DMipmap[2];
- int maxTexture2DLinear[3];
- int maxTexture2DGather[2];
- int maxTexture3DAlt[3];
- int maxTextureCubemap;
- int maxTexture1DLayered[2];
- int maxTexture2DLayered[3];
- int maxTextureCubemapLayered[2];
- Surface
- int maxSurface1D;
- int maxSurface2D[2];
- int maxSurface3D[3];
- int maxSurface1DLayered[2];
- int maxSurface2DLayered[3];
- int maxSurfaceCubemap;
- int maxSurfaceCubemapLayered[2];
- Device
- hipUUID uuid;
- char luid[8];
-- this is 8-byte unique identifier. Only valid on windows
-- LUID (Locally Unique Identifier) is supported for interoperability between devices.
- unsigned int luidDeviceNodeMask;
Note: HIP supports LUID only on Windows OS.

### Changed
- Some OpenGL Interop HIP APIs are moved from the hip_runtime_api header to a new header file hip_gl_interop.h for the AMD platform, as following,
- hipGLGetDevices
- hipGraphicsGLRegisterBuffer
- hipGraphicsGLRegisterImage

### Changes Impacting Backward Incompatibility
- Data types for members in HIP_MEMCPY3D structure are changed from "unsigned int" to "size_t".
- The value of the flag hipIpcMemLazyEnablePeerAccess is changed to “0x01”, which was previously defined as “0”.
- Some device property attributes are not currently support in HIP runtime, in order to maintain consistency, the following related enumeration names are changed in hipDeviceAttribute_t
- hipDeviceAttributeName is changed to hipDeviceAttributeUnused1
- hipDeviceAttributeUuid is changed to hipDeviceAttributeUnused2
- hipDeviceAttributeArch is changed to hipDeviceAttributeUnused3
- hipDeviceAttributeGcnArch is changed to hipDeviceAttributeUnused4
- hipDeviceAttributeGcnArchName is changed to hipDeviceAttributeUnused5
- HIP struct hipArray is removed from driver type header to be comlpying with cuda
- hipArray_t replaces hipArray*, as the pointer to array.
- This allows hipMemcpyAtoH and hipMemcpyHtoA to have the correct array type which is equivalent to coresponding CUDA driver APIs.

### Fixed
- Kernel launch maximum dimension validation is added specifically on gridY and gridZ in the HIP API hipModule-LaunchKernel. As a result,when hipGetDeviceAttribute is called for the value of hipDeviceAttributeMaxGrid-Dim, the behavior on the AMD platform is equivalent to NVIDIA.
- The HIP stream synchronisation behaviour is changed in internal stream functions, in which a flag "wait" is added and set when the current stream is null pointer while executing stream synchronisation on other explicitly created streams. This change avoids blocking of execution on null/default stream.
The change won't affect usage of applications, and makes them behave the same on the AMD platform as NVIDIA.
- Error handling behavior on unsupported GPU is fixed, HIP runtime will log out error message, instead of creating signal abortion error which is invisible to developers but continued kernel execution process. This is for the case when developers compile any application via hipcc, setting the option --offload-arch with GPU ID which is different from the one on the system.

### Deprecated And Removed
- Deprecated Heterogeneous Compute (HCC) symbols and flags are removed from the HIP source code, including,
- Build options on obsolete HCC_OPTIONS was removed from cmake.
- Micro definitions are removed.
HIP_INCLUDE_HIP_HCC_DETAIL_DRIVER_TYPES_H
HIP_INCLUDE_HIP_HCC_DETAIL_HOST_DEFINES_H
- Compilation flags for the platform definitions,
AMD platform,
__HIP_PLATFORM_HCC__
__HCC__
__HIP_ROCclr__
NVIDIA platform,
__HIP_PLATFORM_NVCC__
- File directories in the clr repository are removed,
https://github.com/ROCm-Developer-Tools/clr/blob/develop/hipamd/include/hip/hcc_detail
https://github.com/ROCm-Developer-Tools/clr/blob/develop/hipamd/include/hip/nvcc_detail
- Deprecated gcnArch is removed from hip device struct hipDeviceProp_t.
- Deprecated "enum hipMemoryType memoryType;" is removed from HIP struct hipPointerAttribute_t union.
- Deprecated HIT based tests are removed from HIP project
- Catch tests are available [hip-tests] (https://github.com/ROCm-Developer-Tools/hip-tests) project

### Known Issues

Expand Down
45 changes: 15 additions & 30 deletions hipamd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ list(APPEND CMAKE_MODULE_PATH ${HIP_COMMON_DIR}/cmake)
#############################
# Options
#############################
option(BUILD_HIPIFY_CLANG "Enable building the CUDA->HIP converter" OFF)
option(__HIP_ENABLE_PCH "Enable/Disable pre-compiled hip headers" ON)
option(HIP_OFFICIAL_BUILD "Enable/Disable for mainline/staging builds" OFF)
option(HIP_OFFICIAL_BUILD "Enable/Disable for mainline/staging builds" ON)
option(FILE_REORG_BACKWARD_COMPATIBILITY "Enable File Reorg with backward compatibility" OFF)

if(MSVC)
Expand All @@ -63,6 +62,7 @@ endif()

message(STATUS "HIPCC_BIN_DIR found at ${HIPCC_BIN_DIR}")
message(STATUS "HIP_COMMON_DIR found at ${HIP_COMMON_DIR}")
message(STATUS "HIPNV_DIR found at ${HIPNV_DIR}")
set(HIP_COMMON_INCLUDE_DIR ${HIP_COMMON_DIR}/include)
set(HIP_COMMON_BIN_DIR ${HIP_COMMON_DIR}/bin)
set(__HIPCONFIG_EXECUTABLE__ ${HIP_COMMON_DIR}/bin/hipconfig)
Expand Down Expand Up @@ -270,11 +270,6 @@ set(CONFIG_PACKAGE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/hip)
set(CONFIG_LANG_PACKAGE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/hip-lang)
set(CONFIG_RTC_PACKAGE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/hiprtc)

# Build clang hipify if enabled
if (BUILD_HIPIFY_CLANG)
add_subdirectory(hipify-clang)
endif()

# Generate hip_version.h
set(_versionInfoHeader
"// Auto-generated by cmake\n
Expand Down Expand Up @@ -302,6 +297,16 @@ if(HIP_RUNTIME STREQUAL "rocclr")
add_subdirectory(src)
endif()

# Download libamdhip64.so.5
if(HIP_PLATFORM STREQUAL "amd")
if(NOT WIN32)
execute_process(COMMAND sh -c "${CMAKE_CURRENT_SOURCE_DIR}/download_libamhip64_v5.sh" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND_ECHO STDERR RESULT_VARIABLE DWLD_HIP_SO_RC)
if (DWLD_HIP_SO_RC AND NOT DWLD_HIP_SO_RC EQUAL 0)
message(FATAL_ERROR "Failed to download libamdhip64.so.5")
endif()
endif()
endif()

# Build doxygen documentation
find_program(DOXYGEN_EXE doxygen)
if(DOXYGEN_EXE)
Expand Down Expand Up @@ -363,6 +368,9 @@ if(NOT ${INSTALL_SOURCE} EQUAL 0)
endif()

install(DIRECTORY include DESTINATION .)
if(DEFINED HIPNV_DIR)
install(DIRECTORY ${HIPNV_DIR}/include/hip/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip/)
endif()
install(DIRECTORY ${HIP_COMMON_INCLUDE_DIR}/hip/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip/)
if(WIN32)
install(DIRECTORY ${HIP_COMMON_DIR}/cmake DESTINATION .)
Expand Down Expand Up @@ -461,29 +469,6 @@ if(CLANGFORMAT_EXE)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()

#############################
# 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 COPY_COMMAND_OP ERROR_QUIET)
endif()
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_INCLUDE_DIR}/hip/" "${HIP_ROOT_DIR}/include/hip/" RESULT_VARIABLE COPY_COMMAND_OP ERROR_QUIET)
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_DIR}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE COPY_COMMAND_OP ERROR_QUIET)
if(${COPY_COMMAND_OP} EQUAL 0)
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_BIN_DIR}" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE COPY_COMMAND_OP ERROR_QUIET)
endif()

file(COPY ${HIPCC_BIN_DIR}/hipcc DESTINATION ${HIP_ROOT_DIR}/bin/)
file(COPY ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION ${HIP_ROOT_DIR}/bin/)
file(COPY ${HIPCC_BIN_DIR}/hipconfig DESTINATION ${HIP_ROOT_DIR}/bin/)
file(COPY ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION ${HIP_ROOT_DIR}/bin/)
file(COPY ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION ${HIP_ROOT_DIR}/bin/)
endif()

#############################
# Code analysis
#############################
Expand Down
117 changes: 117 additions & 0 deletions hipamd/download_libamhip64_v5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#!/bin/bash
# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

function download_and_extract_deb()
{
# Download 5.7.1 hip runtime deb package
wget -O hip-runtime-amd.deb $1

# Extract libamdhip64.so.5.7.50701
dpkg-deb --fsys-tarfile hip-runtime-amd.deb | tar xf - ./opt/rocm-5.7.1/lib/libamdhip64.so.5.7.50701

# Rename to libamdhip64.so.5
mv ./opt/rocm-5.7.1/lib/libamdhip64.so.5.7.50701 libamdhip64.so.5

# Clean up
rm -r ./opt; rm hip-runtime-amd.deb
}

function download_and_extract_rpm()
{
# Download 5.7.1 hip runtime rpm package
wget -O hip-runtime-amd.rpm $1

# Extract libamdhip64.so.5.7.50701
rpm2cpio hip-runtime-amd.rpm | cpio -idm

# Rename to libamdhip64.so.5
mv ./opt/rocm-5.7.1/lib/libamdhip64.so.5.7.50701 libamdhip64.so.5

# Clean up
rm -r ./opt; rm hip-runtime-amd.rpm
}

# Detect OS
ID=$(sed -n 's/^ID=//p' /etc/os-release)
VERSION_ID=$(sed -n 's/^VERSION_ID=//p' /etc/os-release)
PLATFORM_ID=$(sed -n 's/^PLATFORM_ID=//p' /etc/os-release)
echo "ID=$ID"
echo "VERSION_ID=$VERSION_ID"
echo "PLATFORM_ID=$PLATFORM_ID"

# Download and extract libamdhip64.so.5.7.50701 based on OS
case "$ID" in
ubuntu)
# Ubuntu
if [ "$VERSION_ID" == "\"20.04\"" ]; then
# Ubuntu 20.04
download_link="https://repo.radeon.com/rocm/apt/5.7.1/pool/main/h/hip-runtime-amd/hip-runtime-amd_5.7.31921.50701-98~20.04_amd64.deb"
download_and_extract_deb $download_link
elif [ "$VERSION_ID" == "\"22.04\"" ]; then
# Ubuntu 22.04
download_link="https://repo.radeon.com/rocm/apt/5.7.1/pool/main/h/hip-runtime-amd/hip-runtime-amd_5.7.31921.50701-98~22.04_amd64.deb"
download_and_extract_deb $download_link
else
# Unknown Ubuntu version
echo "Unknown Ubuntu OS"
fi
;;
\"centos\")
# CentOS
if [ "$VERSION_ID" == "\"7\"" ]; then
# CentOS 7
download_link="https://repo.radeon.com/rocm/yum/5.7.1/main/hip-runtime-amd-5.7.31921.50701-98.el7.x86_64.rpm"
download_and_extract_rpm $download_link
else
# Unknown CentOS version
echo "Unknown CentOS"
fi
;;
\"rhel\")
# RHEL
if [ "$PLATFORM_ID" == "\"platform:el8\"" ]; then
# RHEL 8
download_link="https://repo.radeon.com/rocm/rhel8/5.7.1/main/hip-runtime-amd-5.7.31921.50701-98.el8.x86_64.rpm"
download_and_extract_rpm $download_link
elif [ "$PLATFORM_ID" == "\"platform:el9\"" ]; then
# RHEL 9
download_link="https://repo.radeon.com/rocm/rhel9/5.7.1/main/hip-runtime-amd-5.7.31921.50701-98.el9.x86_64.rpm"
download_and_extract_rpm $download_link
else
# Unknown RHEL version
echo "Unknown RHEL OS"
fi
;;
\"sles\")
# SLES
if [ "$VERSION_ID" == "\"15.4\"" ]; then
# SLES 15SP4
download_link="https://repo.radeon.com/rocm/zyp/5.7.1/main/hip-runtime-amd-5.7.31921.50701-sles154.98.x86_64.rpm"
download_and_extract_rpm $download_link
else
# Unknown SLES version
echo "Unknown SLES OS"
fi
;;
*)
echo "Unknown OS"
;;
esac
2 changes: 1 addition & 1 deletion hipamd/hip-backward-compat.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function(generate_wrapper_header)
endforeach()

#find all header files from include/hip/nvidia_detail
file(GLOB include_files ${HIP_SRC_INC_DIR}/${HIP_NVIDIA_DETAIL_DIR}/*)
file(GLOB include_files ${HIPNV_DIR}/include/hip/${HIP_NVIDIA_DETAIL_DIR}/*)
#Convert the list of files into #includes
foreach(header_file ${include_files})
# set include guard
Expand Down
2 changes: 1 addition & 1 deletion hipamd/hip-config-amd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ endif()
set(_IMPORT_PREFIX ${HIP_PACKAGE_PREFIX_DIR})
# Right now this is only supported for amd platforms
set_target_properties(hip::host PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "__HIP_PLATFORM_HCC__=1;__HIP_PLATFORM_AMD__=1"
INTERFACE_COMPILE_DEFINITIONS "__HIP_PLATFORM_AMD__=1"
)

set_target_properties(hip::amdhip64 PROPERTIES
Expand Down
9 changes: 0 additions & 9 deletions hipamd/include/hip/amd_detail/amd_channel_descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ THE SOFTWARE.
#ifndef HIP_INCLUDE_HIP_AMD_DETAIL_CHANNEL_DESCRIPTOR_H
#define HIP_INCLUDE_HIP_AMD_DETAIL_CHANNEL_DESCRIPTOR_H

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
#endif

#if !defined(__HIPCC_RTC__)
#include <hip/hip_common.h>
#include <hip/driver_types.h>
Expand Down Expand Up @@ -360,8 +355,4 @@ struct hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w,

#endif /* __cplusplus */

#if defined(__clang__)
#pragma clang diagnostic pop
#endif

#endif /* !HIP_INCLUDE_HIP_AMD_DETAIL_CHANNEL_DESCRIPTOR_H */
Loading