summaryrefslogtreecommitdiff
path: root/dev-util/hip
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-11-19 05:02:03 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-11-19 05:02:03 +0000
commitf9a583991092848eb54269744b512063a4d59de0 (patch)
treed5a2138990dac6dca951c93dbd3640fa530e6268 /dev-util/hip
parent62fedf7d848a64953dc84844e401364176b10da7 (diff)
gentoo auto-resync : 19:11:2023 - 05:02:03
Diffstat (limited to 'dev-util/hip')
-rw-r--r--dev-util/hip/Manifest6
-rw-r--r--dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch13
-rw-r--r--dev-util/hip/files/hip-5.7.1-exec-stack.patch31
-rw-r--r--dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch67
-rw-r--r--dev-util/hip/files/hip-5.7.1-no_asan_doc.patch17
-rw-r--r--dev-util/hip/hip-5.7.1.ebuild9
6 files changed, 139 insertions, 4 deletions
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index 3a0ccd3cf45e..35db3797ba45 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -25,6 +25,10 @@ AUX hip-5.4.3-correct-ldflag.patch 1173 BLAKE2B 170bc09a606fc2cb0cb5e7bb8615b545
AUX hip-5.4.3-fix-HIP_CLANG_PATH-detection.patch 921 BLAKE2B ab06b3ff6d5b005929c42ec49819c09843ab25c31b5d6248938216ca0471034140d4ac289e9496d40140e9b8f0b04f893eab0491c857bc02ba366b3c91447e92 SHA512 96f0fe6806c914c1fd33b832427703684f495158b64c5e831081ecd421043749adb50cbf65b03c2297f9dabf9fb6a22ea931ac8d74db9c31baac31477e4af873
AUX hip-5.5.1-disable-Werror.patch 748 BLAKE2B 965af2240c72e22706c5b1ecb414954ba7b63ba7a9d3535fb00ad754d10813a054721e80a47246cbf4dc06d6e98f25c67fc7cbd54cd9187e59ae6e8e7691d2d3 SHA512 4f5decfe61fa26da0b2159bd8874c83ff047bc5c7f2b2f023490a6bc3c97f588ec80df90c731a7c03b8ea1443a88dac9fbde1b46c5ac4f4a8a59ec4b35ef1bde
AUX hip-5.7.0-install.patch 576 BLAKE2B b3c5437a81bcc901327ba4ee9419ad77ea94aab3f6df49c1ce581fd5dad9321d7ffe4d81e1991476978690811d748ee8600dbdf9d70151cfdfb348130e18efdc SHA512 28301e939b3dc49c47d5db16d11b580dbedd47796a2765afab2b535fcd005d4a909f54865f044f0bacb0470ca2e29e529d1511c8bf4d037987bc046704e8e9eb
+AUX hip-5.7.1-disable-stack-protector.patch 771 BLAKE2B 46ea4b48ae32c7e120418fec467fedc7c496fec2c0589c04e4b62a0afe9b7e6b6e9aae8a4502d5772eefc07c5f71d39b37e4a47d1796d7688b1804814a0274da SHA512 30b82c3b8e7403e8098d1d564c94a85cd29fbf0d6fb4d4af26874bbc5ed03477933fb61064d57c2e2c724182b4816598752b38b1bb9f9384685be72a774d81af
+AUX hip-5.7.1-exec-stack.patch 1136 BLAKE2B b45560c1cd3410ba9340d5dea7fc2ab7167126a3dbcee6fdaa5ccdab6140db8a6ce9c9f588451f77a1cd27154551a4cb00743d7b2ac3dcb6c36e87f2bc182fe1 SHA512 66a6a9518975a9702f365ae6e9b09835ff93cde49209714b4cbb19c375052859ac26f3d4d2b61052280eee93e237f930a4b7b2d837245a7d477e30893ca6a0b4
+AUX hip-5.7.1-fix-unaligned-access.patch 3011 BLAKE2B d8a6a130edcf51c40e88250508ff3db13f134fb3833d1eadfac32dfdee09c7635091b1f32ed640bcba0c5ca2b745c401183ee8adaa392977ecece12a03450f9e SHA512 f9b85117927d18921d939daa73d2d97477bb49eb6ff7e496f9b110b8e70e00734b698517ae4235a03c560bdfc3618367d7eb2970c9d90dc2bcf07e2ab803d994
+AUX hip-5.7.1-no_asan_doc.patch 817 BLAKE2B 4bc80470f9cb476289086ae561560bb54fcdd9d1e66ef420dc60f129f29b0de02025be0ed2a7bfd2143b9bc0b456a354abc574dcbff509872a35e2e0c06f7760 SHA512 10a97524acce0c45c8edeccd11b64445f6edeb380e8262e1fc63163c4758efd731af36701dae1c9988264e8ce10971c9b3959ea881e81646994c779a96d10bb9
AUX hipvars-5.1.3.pm 629 BLAKE2B 6149f230aa0756603ac0b455d802db9c698be8e4a22367e98915db974ea16176f85f9b5a22e2572183641734cedbbe2ba2c826aa0223ea3e12c5550983db0480 SHA512 26ba459b13df1ad6dc50411ac6589dd3d17eff727fee0e938275912e36459c7a43b35233a7f78bbed282a992e969d8b8f95007964c810a5954b0abeccc67082d
AUX hipvars-5.3.3.pm 581 BLAKE2B edf0c1df5f7f5c57189c76fbcedec8155072a9f8e2c580d637dcfb557a844e7cc276b754d0fd8f5a9f59d2c5bbcfda6c9ac9951ad16d8a12bb48e74f062987ab SHA512 9fd72b000f59ec25a74ef5965f4affc5e866025424211b4d81fbea979ffba9f08319dde0063c8c835507a1b9db990f8f25eea3a8e2e6d88faceaf34d5dd722cb
AUX hipvars.pm 598 BLAKE2B 1645b12179195b95757d207248c85b7c8d9eda0347caee5cb48bdc66e85fda517f607bcb69cdfc63657a0db04ad8e96494a0a80268df7c17d6bb0e689325c2e8 SHA512 6c4e71455341673a329b4b0163fefd7f2f4b7d62da3496643d0de096755899c99b3b5a80fffbdf29896c234cb4f617b368217f4eecfd005849b294ff434b79c6
@@ -54,5 +58,5 @@ EBUILD hip-5.1.3-r4.ebuild 6638 BLAKE2B 4ccc536736e737f0066ab4f200a5ea76a9f16ede
EBUILD hip-5.3.3-r3.ebuild 5346 BLAKE2B 4f5c0570e8a4ff65ac0b11bc555e2f81f7c6e56cc3ff86de894536b3b0597c049216a9d4184e25471999c4cf73b8f774daf1bb46d613c830bcc0d8c445f85b74 SHA512 9a54281155f14f467286d132ec405b90703b94760b8f4e268aed77b4a47d8a195febef3200068d0e5905cf7078fb92e2252b6ab7a3b86e40d330449315c0cf4d
EBUILD hip-5.4.3.ebuild 5239 BLAKE2B 74d5423c5f7c01f15c5583b2c53420b1780fa7fdb11581fef2f0570be11a2047a43881a13b41b333905faaafab7dee15e1fb4af96703829cdab7d547e2cb5796 SHA512 7b2f5abfbc2ded1751b3d32349eb81715468125e9a9cc64522b725ed9a92f0dbf6e575fd1b84ab5234532badbf3a6b0c4d3a5b375384665ab413b22c54a5ee3e
EBUILD hip-5.5.1.ebuild 5244 BLAKE2B aa1f937c5f2651ad3e79898ffc427696253c619583cd1450f1a3e7b9a7448e0d750f5df72a87458dfe6107f2f8846bc2b9b064d54b0b849fc3812a4f268c4af1 SHA512 94cad30f1f0e3e376a5902c83a151d3fe2a7b72b45747672e96b9d13dedadc7184c8f714789ff3e436133ffb8a7d58e8194471c843c694d3d39c348fd7d5a3ab
-EBUILD hip-5.7.1.ebuild 2099 BLAKE2B 6ba5a8612ae642efafecd654775564ea2dfe6f8b9d9099d60ee60a0504758731d89a56a56b8895ebb8adf94a4ebd8f530f5a027bb14110e2a8b0277d5f891313 SHA512 a2197c7bb895783c7823e9025381193428360c15575f1ab173c76cd7ddac2c7c57582ad7e69fda4d593cb410be7360da687fab7927f3381f8fdbc5f7db80ef8e
+EBUILD hip-5.7.1.ebuild 2299 BLAKE2B 6f6419e5f7c38dbb0a11f897bb84ce198c9e31ce5e6076f98a2fb32eaab73e60c14a3ef610ae961d033c22b507db78347bb8c3cedc5026d4c26a50fa7c6dcba6 SHA512 fce62dad1b19269ee9efa89d1c1552f89987c3587a0eaf332dedc2bc03726da59710c8e0372bf527573ea2d3ab752347c64072b73fcd727d4ad9cf58631e3fc8
MISC metadata.xml 729 BLAKE2B 92e36c42f6d8335e5a8e3a86b591ff9e6306e0d187644620fab7f8f7ddd00156ee91ff49184ffbe379e509f2096c51c421575a69de7abea3c0b372fdcec52ccb SHA512 84fc8234a5fdf54bf43228c2144d809a461862fb45fea24bf366ee5937df3882c3332429938792981e37dbb4cda6e5d7e05ac5deaded34d8bcce1eb53df8d0fd
diff --git a/dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch b/dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch
new file mode 100644
index 000000000000..49d944ef4bc9
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch
@@ -0,0 +1,13 @@
+Disable stack-protector (which is enabled by default gentoo-hardened) in device code.
+This is not required after https://github.com/llvm/llvm-project/pull/70799, but helps with older clang.
+Upstream bug: https://github.com/ROCm-Developer-Tools/clr/issues/21
+--- a/hipamd/src/hiprtc/hiprtcInternal.cpp
++++ b/hipamd/src/hiprtc/hiprtcInternal.cpp
+@@ -144,6 +144,7 @@ RTCCompileProgram::RTCCompileProgram(std::string name_) : RTCProgram(name_), fgp
+ compile_options_.push_back("-nogpuinc");
+ compile_options_.push_back("-Wno-gnu-line-marker");
+ compile_options_.push_back("-Wno-missing-prototypes");
++ compile_options_.push_back("-fno-stack-protector");
+ #ifdef _WIN32
+ compile_options_.push_back("-target");
+ compile_options_.push_back("x86_64-pc-windows-msvc");
diff --git a/dev-util/hip/files/hip-5.7.1-exec-stack.patch b/dev-util/hip/files/hip-5.7.1-exec-stack.patch
new file mode 100644
index 000000000000..744ca7b953c3
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-exec-stack.patch
@@ -0,0 +1,31 @@
+Upstream bug: https://github.com/ROCm-Developer-Tools/clr/issues/22
+--- a/hipamd/src/hip_embed_pch.sh
++++ b/hipamd/src/hip_embed_pch.sh
+@@ -178,6 +178,7 @@ EOF
+
+ echo "// Automatically generated script for HIP RTC." > $mcinFile
+ if [[ $isWindows -eq 0 ]]; then
++ echo " .section .note.GNU-stack,"",%progbits" >> $mcinFile
+ echo " .type __hipRTC_header,@object" >> $mcinFile
+ echo " .type __hipRTC_header_size,@object" >> $mcinFile
+ fi
+--- a/hipamd/src/hiprtc/cmake/HIPRTC.cmake
++++ b/hipamd/src/hiprtc/cmake/HIPRTC.cmake
+@@ -98,6 +98,7 @@ macro(generate_hiprtc_mcin HiprtcMcin HiprtcPreprocessedInput)
+ set(HIPRTC_TYPE_LINUX_ONLY "")
+ else()
+ set(HIPRTC_TYPE_LINUX_ONLY
++ " .section .note.GNU-stack,\"\",%progbits\n"
+ " .type __hipRTC_header,@object\n"
+ " .type __hipRTC_header_size,@object")
+ endif()
+--- a/hipamd/src/hip_embed_pch.sh
++++ b/hipamd/src/hip_embed_pch.sh
+@@ -111,6 +111,7 @@ cat >$tmp/hip_pch.h <<EOF
+ EOF
+
+ cat >$tmp/hip_pch.mcin <<EOF
++ .section .note.GNU-stack,"",%progbits
+ .type __hip_pch_wave32,@object
+ .section .hip_pch_wave32,"aMS",@progbits,1
+ .data
diff --git a/dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch b/dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch
new file mode 100644
index 000000000000..ae2092f6e1ac
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch
@@ -0,0 +1,67 @@
+Fix SIGSEGV when compiled with avx-512 instructions.
+
+Due to unaligned allocations, library crashes in
+nontemporalMemcpy in _mm512_stream_si512 (which requires
+64-aligned allocations, but used to copy default-aligned objects).
+
+Without this patch hipamd causes random crashes in hipMemcpy* callers
+(tensile, rocBLAS, miopen, rocThrust, etc.).
+
+Bug: https://bugs.gentoo.org/915969
+Bug report in upstream: https://github.com/ROCm-Developer-Tools/clr/issues/18
+--- a/rocclr/device/rocm/rocvirtual.cpp
++++ b/rocclr/device/rocm/rocvirtual.cpp
+@@ -2790,44 +2790,6 @@ bool VirtualGPU::createVirtualQueue(uint deviceQueueSize)
+ return true;
+ }
+
+-// ================================================================================================
+-__attribute__((optimize("unroll-all-loops"), always_inline))
+-static inline void nontemporalMemcpy(void* __restrict dst, const void* __restrict src,
+- uint16_t size) {
+- #if defined(__AVX512F__)
+- for (auto i = 0u; i != size / sizeof(__m512i); ++i) {
+- _mm512_stream_si512(reinterpret_cast<__m512i* __restrict&>(dst)++,
+- *reinterpret_cast<const __m512i* __restrict&>(src)++);
+- }
+- size = size % sizeof(__m512i);
+- #endif
+-
+- #if defined(__AVX__)
+- for (auto i = 0u; i != size / sizeof(__m256i); ++i) {
+- _mm256_stream_si256(reinterpret_cast<__m256i* __restrict&>(dst)++,
+- *reinterpret_cast<const __m256i* __restrict&>(src)++);
+- }
+- size = size % sizeof(__m256i);
+- #endif
+-
+- for (auto i = 0u; i != size / sizeof(__m128i); ++i) {
+- _mm_stream_si128(reinterpret_cast<__m128i* __restrict&>(dst)++,
+- *(reinterpret_cast<const __m128i* __restrict&>(src)++));
+- }
+- size = size % sizeof(__m128i);
+-
+- for (auto i = 0u; i != size / sizeof(long long); ++i) {
+- _mm_stream_si64(reinterpret_cast<long long* __restrict&>(dst)++,
+- *reinterpret_cast<const long long* __restrict&>(src)++);
+- }
+- size = size % sizeof(long long);
+-
+- for (auto i = 0u; i != size / sizeof(int); ++i) {
+- _mm_stream_si32(reinterpret_cast<int* __restrict&>(dst)++,
+- *reinterpret_cast<const int* __restrict&>(src)++);
+- }
+-}
+-
+ // ================================================================================================
+ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
+ const amd::Kernel& kernel, const_address parameters, void* eventHandle,
+@@ -3096,7 +3058,7 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
+ argBuffer = reinterpret_cast<address>(allocKernArg(gpuKernel.KernargSegmentByteSize(),
+ gpuKernel.KernargSegmentAlignment()));
+ // Load all kernel arguments
+- nontemporalMemcpy(argBuffer, parameters,
++ memcpy(argBuffer, parameters,
+ std::min(gpuKernel.KernargSegmentByteSize(),
+ signature.paramsSize()));
+ }
diff --git a/dev-util/hip/files/hip-5.7.1-no_asan_doc.patch b/dev-util/hip/files/hip-5.7.1-no_asan_doc.patch
new file mode 100644
index 000000000000..40de416334be
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-no_asan_doc.patch
@@ -0,0 +1,17 @@
+Donot install -asan documents.
+
+Reference:
+https://github.com/RadeonOpenCompute/llvm-project/commit/e782e09f7b113a0f896c6cec7240d411aca1d73f
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/issues/61
+
+--- a/hipamd/packaging/CMakeLists.txt 2023-11-18 23:25:45.000000000 +0800
++++ b/hipamd/packaging/CMakeLists.txt 2023-11-18 23:27:27.230354665 +0800
+@@ -36,8 +36,6 @@
+ ###Set License####
+ set(CPACK_RESOURCE_FILE_LICENSE ${hip_SOURCE_DIR}/LICENSE.txt)
+ install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT binary)
+-# install license file in share/doc/hip-asan folder
+-install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}-asan COMPONENT asan)
+ set(CPACK_RPM_PACKAGE_LICENSE "MIT")
+ #Begin binary files install
+ if(HIP_PLATFORM STREQUAL "amd" )
diff --git a/dev-util/hip/hip-5.7.1.ebuild b/dev-util/hip/hip-5.7.1.ebuild
index 0bba0d2f560b..c9094afe5ba6 100644
--- a/dev-util/hip/hip-5.7.1.ebuild
+++ b/dev-util/hip/hip-5.7.1.ebuild
@@ -35,8 +35,12 @@ RDEPEND="${DEPEND}
>=dev-libs/roct-thunk-interface-5"
PATCHES=(
- "${FILESDIR}/hip-5.7.0-install.patch"
- )
+ "${FILESDIR}/${PN}-5.7.0-install.patch"
+ "${FILESDIR}/${PN}-5.7.1-fix-unaligned-access.patch"
+ "${FILESDIR}/${PN}-5.7.1-exec-stack.patch"
+ "${FILESDIR}/${PN}-5.7.1-disable-stack-protector.patch"
+ "${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
+)
S="${WORKDIR}/clr-rocm-${PV}/"
@@ -72,7 +76,6 @@ src_compile() {
}
src_install() {
-
cmake_src_install
rm "${ED}/usr/include/hip/hcc_detail" || die