summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Ulyanov <disinbox@gmail.com>2023-02-26 18:11:04 +0300
committerIgor Ulyanov <disinbox@gmail.com>2023-02-26 18:11:04 +0300
commite887439e0c8124bf0a6fa153257720c3a36601e5 (patch)
tree34ab090d3b4c2780c0ce3e420c2ea2fc4a2a2e66
parentinitial enable ROCM useflag (diff)
downloaddisplacer-e887439e0c8124bf0a6fa153257720c3a36601e5.tar.gz
displacer-e887439e0c8124bf0a6fa153257720c3a36601e5.tar.bz2
displacer-e887439e0c8124bf0a6fa153257720c3a36601e5.zip
some rocm work for onnxruntime (still incomplete)
Signed-off-by: Igor Ulyanov <disinbox@gmail.com>
-rw-r--r--sci-libs/onnxruntime/Manifest6
-rw-r--r--sci-libs/onnxruntime/files/onnxruntime-1.9.1-HIP-REQUIRED-for-ROCM.patch25
-rw-r--r--sci-libs/onnxruntime/files/onnxruntime-1.9.1-directories-dirty-and-gfx1100-target.patch40
-rw-r--r--sci-libs/onnxruntime/files/onnxruntime-1.9.1-hip_add_library-workaround.patch24
-rw-r--r--sci-libs/onnxruntime/onnxruntime-1.9.1.ebuild3
5 files changed, 97 insertions, 1 deletions
diff --git a/sci-libs/onnxruntime/Manifest b/sci-libs/onnxruntime/Manifest
index 755eb6d..e6fcbb9 100644
--- a/sci-libs/onnxruntime/Manifest
+++ b/sci-libs/onnxruntime/Manifest
@@ -1,6 +1,10 @@
+AUX onnxruntime-1.9.1-HIP-REQUIRED-for-ROCM.patch 1050 BLAKE2B f90e4f3de9e418f14d94ad9a585331485fcc913fadd372912f0336a783ad9199057c896a7af0836ec3c4cb57505495deaf5d6971414b0b7607e3d76bf67b3cf9 SHA512 5392e6534a11b490c49cd7710f74403f68175c5a5841b05fb3caab08ac5e24d3d88874d62bb0264b2100e78508cc70dda9fc0a503c2e865dc09881dde6281558
+AUX onnxruntime-1.9.1-directories-dirty-and-gfx1100-target.patch 1647 BLAKE2B 1a346366a729fb45b84e152ad952fc377671779d13f9b3132326b02a8ee203e5cd1d27df3a099d9efb7e9bfe20e9f4efa87d449ca643f7dbd5f9b87d8b27f52a SHA512 4ad05e7891fab332959fbbfc9989362c91535e8140367937f6f8569846fb2fd3c14e0372a265ca1cc1865aaf7e345bebf9099a51bbf590ec7ef7f276cdb627c9
AUX onnxruntime-1.9.1-fix-RepeatedIterator-compile-error.patch 1356 BLAKE2B 28f8c64f1092954b36726cd5550e3db9ce84aebfe158ed987b5e31104ae73c38c59a6e94d8fdaf15ca08ce186df3fae1e0f0e9c13c3d68ea45c8d9953d6218ab SHA512 97e59b8ce0ea217b77ffdac9167c7565fc6f72c6db1bbd68e71e5b3bdc616056c4abd0aa323e36b03f065202605ede0502e3ad112c5d092e1c1b707463817f5e
AUX onnxruntime-1.9.1-get-rocm-version-from-hipconfig.patch 1848 BLAKE2B 248992b6ac21c4caa2501e326a4aa157605a3bfa84a33a397ded8937ab71dfe8253360bb6b5038aa9cdf189533accfd54aa69a2d7f74e7244f85c6f9c7f2ef3f SHA512 877c03ffe53e3d5fb24d0db103b9a031a51d998985f22d8295207159ef7cd65174c6c86ce1b179861fd40fa1abfedd01df68410b4892b5b4922ea93e65594c3a
+AUX onnxruntime-1.9.1-hip_add_library-workaround.patch 909 BLAKE2B d2faf978023637011f0b8111dc2304e8f0b08c6eb2d3d7d61072830bab275fb4d0a81d0620dd68c1d840bdc61026a9c86377191835afdfa9dd58b794006cafca SHA512 8b1fb4fdeff553a01e867b53ded9864e2ea860b9ab83566bd55f9a35a538611470993c60d802984dde453ef4e4c5e397a0961606198f7a69d6649ba9ab34f670
AUX onnxruntime-1.9.1-system_libs.patch 3196 BLAKE2B b9107002944c53daaa9ac7da7daad84366f4e3ddfec6d7af677f960fc9cb95a8370dcd109c3942ab259e9193a93985514df653f10d5e6d66b993a3a9cb938396 SHA512 5b739446c8adc0dec6442577f6fbaca57a2c0f0acce83ae20a96cf3d12218118dbc318c979b69f03aeb21b02c8b02b1c64efb2c17bfc00d846698aa5af3494a4
+AUX onnxruntime-1.9.1-uppercase-for-hip_add_library.patch 1045 BLAKE2B 5280d6ec764491593b4b7665991f215fe8169398fa65fef6184b578cf66715894cc0a2602b14c49b1544d42918f743f2a1a74d21775df4c0ccbc65f1b2b96a16 SHA512 db5a5a9b3f666079145da568aa0e8df919e5afb6421249d8bba1b74983286116be3905c358b50a06a2a232a8c5f8041c2fc5e74ef3789674d1ae0250fcb9e4ba
DIST SafeInt-a104e0cf23.tar.gz 541952 BLAKE2B 6a7d025dce9aae6090704783aef4d1e71298c6e99af1d322f2ecf6c1504bf1c0c38140255f77b6f178fe23edb61b23a633b191c1b7d2b736692ba33a27916843 SHA512 95a0784e0d79e1a712e454475d1863732b5cf03abd83687e84fc9f1b993ecf0d47a3a252cd5b86a2baea3c194406c8b4678d6d6f8d86e89a18602270ddee18b9
DIST boost_mp11-21cace4e574.tar.gz 104182 BLAKE2B 9c4c103cab0a6d738a38bc0afd7752233592f47b55434de4af15f927f1b2711ca5fc47e8a2edb5e2991e9d554ae7303dd19a0386109b470f052089b25df79101 SHA512 82b32466c2287f87b16b3244793dac6eb1a34c52f3ebabf5a19f1f2527253e14f23349290e5ba9b5171503e2392debc7e1e4c75ce5fa0c7c9778afe658984423
DIST flatbuffers-1.12.0.tar.gz 1145348 BLAKE2B 441123be124ad851efa30bda0d828a764ebaf79ba6692a6e5904000b33818e9de78c3a964037ac93ef562890980c58169141e55354dce86857c02bcd917150d6 SHA512 8a0b88d739fa4694a69d3630140fe89fdd70d50bba4dadd1758d9aa2920cda16700bcafb8d89fe2a09ac907d3f378240c3cb4abc7106318136799836aba4b063
@@ -10,4 +14,4 @@ DIST onnxruntime-1.9.1.tar.gz 290241910 BLAKE2B c0bbd2f987978f1d995c652904a79af3
DIST optional-lite-4acf4553ba.tar.gz 48384 BLAKE2B 63c310bb115310df95a3a95fd917b2c9c0dd91533aec06390a285d923f8b80f1f6a9322fae6837d2bcc933e5b0261ea1262157f177960a47fad48fa4a0135aa9 SHA512 f3ab8dc3b6705ebd201943cbcdce5cf5c75b1ced317561890d74be351e707b65db4a6b3bce6bef91f94d28c68715e58be9c7b522adec93c1acbb31ceb8fc0447
DIST pytorch-cpuinfo-5916273f79.tar.gz 3496223 BLAKE2B 4da452faf12138fbc1abd266d8ae6e0a0192f48a84faccb55fd05c3ac85d0bea2ecbd80b5eda69bb51c6704a223f90dd83d1f0fc79d56d35dd21cae5c5b8fab5 SHA512 50e537b61d991e8579577fb1ecf8d9ceb2171dbad96dfe159a062eadfdc0b2372b94988fc6f223c20e327453c7f55042ee06779f5b5fe0922f4470f746c9686b
EBUILD onnxruntime-1.14.0.ebuild 2308 BLAKE2B f2eb8bd3eb866288c2f6369487a7e765ffe2bf718879856892b8fb57752cbbb71ff98bf1fad465b65ab473e8bb9abfffd0bddbda2441e88ba195056b1d395c82 SHA512 917297f36e05512756fd6f13f54ec0a413709585413320c9e6a26428a886c3c5935d8a91d3823109858392cd9173b3f72bd83a89f6453d3c83d0bc0bef2099e6
-EBUILD onnxruntime-1.9.1.ebuild 3303 BLAKE2B d591c0990b5d6789500ffebfa2355a0c4f6489d948e8641dda383d41848e3071bd37c20153e3b4a27c5e88c6e87d1388d478eb484363710ebf0c4898271fd738 SHA512 65f3289eeb1355424d1d3cae56259ca6ee0fb2c4fd27ee6e8113535759685c60b8a133fddc5f36be949399447e07fdae019dbe7616c8620addeebf0f728f5627
+EBUILD onnxruntime-1.9.1.ebuild 3488 BLAKE2B 99adde17cc42157c689b74aa1d0cb83a13ad8f3ceb093b4278ba4d5ab5425f1742ec4b6ccb89bea7963f7cd8a243c2269700ebec394a61622407025d752b87ce SHA512 f381053696cfba972dc8f0ac082f872d91dd60fca288903c41bb7717425557b4e9a1c5328f3eefb558d95853c00ed6ace80632d4542f650ad4e3d351ee23cc35
diff --git a/sci-libs/onnxruntime/files/onnxruntime-1.9.1-HIP-REQUIRED-for-ROCM.patch b/sci-libs/onnxruntime/files/onnxruntime-1.9.1-HIP-REQUIRED-for-ROCM.patch
new file mode 100644
index 0000000..3053340
--- /dev/null
+++ b/sci-libs/onnxruntime/files/onnxruntime-1.9.1-HIP-REQUIRED-for-ROCM.patch
@@ -0,0 +1,25 @@
+From 124512ae9351bc0e704c6349902a6f446792a85e Mon Sep 17 00:00:00 2001
+From: Igor Ulyanov <disinbox@gmail.com>
+Date: Sun, 26 Feb 2023 12:44:18 +0300
+Subject: [PATCH] HIP REQUIRED for ROCM
+
+---
+ cmake/onnxruntime_providers.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/onnxruntime_providers.cmake b/cmake/onnxruntime_providers.cmake
+index 5b5ff585ca..ee847b2ec8 100644
+--- a/onnxruntime-1.9.1/cmake/onnxruntime_providers.cmake
++++ b/onnxruntime-1.9.1/cmake/onnxruntime_providers.cmake
+@@ -1008,7 +1008,7 @@ if (onnxruntime_USE_ROCM)
+ list(APPEND CMAKE_PREFIX_PATH ${onnxruntime_ROCM_HOME} ${onnxruntime_ROCM_HOME}/hip ${onnxruntime_ROCM_HOME}/hcc ${onnxruntime_ROCM_HOME}/miopen ${onnxruntime_ROCM_HOME}/hiprand ${onnxruntime_ROCM_HOME}/rocrand)
+
+ set(CMAKE_MODULE_PATH "${onnxruntime_ROCM_HOME}/hip/cmake" ${CMAKE_MODULE_PATH})
+- find_package(HIP)
++ find_package(HIP REQUIRED)
+ find_package(hiprand REQUIRED)
+ find_library(HIP_LIB amdhip64 REQUIRED)
+ find_library(ROC_BLAS rocblas REQUIRED)
+--
+2.39.1
+
diff --git a/sci-libs/onnxruntime/files/onnxruntime-1.9.1-directories-dirty-and-gfx1100-target.patch b/sci-libs/onnxruntime/files/onnxruntime-1.9.1-directories-dirty-and-gfx1100-target.patch
new file mode 100644
index 0000000..0abd819
--- /dev/null
+++ b/sci-libs/onnxruntime/files/onnxruntime-1.9.1-directories-dirty-and-gfx1100-target.patch
@@ -0,0 +1,40 @@
+From d62ce01a096db93cf4f22ca12681bdead9d0d64b Mon Sep 17 00:00:00 2001
+From: Igor Ulyanov <disinbox@gmail.com>
+Date: Sun, 26 Feb 2023 16:19:31 +0300
+Subject: [PATCH] directories (dirty) and gfx1100 target
+
+---
+ cmake/onnxruntime_providers.cmake | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/cmake/onnxruntime_providers.cmake b/cmake/onnxruntime_providers.cmake
+index ea465ca817..6eb3f30fc8 100644
+--- a/onnxruntime-1.9.1/cmake/onnxruntime_providers.cmake
++++ b/onnxruntime-1.9.1/cmake/onnxruntime_providers.cmake
+@@ -1016,6 +1016,14 @@ if (onnxruntime_USE_ROCM)
+ find_library(RCCL_LIB rccl REQUIRED)
+ set(ONNXRUNTIME_ROCM_LIBS ${HIP_LIB} ${ROC_BLAS} ${MIOPEN_LIB} ${RCCL_LIB})
+
++ include_directories("/usr/include/rocblas/")
++ include_directories("/usr/include/miopen/")
++ include_directories("/usr/include/rccl/")
++ include_directories("/usr/include/rocsparse/")
++ include_directories("/usr/include/hipsparse/")
++ include_directories("/usr/include/hiprand/")
++ include_directories("/usr/include/hipfft/")
++
+ file(GLOB_RECURSE onnxruntime_providers_rocm_cc_srcs CONFIGURE_DEPENDS
+ "${ONNXRUNTIME_ROOT}/core/providers/rocm/*.h"
+ "${ONNXRUNTIME_ROOT}/core/providers/rocm/*.cc"
+@@ -1099,7 +1107,7 @@ if (onnxruntime_USE_ROCM)
+ list(APPEND HIP_CLANG_FLAGS -fno-gpu-rdc)
+
+ # Generate GPU code for GFX9 Generation
+- list(APPEND HIP_CLANG_FLAGS --amdgpu-target=gfx906 --amdgpu-target=gfx908)
++ list(APPEND HIP_CLANG_FLAGS --amdgpu-target=gfx1100)
+
+ include("/usr/lib64/cmake/hip/FindHIP.cmake")
+ hip_add_library(onnxruntime_providers_rocm ${onnxruntime_providers_rocm_src})
+--
+2.39.1
+
diff --git a/sci-libs/onnxruntime/files/onnxruntime-1.9.1-hip_add_library-workaround.patch b/sci-libs/onnxruntime/files/onnxruntime-1.9.1-hip_add_library-workaround.patch
new file mode 100644
index 0000000..21ae344
--- /dev/null
+++ b/sci-libs/onnxruntime/files/onnxruntime-1.9.1-hip_add_library-workaround.patch
@@ -0,0 +1,24 @@
+From 0ddc72085b33e7f099dc1e7aaf17964226b6e266 Mon Sep 17 00:00:00 2001
+From: Igor Ulyanov <disinbox@gmail.com>
+Date: Sun, 26 Feb 2023 15:43:48 +0300
+Subject: [PATCH] hip_add_library workaround
+
+---
+ cmake/onnxruntime_providers.cmake | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cmake/onnxruntime_providers.cmake b/cmake/onnxruntime_providers.cmake
+index ee847b2ec8..ea465ca817 100644
+--- a/onnxruntime-1.9.1/cmake/onnxruntime_providers.cmake
++++ b/onnxruntime-1.9.1/cmake/onnxruntime_providers.cmake
+@@ -1101,6 +1101,7 @@ if (onnxruntime_USE_ROCM)
+ # Generate GPU code for GFX9 Generation
+ list(APPEND HIP_CLANG_FLAGS --amdgpu-target=gfx906 --amdgpu-target=gfx908)
+
++ include("/usr/lib64/cmake/hip/FindHIP.cmake")
+ hip_add_library(onnxruntime_providers_rocm ${onnxruntime_providers_rocm_src})
+
+ target_link_libraries(onnxruntime_providers_rocm PRIVATE ${ONNXRUNTIME_ROCM_LIBS})
+--
+2.39.1
+
diff --git a/sci-libs/onnxruntime/onnxruntime-1.9.1.ebuild b/sci-libs/onnxruntime/onnxruntime-1.9.1.ebuild
index d6d82b3..7c23cab 100644
--- a/sci-libs/onnxruntime/onnxruntime-1.9.1.ebuild
+++ b/sci-libs/onnxruntime/onnxruntime-1.9.1.ebuild
@@ -61,6 +61,9 @@ src_unpack() {
unpack ${A}
fi
eapply "${FILESDIR}/${P}-fix-RepeatedIterator-compile-error.patch"
+ eapply "${FILESDIR}/${P}-HIP-REQUIRED-for-ROCM.patch"
+ eapply "${FILESDIR}/${P}-hip_add_library-workaround.patch"
+ eapply "${FILESDIR}/${P}-directories-dirty-and-gfx1100-target.patch"
}
src_prepare() {