Index: MAINTAINERS.md =================================================================== --- /dev/null +++ MAINTAINERS.md @@ -0,0 +1,5 @@ +This file is used to indicate responsibility for the maintenance of this package. Individuals on this list should be the sole modifiers of the package, excluding cases where the Solus Team may need to perform necessary rebuilds, upgrades, or security fixes. This list should not be used for any direct contact usage. If you believe this package requires a package update, follow documentation from https://getsol.us/articles/packaging/request-a-package-update/en/. In the event this package no longer becomes sufficiently maintained, Core Team reserves the right to request a new maintainer or remove this package from the repository. + +- Jacek Jagosz + - IRC: JacekJagosz + - Email: jacek.jagosz@outlook.com Index: Makefile =================================================================== --- /dev/null +++ Makefile @@ -0,0 +1 @@ +include ../Makefile.common Index: files/0001-Allow-ROCclr-to-be-built-standalone.patch =================================================================== --- /dev/null +++ files/0001-Allow-ROCclr-to-be-built-standalone.patch @@ -0,0 +1,111 @@ +From 45f43db31e3d9b00897cf4ca029c8e5f1ee5e3ee Mon Sep 17 00:00:00 2001 +From: Jeremy Newton +Date: Wed, 20 Apr 2022 00:24:06 -0400 +Subject: [PATCH] Allow ROCclr to be built standalone + +The OpenCL sources are still required, but this patch allows ROCclr to be +built, installed, and packaged independently. + +While this isn't the most correct way of implementing this, it is the least +disruptive and least likely to break against upstream code (smallest delta +and easy to rebase). A proper upstreamable fix would require someone +with better cmake skill to work with upstream. + +An ideal upstream solution would require rework across hipamd, ROCm OpenCL, +and ROCclr, along with an understanding of all three code bases including +the PAL (used on Windows) backend's considerations and design constraints. +--- + CMakeLists.txt | 37 +++++++++++++++++++++++++++++++---- + cmake/ROCclr.cmake.in | 10 ++++++++++ + cmake/ROCclr.cmake.install.in | 15 ++++++++++++++ + 3 files changed, 58 insertions(+), 4 deletions(-) + create mode 100644 cmake/ROCclr.cmake.in + create mode 100644 cmake/ROCclr.cmake.install.in + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 29ed85f8..7916da54 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,9 +22,38 @@ cmake_minimum_required(VERSION 3.5) + + project(ROCclr) + +-if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) +- message(AUTHOR_WARNING "ROCclr is being built as a standalone project. This isn't supported anymore.") +-endif() +- + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + include(ROCclr) ++ ++include(GNUInstallDirs) ++ ++install( TARGETS rocclr ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ ++install ( ++ DIRECTORY ++ "${AMD_OPENCL_INCLUDE_DIR}/../../../../amdocl" ++ "${CMAKE_CURRENT_SOURCE_DIR}/include" ++ "${CMAKE_CURRENT_SOURCE_DIR}/elf" ++ "${CMAKE_CURRENT_SOURCE_DIR}/utils" ++ "${CMAKE_CURRENT_SOURCE_DIR}/platform" ++ "${CMAKE_CURRENT_SOURCE_DIR}/thread" ++ "${CMAKE_CURRENT_SOURCE_DIR}/os" ++ "${CMAKE_CURRENT_SOURCE_DIR}/device" ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocclr ++ FILES_MATCHING PATTERN "*.h*") ++ ++#Create module prior to install, useful if packaging rocclr and opencl together ++configure_file("cmake/ROCclr.cmake.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/ROCclr.cmake" ++ @ONLY) ++ ++#Create a module to be installed, i.e. building with rocclr post "make install" ++configure_file("cmake/ROCclr.cmake.install.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/ROCclr.cmake.install" ++ @ONLY) ++ ++install(FILES ++ "${CMAKE_CURRENT_BINARY_DIR}/ROCclr.cmake.install" ++ DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/Modules" ++ RENAME "ROCclr.cmake") +diff --git a/cmake/ROCclr.cmake.in b/cmake/ROCclr.cmake.in +new file mode 100644 +index 00000000..be10b5c8 +--- /dev/null ++++ b/cmake/ROCclr.cmake.in +@@ -0,0 +1,10 @@ ++link_directories(PUBLIC "@CMAKE_CURRENT_BINARY_DIR@") ++ ++include_directories( ++ @AMD_OPENCL_INCLUDE_DIRS@ ++ @CMAKE_CURRENT_SOURCE_DIR@ ++ @CMAKE_CURRENT_SOURCE_DIR@/include ++ @CMAKE_CURRENT_SOURCE_DIR@/elf) ++ ++#Taken from elf/test/CMakeLists.txt: ++add_definitions(-DUSE_COMGR_LIBRARY -DCOMGR_DYN_DLL -DWITH_LIGHTNING_COMPILER) +diff --git a/cmake/ROCclr.cmake.install.in b/cmake/ROCclr.cmake.install.in +new file mode 100644 +index 00000000..89160eb3 +--- /dev/null ++++ b/cmake/ROCclr.cmake.install.in +@@ -0,0 +1,15 @@ ++set(ROCCLR_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@/rocclr/include" CACHE STRING "ROCclr include directory") ++set(AMD_OPENCL_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@/CL" CACHE STRING "OpenCL include directory") ++set(AMDOCL_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@/rocclr/amdocl" CACHE STRING "AMDOCL include directory") ++link_directories(PUBLIC "@CMAKE_INSTALL_FULL_LIBDIR@") ++ ++include_directories( ++ ${AMD_OPENCL_INCLUDE_DIR}/.. ++ ${AMDOCL_INCLUDE_DIR} ++ ${AMDOCL_INCLUDE_DIR}/.. ++ ${ROCCLR_INCLUDE_DIR} ++ ${ROCCLR_INCLUDE_DIR}/.. ++ ${ROCCLR_INCLUDE_DIR}/../elf) ++ ++#Needed by elf/test/*: ++add_definitions(-DUSE_COMGR_LIBRARY -DCOMGR_DYN_DLL -DWITH_LIGHTNING_COMPILER) +-- +2.34.1 + Index: files/0001-SWDEV-321118-Use-GNUInstallDirs.patch =================================================================== --- /dev/null +++ files/0001-SWDEV-321118-Use-GNUInstallDirs.patch @@ -0,0 +1,126 @@ +From f86726945b821939a2d4620094f4f5f0a866a564 Mon Sep 17 00:00:00 2001 +From: Jeremy Newton +Date: Mon, 31 Jan 2022 17:54:14 -0500 +Subject: [PATCH 1/3] SWDEV-321118 - Use GNUInstallDirs + +Use GNUInstallDirs variables to determine the location of BINDIR, +LIBDIR, DOCDIR, and SYSCONFDIR. + +Signed-off-by: Jeremy Newton +Change-Id: Ifb38263dce80d80c5ebb4eacd8e49c76bb013a44 +--- + CMakeLists.txt | 2 +- + packaging/CMakeLists.txt | 12 ++++++------ + packaging/rocm-ocl-icd.postinst | 4 ++-- + packaging/rocm-ocl-icd.prerm | 4 ++-- + packaging/rocm-ocl-icd.rpm_post | 4 ++-- + packaging/rocm-ocl-icd.rpm_postun | 4 ++-- + 6 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e5c4537..0612fa2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,7 @@ if (POLICY CMP0048) + set(PROJ_VERSION VERSION 1.5.0) + endif() + +-project(opencl) ++project(rocm-opencl) + + include(GNUInstallDirs) + +diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt +index 13a2185..2b6fa77 100644 +--- a/packaging/CMakeLists.txt ++++ b/packaging/CMakeLists.txt +@@ -1,13 +1,13 @@ + cmake_minimum_required(VERSION 3.5.1) +-project(rocm-opencl) ++include(GNUInstallDirs) + + set(CPACK_COMPONENTS_ALL binary dev icd) + set(CPACK_DEB_COMPONENT_INSTALL ON) + set(CPACK_RPM_COMPONENT_INSTALL ON) + +-install(TARGETS clinfo DESTINATION bin COMPONENT binary) +-install(TARGETS amdocl DESTINATION lib COMPONENT binary) +-install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION share/doc/${CMAKE_PROJECT_NAME} COMPONENT binary) ++install(TARGETS clinfo DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binary) ++install(TARGETS amdocl DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary) ++install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT binary) + + install(DIRECTORY ${CMAKE_SOURCE_DIR}/khronos/headers/opencl2.2/CL + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT dev +@@ -17,8 +17,8 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/khronos/headers/opencl2.2/CL + PATTERN cl_dx9_media_sharing.h EXCLUDE + PATTERN cl_egl.h EXCLUDE ) + +-install(TARGETS OpenCL DESTINATION lib COMPONENT icd ) +-install(FILES ${CMAKE_SOURCE_DIR}/khronos/icd/LICENSE DESTINATION share/doc/rocm-ocl-icd COMPONENT icd) ++install(TARGETS OpenCL DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT icd ) ++install(FILES ${CMAKE_SOURCE_DIR}/khronos/icd/LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/rocm-ocl-icd COMPONENT icd) + + + # Generic CPACK variables +diff --git a/packaging/rocm-ocl-icd.postinst b/packaging/rocm-ocl-icd.postinst +index 0780970..7c46ade 100644 +--- a/packaging/rocm-ocl-icd.postinst ++++ b/packaging/rocm-ocl-icd.postinst +@@ -6,8 +6,8 @@ INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@ + ROCM_LIBPATH=@ROCM_PATH@/lib + + do_ldconfig() { +- echo ${INSTALL_PATH}/lib > /etc/ld.so.conf.d/10-rocm-opencl.conf && ldconfig +- mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@) ++ echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig ++ mkdir -p /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors && (echo libamdocl64.so > /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@) + } + + case "$1" in +diff --git a/packaging/rocm-ocl-icd.prerm b/packaging/rocm-ocl-icd.prerm +index 9fc6c8d..e0b5417 100644 +--- a/packaging/rocm-ocl-icd.prerm ++++ b/packaging/rocm-ocl-icd.prerm +@@ -3,8 +3,8 @@ + set -e + + rm_ldconfig() { +- rm -f /etc/ld.so.conf.d/10-rocm-opencl.conf && ldconfig +- rm -f /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@ ++ rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig ++ rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@ + } + + case "$1" in +diff --git a/packaging/rocm-ocl-icd.rpm_post b/packaging/rocm-ocl-icd.rpm_post +index 7ce5d97..49129ce 100644 +--- a/packaging/rocm-ocl-icd.rpm_post ++++ b/packaging/rocm-ocl-icd.rpm_post +@@ -1,8 +1,8 @@ + INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@ + ROCM_LIBPATH=@ROCM_PATH@/lib + +-echo ${INSTALL_PATH}/lib > /etc/ld.so.conf.d/10-rocm-opencl.conf && ldconfig +-mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@) ++echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig ++mkdir -p /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors && (echo libamdocl64.so > /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@) + + mkdir -p ${ROCM_LIBPATH} + ln -s -f -r ${INSTALL_PATH}/lib/libOpenCL.so ${ROCM_LIBPATH}/libOpenCL.so +diff --git a/packaging/rocm-ocl-icd.rpm_postun b/packaging/rocm-ocl-icd.rpm_postun +index 356c7af..44bbce3 100644 +--- a/packaging/rocm-ocl-icd.rpm_postun ++++ b/packaging/rocm-ocl-icd.rpm_postun +@@ -1,6 +1,6 @@ + if [ $1 -eq 0 ]; then +- rm -f /etc/ld.so.conf.d/10-rocm-opencl.conf && ldconfig +- rm -f /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@ ++ rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig ++ rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@ + rm -f @ROCM_PATH@/lib/libOpenCL.so + rm -f @ROCM_PATH@/lib/libOpenCL.so.@OPENCL_LIB_VERSION_MAJOR@ + rm -f @ROCM_PATH@/lib/libOpenCL.so.@OPENCL_LIB_VERSION_STRING@ +-- +2.35.1 + Index: files/0001-enable-gfx800.patch =================================================================== --- /dev/null +++ files/0001-enable-gfx800.patch @@ -0,0 +1,16 @@ +#From xuhuisheng +#at https://github.com/RadeonOpenCompute/ROCm/issues/1659#issuecomment-1041026624 + +diff --git a/utils/flags.hpp b/utils/flags.hpp +index 8f0228cc..2eaa47c5 100644 +--- a/utils/flags.hpp ++++ b/utils/flags.hpp +@@ -245,7 +245,7 @@ release(bool, ROC_SYSTEM_SCOPE_SIGNAL, true, \ + "Enable system scope for signals (uses interrupts).") \ + release(bool, ROC_SKIP_COPY_SYNC, false, \ + "Skips copy syncs if runtime can predict the same engine.") \ +-release(bool, ROC_ENABLE_PRE_VEGA, false, \ ++release(bool, ROC_ENABLE_PRE_VEGA, true, \ + "Enable support of pre-vega ASICs in ROCm path") \ + release(bool, HIP_FORCE_QUEUE_PROFILING, false, \ + "Force command queue profiling by default") \ Index: files/0002-SWDEV-321116-Allow-disabling-ICD-loader.patch =================================================================== --- /dev/null +++ files/0002-SWDEV-321116-Allow-disabling-ICD-loader.patch @@ -0,0 +1,168 @@ +From cee67d6763e9f0c44e97d867042993b1041f40fb Mon Sep 17 00:00:00 2001 +From: Jeremy Newton +Date: Wed, 6 Apr 2022 15:07:13 -0400 +Subject: [PATCH 2/3] SWDEV-321116 - Allow disabling ICD loader + +This patch adds an option to allow not building the ICD loader with +rocm-opencl. This isn't useful for internal use, but distros will want +this to allow packaging rocm-opencl with their own OCL ICD loader. + +Signed-off-by: Jeremy Newton +Change-Id: I6006593eceed543cd829e8949ec2256482815673 +--- + CMakeLists.txt | 23 ++++++++++++------- + packaging/CMakeLists.txt | 49 +++++++++++++++++++++++++++------------- + 2 files changed, 48 insertions(+), 24 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0612fa2..3bb903a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,11 +10,14 @@ project(rocm-opencl) + include(GNUInstallDirs) + + option(BUILD_TESTS "Enable building OpenCL tests" OFF) ++option(BUILD_ICD "Enable building OpenCL ICD Loader" ON) + option(EMU_ENV "Enable building for emulation environment" OFF) + + + set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/khronos/headers/opencl2.2" CACHE PATH "") +-add_subdirectory(khronos/icd) ++if(BUILD_ICD) ++ add_subdirectory(khronos/icd) ++endif() + add_subdirectory(amdocl) + add_subdirectory(tools/clinfo) + add_subdirectory(tools/cltrace) +@@ -52,8 +55,10 @@ if (DEFINED ROCM_PATCH_VERSION) + set(OPENCL_AMD_ICD_FILE "amdocl64_${ROCM_PATCH_VERSION}.icd") + endif() + +-get_target_property(OPENCL_LIB_VERSION_MAJOR OpenCL SOVERSION) +-get_target_property(OPENCL_LIB_VERSION_STRING OpenCL VERSION) ++if(BUILD_ICD) ++ get_target_property(OPENCL_LIB_VERSION_MAJOR OpenCL SOVERSION) ++ get_target_property(OPENCL_LIB_VERSION_STRING OpenCL VERSION) ++endif() + + #Set Package Version + set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) +@@ -71,11 +76,13 @@ message (STATUS "ROCM Installation path(ROCM_PATH): ${ROCM_PATH}") + + #Package: rocm-opencl,rocm-opencl-dev/devel,rocm-ocl-icd + +-set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/packages/rocm-ocl-icd) +-configure_file(packaging/rocm-ocl-icd.postinst ${BUILD_DIR}/postinst @ONLY) +-configure_file(packaging/rocm-ocl-icd.prerm ${BUILD_DIR}/prerm @ONLY) +-configure_file(packaging/rocm-ocl-icd.rpm_post ${BUILD_DIR}/rpm_post @ONLY) +-configure_file(packaging/rocm-ocl-icd.rpm_postun ${BUILD_DIR}/rpm_postun @ONLY) ++if(BUILD_ICD) ++ set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/packages/rocm-ocl-icd) ++ configure_file(packaging/rocm-ocl-icd.postinst ${BUILD_DIR}/postinst @ONLY) ++ configure_file(packaging/rocm-ocl-icd.prerm ${BUILD_DIR}/prerm @ONLY) ++ configure_file(packaging/rocm-ocl-icd.rpm_post ${BUILD_DIR}/rpm_post @ONLY) ++ configure_file(packaging/rocm-ocl-icd.rpm_postun ${BUILD_DIR}/rpm_postun @ONLY) ++endif() + + add_subdirectory(packaging) + +diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt +index 2b6fa77..ab8fed2 100644 +--- a/packaging/CMakeLists.txt ++++ b/packaging/CMakeLists.txt +@@ -1,7 +1,10 @@ + cmake_minimum_required(VERSION 3.5.1) + include(GNUInstallDirs) + +-set(CPACK_COMPONENTS_ALL binary dev icd) ++set(CPACK_COMPONENTS_ALL binary dev) ++if(BUILD_ICD) ++ string ( APPEND CPACK_COMPONENTS_ALL " icd" ) ++endif() + set(CPACK_DEB_COMPONENT_INSTALL ON) + set(CPACK_RPM_COMPONENT_INSTALL ON) + +@@ -17,8 +20,10 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/khronos/headers/opencl2.2/CL + PATTERN cl_dx9_media_sharing.h EXCLUDE + PATTERN cl_egl.h EXCLUDE ) + +-install(TARGETS OpenCL DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT icd ) +-install(FILES ${CMAKE_SOURCE_DIR}/khronos/icd/LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/rocm-ocl-icd COMPONENT icd) ++if(BUILD_ICD) ++ install(TARGETS OpenCL DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT icd ) ++ install(FILES ${CMAKE_SOURCE_DIR}/khronos/icd/LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/rocm-ocl-icd COMPONENT icd) ++endif() + + + # Generic CPACK variables +@@ -45,11 +50,19 @@ endif() + message("Using CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_DEBIAN_PACKAGE_RELEASE}") + + set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +-set(CPACK_DEBIAN_BINARY_PACKAGE_DEPENDS "rocm-ocl-icd, libelf-dev, comgr, hsa-rocr, rocm-core") ++if(BUILD_ICD) ++ set(CPACK_DEBIAN_BINARY_PACKAGE_DEPENDS "rocm-ocl-icd, libelf-dev, comgr, hsa-rocr, rocm-core") ++else() ++ set(CPACK_DEBIAN_BINARY_PACKAGE_DEPENDS "ocl-icd-libopencl1, libelf-dev, comgr, hsa-rocr, rocm-core") ++endif() + + # RPM CPACK variables + set(CPACK_BINARY_RPM "ON") +-set(CPACK_RPM_BINARY_PACKAGE_REQUIRES "rocm-ocl-icd, comgr, hsa-rocr, rocm-core") ++if(BUILD_ICD) ++ set(CPACK_RPM_BINARY_PACKAGE_REQUIRES "rocm-ocl-icd, comgr, hsa-rocr, rocm-core") ++else() ++ set(CPACK_RPM_BINARY_PACKAGE_REQUIRES "ocl-icd, comgr, hsa-rocr, rocm-core") ++endif() + + #Unable to set CPACK_RPM_BIANRY_PACKAGE_LICENSE to control individual pacakge license + #Hence combining the license for BINARY,DEV,ICD to one +@@ -70,21 +83,23 @@ set(CPACK_RPM_DEV_PACKAGE_REQUIRES "rocm-opencl, hsa-rocr-devel, rocm-core") + ############################# + + # Debian CPACK variables +-set(CPACK_ICD_DEB "ON") +-set(CPACK_DEBIAN_ICD_PACKAGE_NAME "rocm-ocl-icd") ++if(BUILD_ICD) ++ set(CPACK_ICD_DEB "ON") ++ set(CPACK_DEBIAN_ICD_PACKAGE_NAME "rocm-ocl-icd") + +-set(CPACK_DEBIAN_ICD_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/packages/rocm-ocl-icd/postinst;${CMAKE_BINARY_DIR}/packages/rocm-ocl-icd/prerm") +-set(CPACK_DEBIAN_ICD_PACKAGE_DEPENDS "rocm-core") ++ set(CPACK_DEBIAN_ICD_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/packages/rocm-ocl-icd/postinst;${CMAKE_BINARY_DIR}/packages/rocm-ocl-icd/prerm") ++ set(CPACK_DEBIAN_ICD_PACKAGE_DEPENDS "rocm-core") + + # RPM CPACK variables +-set(CPACK_ICD_RPM "ON") +-set(CPACK_RPM_ICD_PACKAGE_NAME "rocm-ocl-icd") ++ set(CPACK_ICD_RPM "ON") ++ set(CPACK_RPM_ICD_PACKAGE_NAME "rocm-ocl-icd") + + + +-set(CPACK_RPM_ICD_POST_INSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/packages/rocm-ocl-icd/rpm_post") +-set(CPACK_RPM_ICD_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/packages/rocm-ocl-icd/rpm_postun") +-set(CPACK_RPM_ICD_PACKAGE_REQUIRES "rocm-core") ++ set(CPACK_RPM_ICD_POST_INSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/packages/rocm-ocl-icd/rpm_post") ++ set(CPACK_RPM_ICD_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/packages/rocm-ocl-icd/rpm_postun") ++ set(CPACK_RPM_ICD_PACKAGE_REQUIRES "rocm-core") ++endif() + + if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE}) + set(CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE}) +@@ -113,8 +128,10 @@ if(NOT ROCM_DEP_ROCMCORE) + string(REGEX REPLACE ",? ?rocm-core" "" CPACK_DEBIAN_BINARY_PACKAGE_DEPENDS ${CPACK_DEBIAN_BINARY_PACKAGE_DEPENDS}) + string(REGEX REPLACE ",? ?rocm-core" "" CPACK_RPM_DEV_PACKAGE_REQUIRES ${CPACK_RPM_DEV_PACKAGE_REQUIRES}) + string(REGEX REPLACE ",? ?rocm-core" "" CPACK_DEBIAN_DEV_PACKAGE_DEPENDS ${CPACK_DEBIAN_DEV_PACKAGE_DEPENDS}) +- string(REGEX REPLACE ",? ?rocm-core" "" CPACK_RPM_ICD_PACKAGE_REQUIRES ${CPACK_RPM_ICD_PACKAGE_REQUIRES}) +- string(REGEX REPLACE ",? ?rocm-core" "" CPACK_DEBIAN_ICD_PACKAGE_DEPENDS ${CPACK_DEBIAN_ICD_PACKAGE_DEPENDS}) ++ if(BUILD_ICD) ++ string(REGEX REPLACE ",? ?rocm-core" "" CPACK_RPM_ICD_PACKAGE_REQUIRES ${CPACK_RPM_ICD_PACKAGE_REQUIRES}) ++ string(REGEX REPLACE ",? ?rocm-core" "" CPACK_DEBIAN_ICD_PACKAGE_DEPENDS ${CPACK_DEBIAN_ICD_PACKAGE_DEPENDS}) ++ endif() + endif() + + include(CPack) +-- +2.35.1 + Index: files/0003-SWDEV-321116-Drop-unnecessary-ICD-include.patch =================================================================== --- /dev/null +++ files/0003-SWDEV-321116-Drop-unnecessary-ICD-include.patch @@ -0,0 +1,44 @@ +From a0e5d11a28c6bc5bcc72927e06b643eb39ea3af3 Mon Sep 17 00:00:00 2001 +From: Jeremy Newton +Date: Wed, 6 Apr 2022 18:37:47 -0400 +Subject: [PATCH 3/3] SWDEV-321116 - Drop unnecessary ICD include + +This looks unused. This should allow building rocm-opencl without any +dependency on any particular OCL ICD. + +Signed-off-by: Jeremy Newton +Change-Id: Ib9229ede8400fd0e883275659ab99513b03952cb +--- + amdocl/cl_execute.cpp | 2 -- + amdocl/cl_icd.cpp | 2 -- + 2 files changed, 4 deletions(-) + +diff --git a/amdocl/cl_execute.cpp b/amdocl/cl_execute.cpp +index 71fe535..e1d5be2 100644 +--- a/amdocl/cl_execute.cpp ++++ b/amdocl/cl_execute.cpp +@@ -27,8 +27,6 @@ + #include "platform/program.hpp" + #include "os/os.hpp" + +-#include +- + /*! \addtogroup API + * @{ + * +diff --git a/amdocl/cl_icd.cpp b/amdocl/cl_icd.cpp +index 2a4f3af..4fce08b 100644 +--- a/amdocl/cl_icd.cpp ++++ b/amdocl/cl_icd.cpp +@@ -27,8 +27,6 @@ + #include "cl_d3d11_amd.hpp" + #endif //_WIN32 + +-#include +- + #include + + amd::PlatformIDS amd::PlatformID::Platform = //{ NULL }; +-- +2.35.1 + Index: files/series =================================================================== --- /dev/null +++ files/series @@ -0,0 +1,3 @@ +0001-SWDEV-321118-Use-GNUInstallDirs.patch +0002-SWDEV-321116-Allow-disabling-ICD-loader.patch +0003-SWDEV-321116-Drop-unnecessary-ICD-include.patch Index: package.yml =================================================================== --- /dev/null +++ package.yml @@ -0,0 +1,77 @@ +name : rocm-opencl +version : 5.1.0 +release : 1 +source : + - https://github.com/ROCm-Developer-Tools/ROCclr/archive/refs/tags/rocm-5.1.0.tar.gz : f4f265604b534795a275af902b2c814f416434d9c9e16db81b3ed5d062187dfa + - https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/refs/tags/rocm-5.1.0.tar.gz : 362d81303048cf7ed5d2f69fb65ed65425bc3da4734fff83e3b8fbdda51b0927 +license : MIT +component : programming.devel +clang : yes +summary : OpenCL 2.2 compatible language runtime +description: | + OpenCL 2.2 compatible language runtime +extract : False +builddeps : + - pkgconfig(OpenCL) + - pkgconfig(d3d) + - pkgconfig(gl) + - pkgconfig(x11-xcb) + - hsakmt-devel + - rocm-cmake + - rocm-compilersupport + - rocm-device-libs-devel + - rocm-runtime-devel +setup : | + tar -xvzf $sources/rocm-5.1.0.tar.gz + tar -xvzf $sources/rocm-5.1.0.tar.gz.1 + pushd ROCclr-rocm-%version% + %patch -p1 < $pkgfiles/0001-enable-gfx800.patch + %patch -p1 < $pkgfiles/0001-Allow-ROCclr-to-be-built-standalone.patch + sed -i "s/STATIC/SHARED/" cmake/ROCclr.cmake + echo "set_target_properties(rocclr PROPERTIES VERSION 5.1.0 SOVERSION 5.1)" \ + >> cmake/ROCclr.cmake + %cmake \ + -DAMD_OPENCL_PATH="%workdir%/ROCm-OpenCL-Runtime-rocm-%version%" + popd + pushd ROCm-OpenCL-Runtime-rocm-%version% + ls -d khronos/icd/* | grep -v loader | xargs rm -r + ls -d khronos/icd/loader/* | grep -v icd_dispatch.h | xargs rm -r + ls -d khronos/headers/* | grep -v opencl2.2 | xargs rm -r + rm -r khronos/headers/*/tests/ + %apply_patches + %cmake -Wno-dev \ + -DCMAKE_MODULE_PATH="%workdir%/ROCclr-rocm-%version%" \ + -DROCM_PATH=%PREFIX% \ + -DROCCLR_PATH="%workdir%/ROCclr-rocm-%version%" \ + -DAMD_OPENCL_PATH="%workdir%/ROCm-OpenCL-Runtime-rocm-%version%" -DBUILD_ICD=OFF +build : | + pushd ROCclr-rocm-%version% + %make + popd + pushd ROCm-OpenCL-Runtime-rocm-%version% + %make +install : | + pushd ROCclr-rocm-%version% + %make_install + + popd + pushd ROCm-OpenCL-Runtime-rocm-%version% + %make_install + + install -Dm00644 config/amdocl64.icd \ + %installroot%/etc/OpenCL/vendors/amdocl64.icd + + #Avoid file conflicts with opencl-headers package: + mkdir -p %installroot%/usr/include/rocm-opencl + mv %installroot%/usr/include/CL %installroot%/usr/include/rocm-opencl/CL + + #CMake excludes installing this for some reason + install -Dm00644 khronos/headers/opencl2.2/CL/cl_egl.h \ + %installroot%/usr/include/rocm-opencl/CL + + #Install bundled khronos icd header that hip needs: + install -Dm00644 khronos/icd/loader/icd_dispatch.h \ + %installroot%/usr/include/rocm-opencl/icd/loader/icd_dispatch.h + + #Avoid file conflicts with clinfo package: + mv %installroot%/usr/bin/clinfo %installroot%/usr/bin/rocm-clinfo Index: pspec_x86_64.xml =================================================================== --- /dev/null +++ pspec_x86_64.xml @@ -0,0 +1,193 @@ + + + rocm-opencl + + Jacek Jagosz + jacek.jagosz@outlook.com + + MIT + programming.devel + OpenCL 2.2 compatible language runtime + OpenCL 2.2 compatible language runtime + + https://getsol.us/sources/README.Solus + + + rocm-opencl + OpenCL 2.2 compatible language runtime + OpenCL 2.2 compatible language runtime + + programming.devel + + /etc/OpenCL/vendors/amdocl64.icd + /usr/bin/rocm-clinfo + /usr/lib64/librocclr.so.5.1 + /usr/lib64/librocclr.so.5.1.0 + /usr/share/doc/rocm-opencl/LICENSE.txt + + + + rocm-opencl-devel + Development files for rocm-opencl + OpenCL 2.2 compatible language runtime + + programming.devel + + rocm-opencl + + + /usr/include/rocclr/amdocl/CMakeFiles/amdocl.dir + /usr/include/rocclr/amdocl/cl_agent_amd.h + /usr/include/rocclr/amdocl/cl_common.hpp + /usr/include/rocclr/amdocl/cl_d3d10_amd.hpp + /usr/include/rocclr/amdocl/cl_d3d11_amd.hpp + /usr/include/rocclr/amdocl/cl_d3d9_amd.hpp + /usr/include/rocclr/amdocl/cl_debugger_amd.h + /usr/include/rocclr/amdocl/cl_gl_amd.hpp + /usr/include/rocclr/amdocl/cl_icd_amd.h + /usr/include/rocclr/amdocl/cl_kernel.h + /usr/include/rocclr/amdocl/cl_kernel_info_amd.h + /usr/include/rocclr/amdocl/cl_lqdflash_amd.h + /usr/include/rocclr/amdocl/cl_p2p_amd.h + /usr/include/rocclr/amdocl/cl_platform_amd.h + /usr/include/rocclr/amdocl/cl_profile_amd.h + /usr/include/rocclr/amdocl/cl_sdi_amd.h + /usr/include/rocclr/amdocl/cl_semaphore_amd.h + /usr/include/rocclr/amdocl/cl_thread_trace_amd.h + /usr/include/rocclr/amdocl/cl_vk_amd.hpp + /usr/include/rocclr/amdocl/cmake + /usr/include/rocclr/amdocl/gl_functions.hpp + /usr/include/rocclr/device/appprofile.hpp + /usr/include/rocclr/device/blit.hpp + /usr/include/rocclr/device/comgrctx.hpp + /usr/include/rocclr/device/devhcmessages.hpp + /usr/include/rocclr/device/devhostcall.hpp + /usr/include/rocclr/device/device.hpp + /usr/include/rocclr/device/devkernel.hpp + /usr/include/rocclr/device/devprogram.hpp + /usr/include/rocclr/device/devsanitizer.hpp + /usr/include/rocclr/device/devsignal.hpp + /usr/include/rocclr/device/devurilocator.hpp + /usr/include/rocclr/device/devwavelimiter.hpp + /usr/include/rocclr/device/hsailctx.hpp + /usr/include/rocclr/device/hwdebug.hpp + /usr/include/rocclr/device/pal/DxxOpenCLInteropExt.h + /usr/include/rocclr/device/pal/palappprofile.hpp + /usr/include/rocclr/device/pal/palblit.hpp + /usr/include/rocclr/device/pal/palconstbuf.hpp + /usr/include/rocclr/device/pal/palcounters.hpp + /usr/include/rocclr/device/pal/paldebugger.hpp + /usr/include/rocclr/device/pal/paldebugmanager.hpp + /usr/include/rocclr/device/pal/paldefs.hpp + /usr/include/rocclr/device/pal/paldevice.hpp + /usr/include/rocclr/device/pal/palgpuopen.hpp + /usr/include/rocclr/device/pal/palkernel.hpp + /usr/include/rocclr/device/pal/palmemory.hpp + /usr/include/rocclr/device/pal/palprintf.hpp + /usr/include/rocclr/device/pal/palprogram.hpp + /usr/include/rocclr/device/pal/palresource.hpp + /usr/include/rocclr/device/pal/palsched.hpp + /usr/include/rocclr/device/pal/palsettings.hpp + /usr/include/rocclr/device/pal/palsignal.hpp + /usr/include/rocclr/device/pal/palthreadtrace.hpp + /usr/include/rocclr/device/pal/paltimestamp.hpp + /usr/include/rocclr/device/pal/paltrap.hpp + /usr/include/rocclr/device/pal/palvirtual.hpp + /usr/include/rocclr/device/rocm/mesa_glinterop.h + /usr/include/rocclr/device/rocm/pro/lnxheaders.h + /usr/include/rocclr/device/rocm/pro/prodevice.hpp + /usr/include/rocclr/device/rocm/pro/prodriver.hpp + /usr/include/rocclr/device/rocm/pro/profuncs.hpp + /usr/include/rocclr/device/rocm/rocappprofile.hpp + /usr/include/rocclr/device/rocm/rocblit.hpp + /usr/include/rocclr/device/rocm/roccounters.hpp + /usr/include/rocclr/device/rocm/rocdefs.hpp + /usr/include/rocclr/device/rocm/rocdevice.hpp + /usr/include/rocclr/device/rocm/rocglinterop.hpp + /usr/include/rocclr/device/rocm/rockernel.hpp + /usr/include/rocclr/device/rocm/rocmemory.hpp + /usr/include/rocclr/device/rocm/rocprintf.hpp + /usr/include/rocclr/device/rocm/rocprogram.hpp + /usr/include/rocclr/device/rocm/rocregisters.hpp + /usr/include/rocclr/device/rocm/rocsched.hpp + /usr/include/rocclr/device/rocm/rocsettings.hpp + /usr/include/rocclr/device/rocm/rocsignal.hpp + /usr/include/rocclr/device/rocm/rocurilocator.hpp + /usr/include/rocclr/device/rocm/rocvirtual.hpp + /usr/include/rocclr/elf/elf.hpp + /usr/include/rocclr/elf/elfio/elf_types.hpp + /usr/include/rocclr/elf/elfio/elfio.hpp + /usr/include/rocclr/elf/elfio/elfio_dump.hpp + /usr/include/rocclr/elf/elfio/elfio_dynamic.hpp + /usr/include/rocclr/elf/elfio/elfio_header.hpp + /usr/include/rocclr/elf/elfio/elfio_note.hpp + /usr/include/rocclr/elf/elfio/elfio_relocation.hpp + /usr/include/rocclr/elf/elfio/elfio_section.hpp + /usr/include/rocclr/elf/elfio/elfio_segment.hpp + /usr/include/rocclr/elf/elfio/elfio_strings.hpp + /usr/include/rocclr/elf/elfio/elfio_symbols.hpp + /usr/include/rocclr/elf/elfio/elfio_utils.hpp + /usr/include/rocclr/elf/test + /usr/include/rocclr/include/top.hpp + /usr/include/rocclr/include/vdi_agent_amd.h + /usr/include/rocclr/include/vdi_common.hpp + /usr/include/rocclr/os/alloc.hpp + /usr/include/rocclr/os/os.hpp + /usr/include/rocclr/platform/activity.hpp + /usr/include/rocclr/platform/agent.hpp + /usr/include/rocclr/platform/command.hpp + /usr/include/rocclr/platform/command_utils.hpp + /usr/include/rocclr/platform/commandqueue.hpp + /usr/include/rocclr/platform/context.hpp + /usr/include/rocclr/platform/counter.hpp + /usr/include/rocclr/platform/interop.hpp + /usr/include/rocclr/platform/kernel.hpp + /usr/include/rocclr/platform/memory.hpp + /usr/include/rocclr/platform/ndrange.hpp + /usr/include/rocclr/platform/object.hpp + /usr/include/rocclr/platform/perfctr.hpp + /usr/include/rocclr/platform/prof_protocol.h + /usr/include/rocclr/platform/program.hpp + /usr/include/rocclr/platform/runtime.hpp + /usr/include/rocclr/platform/sampler.hpp + /usr/include/rocclr/platform/threadtrace.hpp + /usr/include/rocclr/thread/monitor.hpp + /usr/include/rocclr/thread/semaphore.hpp + /usr/include/rocclr/thread/thread.hpp + /usr/include/rocclr/utils/concurrent.hpp + /usr/include/rocclr/utils/debug.hpp + /usr/include/rocclr/utils/flags.hpp + /usr/include/rocclr/utils/macros.hpp + /usr/include/rocclr/utils/util.hpp + /usr/include/rocclr/utils/versions.hpp + /usr/include/rocm-opencl/CL/cl.h + /usr/include/rocm-opencl/CL/cl.hpp + /usr/include/rocm-opencl/CL/cl2.hpp + /usr/include/rocm-opencl/CL/cl_dx9_media_sharing_intel.h + /usr/include/rocm-opencl/CL/cl_egl.h + /usr/include/rocm-opencl/CL/cl_ext.h + /usr/include/rocm-opencl/CL/cl_ext_intel.h + /usr/include/rocm-opencl/CL/cl_gl.h + /usr/include/rocm-opencl/CL/cl_gl_ext.h + /usr/include/rocm-opencl/CL/cl_icd.h + /usr/include/rocm-opencl/CL/cl_platform.h + /usr/include/rocm-opencl/CL/cl_va_api_media_sharing_intel.h + /usr/include/rocm-opencl/CL/cl_version.h + /usr/include/rocm-opencl/CL/opencl.h + /usr/include/rocm-opencl/icd/loader/icd_dispatch.h + /usr/lib64/libamdocl64.so + /usr/lib64/libcltrace.so + /usr/lib64/librocclr.so + /usr/share/cmake/Modules/ROCclr.cmake + + + + + 2022-04-27 + 5.1.0 + Packaging update + Jacek Jagosz + jacek.jagosz@outlook.com + + + \ No newline at end of file