Skip to content

Commit

Permalink
Standalone ROCclr WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
JacekJagosz committed May 14, 2022
1 parent 5d3d208 commit ef2588e
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/*.eopkg
/common
Makefile*
llvm
2 changes: 1 addition & 1 deletion rocm-compilersupport/pspec_x86_64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</Package>
<History>
<Update release="1">
<Date>2022-04-30</Date>
<Date>2022-05-13</Date>
<Version>5.1.0</Version>
<Comment>Packaging update</Comment>
<Name>Jacek Jagosz</Name>
Expand Down
2 changes: 1 addition & 1 deletion rocm-device-libs/pspec_x86_64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</Package>
<History>
<Update release="1">
<Date>2022-04-30</Date>
<Date>2022-05-13</Date>
<Version>5.1.0</Version>
<Comment>Packaging update</Comment>
<Name>Jacek Jagosz</Name>
Expand Down
30 changes: 30 additions & 0 deletions rocm-hip/files/0001-Use-installed-rocclr-if-available.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 78c755d2bd32930a322e4c3b68be6e8ceae390f5 Mon Sep 17 00:00:00 2001
From: Jeremy Newton <[email protected]>
Date: Wed, 4 May 2022 09:23:43 -0400
Subject: [PATCH] Use installed rocclr if available

---
src/cmake/FindROCclr.cmake | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/src/cmake/FindROCclr.cmake b/src/cmake/FindROCclr.cmake
index b9ff2b1c..40c4d587 100644
--- a/src/cmake/FindROCclr.cmake
+++ b/src/cmake/FindROCclr.cmake
@@ -18,7 +18,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

+find_package(ROCCLR NAMES ROCclr)
+
if(ROCCLR_FOUND)
+ message(STATUS "Using rocclr from ${ROCCLR_LIB_INSTALL_DIR}")
+ link_directories(PUBLIC ${ROCCLR_LIB_INSTALL_DIR})
+ include_directories(${ROCCLR_INCLUDE_DIRS})
+ add_definitions(${ROCCLR_COMPILE_DEFINITIONS})
return()
endif()

--
2.34.1

28 changes: 28 additions & 0 deletions rocm-hip/files/0002-Fix-CL-icd-header-include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From cd50df60787f98847a27fb223dc13d73613a17fa Mon Sep 17 00:00:00 2001
From: Jeremy Newton <[email protected]>
Date: Sat, 7 May 2022 00:03:48 -0400
Subject: [PATCH 2/2] Fix CL icd header include

Use CL public headers, not the the private header in the ICD loader source.

Fixes issues when building with ROCclr standalone package.
---
src/fixme.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fixme.cpp b/src/fixme.cpp
index 3b6b55bc..9f5d4cc4 100644
--- a/src/fixme.cpp
+++ b/src/fixme.cpp
@@ -19,7 +19,7 @@
THE SOFTWARE. */

#include "vdi_common.hpp"
-#include <icd/loader/icd_dispatch.h>
+#include <CL/cl_icd.h>

cl_icd_dispatch amd::ICDDispatchedObject::icdVendorDispatch_[] = {0};
amd::PlatformIDS amd::PlatformID::Platform = {amd::ICDDispatchedObject::icdVendorDispatch_};
--
2.34.1

1 change: 1 addition & 0 deletions rocm-hip/files/series
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
0001-Revert-hip-Fix-and-install-cmake-targets-for-hip-pac.patch
0002-Revert-hip-Switch-to-component-based-packaging.patch
0002-Fix-CL-icd-header-include.patch
8 changes: 5 additions & 3 deletions rocm-hip/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ builddeps :
- rocm-cmake
- rocm-compilersupport-devel
- rocm-device-libs-devel
- rocm-rocclr-devel
- rocm-opencl-devel
- rocm-runtime-devel
environment: |
Expand All @@ -30,8 +31,11 @@ setup : |
cd hipamd-rocm-%version%
%apply_patches
#FIXME: soname is broken when building from tar, upstream is fixing the issue:
sed -i 's/-${HIP_VERSION_GITHASH}//' CMakeLists.txt
#some hip cmake files don't respect the Linux FHS:
sed -i "s/\(cmake DESTINATION \)./\1\${LIB_INSTALL_DIR}/" CMakeLists.txt
#sed -i "s/\(cmake DESTINATION \)./\1\${LIB_INSTALL_DIR}/" CMakeLists.txt
#HIP requires RPATH
sed -i "/CMAKE_INSTALL_RPATH/d" CMakeLists.txt
Expand All @@ -41,10 +45,8 @@ setup : |
%cmake -S.. -B. \
-DHIP_COMMON_DIR=%workdir%/HIP-rocm-%version% \
-DHIP_COMPILER=clang \
-DAMD_OPENCL_INCLUDE_DIR=/usr/include/rocm-opencl/CL \
-DROCM_PATH=%PREFIX% \
-DROCCLR_INCLUDE_DIR=/usr/include/rocclr/include \
-DCMAKE_MODULE_PATH="/usr/share/cmake/Modules" \
-DHIP_VERSION_BUILD_ID=0
build : |
cd hipamd-rocm-%version%/build
Expand Down
2 changes: 1 addition & 1 deletion rocm-hip/pspec_x86_64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
</Package>
<History>
<Update release="1">
<Date>2022-05-04</Date>
<Date>2022-05-14</Date>
<Version>5.1.0</Version>
<Comment>Packaging update</Comment>
<Name>Jacek Jagosz</Name>
Expand Down
32 changes: 29 additions & 3 deletions rocm-opencl/package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name : rocm-opencl
name : rocm
version : 5.1.0
release : 1
source :
Expand All @@ -7,10 +7,36 @@ source :
license : MIT
component : programming.devel
clang : yes
summary : OpenCL 2.2 compatible language runtime
summary :
- OpenCL 2.2 compatible language runtime for AMD Radeon GPUs
- rocm-rocclr : Radeon Open Compute Common Language Runtime
- rocm-rocclr-devel : ROCclr development package
description: |
OpenCL 2.2 compatible language runtime
OpenCL 2.2 compatible language runtime for AMD Radeon GPUs
extract : False
rundeps :
- opencl :
- rocm-rocclr
- rocminfo
- opencl-devel :
- rocm-rocclr-devel
- rocm-opencl
- rocclr-devel:
- rocm-rocclr
patterns :
- opencl :
- /usr/bin/rocm-clinfo
- /usr/share/OpenCL
- /usr/share/doc
- /usr/lib64/*
- opencl-devel :
- /usr/include/rocm-opencl
- rocclr :
- /usr/lib64/librocclr.so.5*
- rocclr-devel :
- /usr/lib64/librocclr.so
- /usr/include/rocclr
- /usr/share/cmake
builddeps :
- pkgconfig(OpenCL)
- pkgconfig(d3d)
Expand Down
82 changes: 51 additions & 31 deletions rocm-opencl/pspec_x86_64.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,76 @@
<PISI>
<Source>
<Name>rocm-opencl</Name>
<Name>rocm</Name>
<Packager>
<Name>Jacek Jagosz</Name>
<Email>[email protected]</Email>
</Packager>
<License>MIT</License>
<PartOf>programming.devel</PartOf>
<Summary xml:lang="en">OpenCL 2.2 compatible language runtime</Summary>
<Description xml:lang="en">OpenCL 2.2 compatible language runtime
<Summary xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs</Summary>
<Description xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs
</Description>
<Archive type="binary" sha1sum="79eb0752a961b8e0d15c77d298c97498fbc89c5a">https://getsol.us/sources/README.Solus</Archive>
</Source>
<Package>
<Name>rocm-opencl</Name>
<Summary xml:lang="en">OpenCL 2.2 compatible language runtime</Summary>
<Description xml:lang="en">OpenCL 2.2 compatible language runtime
<Summary xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs</Summary>
<Description xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs
</Description>
<PartOf>programming.devel</PartOf>
<RuntimeDependencies>
<Dependency release="1">rocm-rocclr</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="executable">/usr/bin/rocm-clinfo</Path>
<Path fileType="library">/usr/lib64/librocclr.so.5.1</Path>
<Path fileType="library">/usr/lib64/librocclr.so.5.1.0</Path>
<Path fileType="library">/usr/lib64/libamdocl64.so</Path>
<Path fileType="library">/usr/lib64/libcltrace.so</Path>
<Path fileType="data">/usr/share/OpenCL/vendors/amdocl64.icd</Path>
<Path fileType="doc">/usr/share/doc/rocm-opencl/LICENSE.txt</Path>
</Files>
</Package>
<Package>
<Name>rocm-opencl-devel</Name>
<Summary xml:lang="en">Development files for rocm-opencl</Summary>
<Description xml:lang="en">OpenCL 2.2 compatible language runtime
<Summary xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs</Summary>
<Description xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs
</Description>
<PartOf>programming.devel</PartOf>
<RuntimeDependencies>
<Dependency release="1">rocm-opencl</Dependency>
<Dependency releaseFrom="1">rocm-rocclr-devel</Dependency>
<Dependency releaseFrom="1">rocm-opencl</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl.hpp</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl2.hpp</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_dx9_media_sharing_intel.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_egl.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_ext.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_ext_intel.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_gl.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_gl_ext.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_icd.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_platform.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_va_api_media_sharing_intel.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_version.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/opencl.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/icd/loader/icd_dispatch.h</Path>
</Files>
</Package>
<Package>
<Name>rocm-rocclr</Name>
<Summary xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs</Summary>
<Description xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs
</Description>
<Files>
<Path fileType="library">/usr/lib64/librocclr.so.5.1</Path>
<Path fileType="library">/usr/lib64/librocclr.so.5.1.0</Path>
</Files>
</Package>
<Package>
<Name>rocm-rocclr-devel</Name>
<Summary xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs</Summary>
<Description xml:lang="en">OpenCL 2.2 compatible language runtime for AMD Radeon GPUs
</Description>
<RuntimeDependencies>
<Dependency releaseFrom="1">rocm-rocclr</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include/rocclr/amdocl/CMakeFiles/amdocl.dir</Path>
Expand Down Expand Up @@ -160,30 +197,13 @@
<Path fileType="header">/usr/include/rocclr/utils/macros.hpp</Path>
<Path fileType="header">/usr/include/rocclr/utils/util.hpp</Path>
<Path fileType="header">/usr/include/rocclr/utils/versions.hpp</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl.hpp</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl2.hpp</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_dx9_media_sharing_intel.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_egl.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_ext.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_ext_intel.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_gl.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_gl_ext.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_icd.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_platform.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_va_api_media_sharing_intel.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/cl_version.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/CL/opencl.h</Path>
<Path fileType="header">/usr/include/rocm-opencl/icd/loader/icd_dispatch.h</Path>
<Path fileType="library">/usr/lib64/libamdocl64.so</Path>
<Path fileType="library">/usr/lib64/libcltrace.so</Path>
<Path fileType="library">/usr/lib64/librocclr.so</Path>
<Path fileType="data">/usr/share/cmake/Modules/ROCclr.cmake</Path>
</Files>
</Package>
<History>
<Update release="1">
<Date>2022-05-04</Date>
<Date>2022-05-13</Date>
<Version>5.1.0</Version>
<Comment>Packaging update</Comment>
<Name>Jacek Jagosz</Name>
Expand Down
2 changes: 1 addition & 1 deletion rocm-runtime/pspec_x86_64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</Package>
<History>
<Update release="1">
<Date>2022-04-30</Date>
<Date>2022-05-13</Date>
<Version>5.1.0</Version>
<Comment>Packaging update</Comment>
<Name>Jacek Jagosz</Name>
Expand Down

0 comments on commit ef2588e

Please sign in to comment.