1 |
commit: d3a748d7b9213589a8d04e5566fcdeefd6cc8188 |
2 |
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed Jul 27 10:10:12 2022 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 28 08:16:18 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3a748d7 |
7 |
|
8 |
dev-libs/rocm-opencl-runtime: add 5.1.3 |
9 |
|
10 |
enable src_test, but it requires an actual X server (not Xvfb) |
11 |
|
12 |
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com> |
13 |
Closes: https://github.com/gentoo/gentoo/pull/26870 |
14 |
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org> |
15 |
|
16 |
dev-libs/rocm-opencl-runtime/Manifest | 2 + |
17 |
.../rocm-opencl-runtime-5.1.3-remove-clinfo.patch | 24 ++++ |
18 |
.../rocm-opencl-runtime-5.1.3.ebuild | 123 +++++++++++++++++++++ |
19 |
3 files changed, 149 insertions(+) |
20 |
|
21 |
diff --git a/dev-libs/rocm-opencl-runtime/Manifest b/dev-libs/rocm-opencl-runtime/Manifest |
22 |
index ffbadf240148..f12a4294fbcb 100644 |
23 |
--- a/dev-libs/rocm-opencl-runtime/Manifest |
24 |
+++ b/dev-libs/rocm-opencl-runtime/Manifest |
25 |
@@ -1,5 +1,6 @@ |
26 |
DIST rocclr-4.5.2.tar.gz 846950 BLAKE2B beefc6a98d9a8a1a6c00b03cbfd960215888201002f7d4a0ee079db1fc29f2faa9f53326d49c1ad00f2c3a507d5047aae8175a3abb50ae0a74ba36fdc7df9e22 SHA512 121cfb711172596d9e4d429a38fb333bbb10e427ad49cf337324dc187a04adcd99e94521cda65ba21b6ac3bfd7837f607e4c0fe38c6ebca3d58bb090128d0a43 |
27 |
DIST rocclr-5.0.2.tar.gz 853965 BLAKE2B a0d568eb3b230845970d8256a5a2f32018e4b9fb68e0f1aa13a1f3fc953e614025315b90cbe68c107f7150cf91b4b1ea438455429062c7dc06ef77d65dedd2ec SHA512 b30a57c09973d8ef624511f422babaf9722685b9f85643783aebc000671b41fd54f44b308cece0baab187e1ee00b10335c6d22b6bad6fb3468abe6ef0da97d73 |
28 |
+DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca |
29 |
DIST rocm-opencl-runtime-3.10.0.tar.gz 1004148 BLAKE2B 3d2539d24f8b3fd039424d606ebe36d7d8d1db2425f646d093a1a48d95c1c8b1c20821674fc628e622c2a5e7cbb30547805c3b84af16ad53f860f1064efa572b SHA512 121d0f310b4b235adf5f34dbf1989016b4c875bb47779b18d35fd9fab01c2118d1860e520cc6202a6fc3405b4c7897f491f611193c992cc25fe48e12bdd9f83f |
30 |
DIST rocm-opencl-runtime-3.8.0.tar.gz 1004339 BLAKE2B 966a5bd1d4d188004b15fe4263f2c18f6dad6a07f4bc264a5afa010f6035fbf73288966cd624e6e31e1ba584ba322d93343e3482177e6480c4a57a4150546f5a SHA512 bb4e3568e32bf6acc3c4812d7db169396a01bf90d079dc420ffb7df4bd4146d39938e76e9b386548fe64276bbf938a545c898de599113f20cc73ae98268c3d6a |
31 |
DIST rocm-opencl-runtime-3.9.0.tar.gz 1004372 BLAKE2B f5485dfbc615826214e1071485636e94bc83d12d4412da912455cb0ddd39ede3429a749a16428cb3c10775e652ffbe31a63ad00b3ea38a7fa43a120776a12bfe SHA512 e8149e99a7116a2c2af0d04dde55290c35dd5c6c26d95da8c8a04fcfccdb23f6617ab8348f9fc201b6d9fde7202de4ede480d7ac547ae2471c6ae10897e1795e |
32 |
@@ -9,3 +10,4 @@ DIST rocm-opencl-runtime-4.2.0.tar.gz 1005604 BLAKE2B 09e100081295e8c3da1f8b6b43 |
33 |
DIST rocm-opencl-runtime-4.3.0.tar.gz 1006792 BLAKE2B 29fd5843bb0153c7d3fe5250898f0fbdd089db6304122698c9ec9a5436e3a6845916f241f1a1e79a614e369f000297ac12413620edec0660d859ccddaa978d07 SHA512 a514d626700350f2c663db468427479eaa9e39dd912266ac2db6830d712351ffbc18737b208fd37f7ab5afdc2c9f6412d8d765973d6c72759bf51f864fc6bf1d |
34 |
DIST rocm-opencl-runtime-4.5.2.tar.gz 998488 BLAKE2B f5b92fca4b8aec8a709fccf6817bb3c6a1074f90a0ca8d38c23efe614672daf597f03e947dffbeca715619595878518e1eb7b8d3e3fd00dd02cdf076135fe626 SHA512 6c26b5517bebb2c3096efaec42bfdcb7485e13551b75397f029fa9b4925fe85201e749b91e3a068705cdf4284895d1d996b2819faf4013e1ed34a10319240452 |
35 |
DIST rocm-opencl-runtime-5.0.2.tar.gz 1004855 BLAKE2B e2c2beb987053204fbe8fda562ae65d6c1a58447e9e88bf1081aabeee6c9a10738fd8562114b564b647682438fdbd2c535db1008ac6e1cc4eb9a915998eeb3c7 SHA512 fa01d1fafc890181b9e67070353ee7c9100619494b7509cae1a3659f24ef1d00f650024cb24bdb0e6e7eacfdec1115e4683ec6f320228a19f41ae83321780780 |
36 |
+DIST rocm-opencl-runtime-5.1.3.tar.gz 1004765 BLAKE2B 64d9b42026d2be1d0e4aa666785699f6b4ec0584a927904a94bf830883050943503f8bdd7c97438a2fb11c71686a330d526f633959916c5c6c8da2e037841e79 SHA512 b83c3ae0bfad80f867bacce36710a8964f6dd7e64bf50da3ec6ce842217d6de63299d9ceaab9dc25a22252484520a85d02859809463dad5dda9b1f00a86863e0 |
37 |
|
38 |
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-5.1.3-remove-clinfo.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-5.1.3-remove-clinfo.patch |
39 |
new file mode 100644 |
40 |
index 000000000000..d169902563e1 |
41 |
--- /dev/null |
42 |
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-5.1.3-remove-clinfo.patch |
43 |
@@ -0,0 +1,24 @@ |
44 |
+Index: ROCm-OpenCL-Runtime-rocm-5.1.3/CMakeLists.txt |
45 |
+=================================================================== |
46 |
+--- ROCm-OpenCL-Runtime-rocm-5.1.3.orig/CMakeLists.txt |
47 |
++++ ROCm-OpenCL-Runtime-rocm-5.1.3/CMakeLists.txt |
48 |
+@@ -16,7 +16,6 @@ option(EMU_ENV "Enable building for emul |
49 |
+ set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/khronos/headers/opencl2.2" CACHE PATH "") |
50 |
+ add_subdirectory(khronos/icd) |
51 |
+ add_subdirectory(amdocl) |
52 |
+-add_subdirectory(tools/clinfo) |
53 |
+ add_subdirectory(tools/cltrace) |
54 |
+ if(BUILD_TESTS) |
55 |
+ add_subdirectory(tests/ocltst) |
56 |
+Index: ROCm-OpenCL-Runtime-rocm-5.1.3/packaging/CMakeLists.txt |
57 |
+=================================================================== |
58 |
+--- ROCm-OpenCL-Runtime-rocm-5.1.3.orig/packaging/CMakeLists.txt |
59 |
++++ ROCm-OpenCL-Runtime-rocm-5.1.3/packaging/CMakeLists.txt |
60 |
+@@ -5,7 +5,6 @@ set(CPACK_COMPONENTS_ALL binary dev icd) |
61 |
+ set(CPACK_DEB_COMPONENT_INSTALL ON) |
62 |
+ set(CPACK_RPM_COMPONENT_INSTALL ON) |
63 |
+ |
64 |
+-install(TARGETS clinfo DESTINATION bin COMPONENT binary) |
65 |
+ install(TARGETS amdocl DESTINATION lib COMPONENT binary) |
66 |
+ install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION share/doc/${CMAKE_PROJECT_NAME} COMPONENT binary) |
67 |
+ |
68 |
|
69 |
diff --git a/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-5.1.3.ebuild b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-5.1.3.ebuild |
70 |
new file mode 100644 |
71 |
index 000000000000..d3bff871de9b |
72 |
--- /dev/null |
73 |
+++ b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-5.1.3.ebuild |
74 |
@@ -0,0 +1,123 @@ |
75 |
+# Copyright 1999-2022 Gentoo Authors |
76 |
+# Distributed under the terms of the GNU General Public License v2 |
77 |
+ |
78 |
+EAPI=8 |
79 |
+ |
80 |
+inherit cmake edo flag-o-matic prefix |
81 |
+ |
82 |
+DESCRIPTION="Radeon Open Compute OpenCL Compatible Runtime" |
83 |
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime" |
84 |
+SRC_URI="https://github.com/ROCm-Developer-Tools/ROCclr/archive/rocm-${PV}.tar.gz -> rocclr-${PV}.tar.gz |
85 |
+ https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz" |
86 |
+ |
87 |
+LICENSE="Apache-2.0 MIT" |
88 |
+SLOT="0/$(ver_cut 1-2)" |
89 |
+IUSE="debug test" |
90 |
+RESTRICT="!test? ( test )" |
91 |
+KEYWORDS="~amd64" |
92 |
+ |
93 |
+RDEPEND=">=dev-libs/rocr-runtime-${PV} |
94 |
+ >=dev-libs/rocm-comgr-${PV} |
95 |
+ >=dev-libs/rocm-device-libs-${PV} |
96 |
+ >=virtual/opencl-3 |
97 |
+ media-libs/mesa" |
98 |
+DEPEND="${RDEPEND}" |
99 |
+BDEPEND=">=dev-util/rocm-cmake-${PV} |
100 |
+ media-libs/glew |
101 |
+ test? ( >=x11-apps/mesa-progs-8.5.0[X] ) |
102 |
+ " |
103 |
+ |
104 |
+PATCHES=( |
105 |
+ "${FILESDIR}/${PN}-5.1.3-remove-clinfo.patch" |
106 |
+ "${FILESDIR}/${PN}-3.5.0-do-not-install-libopencl.patch" |
107 |
+) |
108 |
+ |
109 |
+S="${WORKDIR}/ROCm-OpenCL-Runtime-rocm-${PV}" |
110 |
+S1="${WORKDIR}/ROCclr-rocm-${PV}" |
111 |
+ |
112 |
+src_prepare() { |
113 |
+ # Remove "clinfo" - use "dev-util/clinfo" instead |
114 |
+ [ -d tools/clinfo ] && rm -rf tools/clinfo || die |
115 |
+ |
116 |
+ cmake_src_prepare |
117 |
+ |
118 |
+ hprefixify amdocl/CMakeLists.txt |
119 |
+ |
120 |
+ sed -e "s/DESTINATION lib/DESTINATION ${CMAKE_INSTALL_LIBDIR}/g" -i packaging/CMakeLists.txt || die |
121 |
+ # remove trailing CR or it won't work |
122 |
+ sed -e "s/\r$//g" -i tests/ocltst/module/perf/oclperf.exclude || die |
123 |
+ |
124 |
+ pushd ${S1} || die |
125 |
+ # Bug #753377 |
126 |
+ # patch re-enables accidentally disabled gfx800 family |
127 |
+ eapply "${FILESDIR}/${PN}-5.0.2-enable-gfx800.patch" |
128 |
+ popd || die |
129 |
+} |
130 |
+ |
131 |
+src_configure() { |
132 |
+ # Reported upstream: https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/issues/120 |
133 |
+ append-cflags -fcommon |
134 |
+ |
135 |
+ local mycmakeargs=( |
136 |
+ -Wno-dev |
137 |
+ -DROCCLR_PATH="${S1}" |
138 |
+ -DAMD_OPENCL_PATH="${S}" |
139 |
+ -DROCM_PATH="${EPREFIX}/usr" |
140 |
+ -DBUILD_TESTS=$(usex test ON OFF) |
141 |
+ -DEMU_ENV=ON |
142 |
+ # -DCMAKE_STRIP="" |
143 |
+ ) |
144 |
+ cmake_src_configure |
145 |
+} |
146 |
+ |
147 |
+src_install() { |
148 |
+ insinto /etc/OpenCL/vendors |
149 |
+ doins config/amdocl64.icd |
150 |
+ |
151 |
+ cd "${BUILD_DIR}" || die |
152 |
+ insinto /usr/lib64 |
153 |
+ doins amdocl/libamdocl64.so |
154 |
+ doins tools/cltrace/libcltrace.so |
155 |
+} |
156 |
+ |
157 |
+# Copied from rocm.eclass. This ebuild does not need amdgpu_targets |
158 |
+# USE_EXPANDS, so it should not inherit rocm.eclass; it only uses the |
159 |
+# check_amdgpu function in src_test. Rename it to check-amdgpu to avoid |
160 |
+# pkgcheck warning. |
161 |
+check-amdgpu() { |
162 |
+ for device in /dev/kfd /dev/dri/render*; do |
163 |
+ addwrite ${device} |
164 |
+ if [[ ! -r ${device} || ! -w ${device} ]]; then |
165 |
+ eerror "Cannot read or write ${device}!" |
166 |
+ eerror "Make sure it is present and check the permission." |
167 |
+ ewarn "By default render group have access to it. Check if portage user is in render group." |
168 |
+ die "${device} inaccessible" |
169 |
+ fi |
170 |
+ done |
171 |
+} |
172 |
+ |
173 |
+src_test() { |
174 |
+ check-amdgpu |
175 |
+ cd "${BUILD_DIR}"/tests/ocltst || die |
176 |
+ export OCL_ICD_FILENAMES="${BUILD_DIR}"/amdocl/libamdocl64.so |
177 |
+ local instruction1="Please start an X server using amdgpu driver (not Xvfb!)," |
178 |
+ local instruction2="and export OCLGL_DISPLAY=\${DISPLAY} OCLGL_XAUTHORITY=\${XAUTHORITY} before reruning the test." |
179 |
+ if [[ -n ${OCLGL_DISPLAY+x} ]]; then |
180 |
+ export DISPLAY=${OCLGL_DISPLAY} |
181 |
+ export XAUTHORITY=${OCLGL_XAUTHORITY} |
182 |
+ ebegin "Running oclgl test under DISPLAY ${OCLGL_DISPLAY}" |
183 |
+ if ! glxinfo | grep "OpenGL vendor string: AMD"; then |
184 |
+ ewarn "${instruction1}" |
185 |
+ ewarn "${instruction2}" |
186 |
+ die "This display does not have AMD OpenGL vendor!" |
187 |
+ fi |
188 |
+ ./ocltst -m liboclgl.so -A ogl.exclude |
189 |
+ eend $? || die "oclgl test failed" |
190 |
+ else |
191 |
+ ewarn "${instruction1}" |
192 |
+ ewarn "${instruction2}" |
193 |
+ die "\${OCLGL_DISPLAY} not set." |
194 |
+ fi |
195 |
+ edob ./ocltst -m liboclruntime.so -A oclruntime.exclude |
196 |
+ edob ./ocltst -m liboclperf.so -A oclperf.exclude |
197 |
+} |