diff options
author | Johannes M Dieterich <jmd@FreeBSD.org> | 2018-11-19 04:05:31 +0000 |
---|---|---|
committer | Johannes M Dieterich <jmd@FreeBSD.org> | 2018-11-19 04:05:31 +0000 |
commit | 0b9475cf6cff779d91ce7f79b6a58070281b798f (patch) | |
tree | 2fcc2d66066ff0b6fde96c217f18204fec2656cb /sysutils/rocr | |
parent | c4a2edd5560b3bfb7ac3da062045b598087cd01c (diff) | |
download | ports-0b9475cf6cff779d91ce7f79b6a58070281b798f.tar.gz ports-0b9475cf6cff779d91ce7f79b6a58070281b798f.zip |
new ports: sysutils/rocr and sysutils/roct
roct is the ROC thunk interface and rocr is the ROCm platform runtime.
Together these form the userspace partners to the amdkfd compute driver.
Hence, in the current absence of a working amdkfd on FreeBSD, these ports do
not function yet. They are integrated to facilitate integration of amdkfd and
test it as part of the LinuxKPI-based DRM.
Note that these ports are for the time being based off my forks with FreeBSD
bringup bits, I'll work with the corresponding upstream teams to get patches
reviewed and integrated.
Limit these ports to amd64, as even our upstream does not support anything but
that for the time being.
Version numbers correspond to the overall ROCm release, currently 1.9.1.
Notes
Notes:
svn path=/head/; revision=485302
Diffstat (limited to 'sysutils/rocr')
-rw-r--r-- | sysutils/rocr/Makefile | 28 | ||||
-rw-r--r-- | sysutils/rocr/distinfo | 3 | ||||
-rw-r--r-- | sysutils/rocr/files/patch-src_CMakeLists.txt | 39 | ||||
-rw-r--r-- | sysutils/rocr/files/patch-src_core_runtime_amd__loader__context.cpp | 11 | ||||
-rw-r--r-- | sysutils/rocr/pkg-descr | 8 | ||||
-rw-r--r-- | sysutils/rocr/pkg-plist | 16 |
6 files changed, 105 insertions, 0 deletions
diff --git a/sysutils/rocr/Makefile b/sysutils/rocr/Makefile new file mode 100644 index 000000000000..78bc5969449d --- /dev/null +++ b/sysutils/rocr/Makefile @@ -0,0 +1,28 @@ +# Created by: Johannes Dieterich <jmd@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= rocr +PORTVERSION= 1.9.1 +CATEGORIES= sysutils + +MAINTAINER= jmd@FreeBSD.org +COMMENT= HPC market enhanced HSA based runtime + +LICENSE= NCSA +LICENSE_FILE= ${WRKSRC}/src/LICENSE.md + +ONLY_FOR_ARCHS= amd64 + +LIB_DEPENDS= libhsakmt.so:sysutils/roct + +USES= cmake:outsource +USE_LDCONFIG= yes + +USE_GITHUB= yes +GH_ACCOUNT= iotamudelta +GH_PROJECT= ROCR-Runtime +GH_TAGNAME= 5ab09ee + +CMAKE_SOURCE_PATH= ${WRKSRC}/src + +.include <bsd.port.mk> diff --git a/sysutils/rocr/distinfo b/sysutils/rocr/distinfo new file mode 100644 index 000000000000..f36bb87ea63d --- /dev/null +++ b/sysutils/rocr/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1542596496 +SHA256 (iotamudelta-ROCR-Runtime-1.9.1-5ab09ee_GH0.tar.gz) = d26d854207b32c6cc1dfe24aacf0f6c454aae7b52caffb8fa66e9499a0a8955c +SIZE (iotamudelta-ROCR-Runtime-1.9.1-5ab09ee_GH0.tar.gz) = 305552 diff --git a/sysutils/rocr/files/patch-src_CMakeLists.txt b/sysutils/rocr/files/patch-src_CMakeLists.txt new file mode 100644 index 000000000000..b702a2d79e74 --- /dev/null +++ b/sysutils/rocr/files/patch-src_CMakeLists.txt @@ -0,0 +1,39 @@ +--- src/CMakeLists.txt.orig 2018-11-19 03:01:00 UTC ++++ src/CMakeLists.txt +@@ -63,7 +63,6 @@ include(CheckSymbolExists) + CHECK_SYMBOL_EXISTS ( "__NR_memfd_create" "sys/syscall.h" HAVE_MEMFD_CREATE ) + + ## Compiler preproc definitions. +-add_definitions ( -D__linux__ ) + add_definitions ( -DHSA_EXPORT=1 ) + add_definitions ( -DHSA_EXPORT_FINALIZER=1 ) + add_definitions ( -DHSA_EXPORT_IMAGES=1 ) +@@ -93,6 +92,7 @@ unset( HSAKMT_INC CACHE ) + unset( HSAKMT_LIB CACHE ) + + ## Set include and link directories for libhsakmt ++include_directories ( "/usr/local/include/roct" ) + include_directories ( ${HSAKMT_INC_PATH} ) + link_directories ( ${HSAKMT_LIB_PATH} ) + +@@ -177,14 +176,14 @@ if ( "${CMAKE_BUILD_TYPE}" STREQUAL Release ) + endif () + + ## Create symlinks for packaging and install +-add_custom_target ( hsa-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../hsa/include/hsa hsa-link ) +-add_custom_target ( ${CORE_RUNTIME_TARGET}.so-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../hsa/lib/${CORE_RUNTIME_LIBRARY}.so ${CORE_RUNTIME_LIBRARY}.so-link ) ++#add_custom_target ( hsa-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../include/hsa hsa-link ) ++#add_custom_target ( ${CORE_RUNTIME_TARGET}.so-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../lib/${CORE_RUNTIME_LIBRARY}.so ${CORE_RUNTIME_LIBRARY}.so-link ) + + ## Set install information +-install ( TARGETS ${CORE_RUNTIME_TARGET} LIBRARY DESTINATION hsa/lib ) +-install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION hsa/include/hsa ) +-install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/hsa-link DESTINATION include PERMISSIONS OWNER_WRITE OWNER_READ RENAME hsa ) +-install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_RUNTIME_LIBRARY}.so-link DESTINATION lib PERMISSIONS OWNER_WRITE OWNER_READ RENAME ${CORE_RUNTIME_LIBRARY}.so ) ++install ( TARGETS ${CORE_RUNTIME_TARGET} LIBRARY DESTINATION lib ) ++install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION include/hsa ) ++#install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/hsa-link DESTINATION include PERMISSIONS OWNER_WRITE OWNER_READ RENAME hsa ) ++#install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_RUNTIME_LIBRARY}.so-link DESTINATION lib PERMISSIONS OWNER_WRITE OWNER_READ RENAME ${CORE_RUNTIME_LIBRARY}.so ) + + ## Packaging directives + set ( CPACK_PACKAGE_NAME "hsa-rocr-dev" ) diff --git a/sysutils/rocr/files/patch-src_core_runtime_amd__loader__context.cpp b/sysutils/rocr/files/patch-src_core_runtime_amd__loader__context.cpp new file mode 100644 index 000000000000..8af5ac4ec8b6 --- /dev/null +++ b/sysutils/rocr/files/patch-src_core_runtime_amd__loader__context.cpp @@ -0,0 +1,11 @@ +--- src/core/runtime/amd_loader_context.cpp.orig 2018-11-19 02:58:50 UTC ++++ src/core/runtime/amd_loader_context.cpp +@@ -207,7 +207,7 @@ bool MappedMemory::Allocate(size_t size, size_t align, + #else + ptr_ = is_kv_ ? + mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0) : +- mmap(nullptr, size, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_NORESERVE | MAP_PRIVATE, -1, 0); ++ mmap(nullptr, size, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + #endif // _WIN32 || _WIN64 + if (nullptr == ptr_) { + return false; diff --git a/sysutils/rocr/pkg-descr b/sysutils/rocr/pkg-descr new file mode 100644 index 000000000000..6f92ad676994 --- /dev/null +++ b/sysutils/rocr/pkg-descr @@ -0,0 +1,8 @@ +rocr + +HPC market enhanced HSA based runtime + +The user-mode API interfaces and libraries necessary for host applications to +launch compute kernels to available HSA ROCm kernel agents. + +WWW: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface diff --git a/sysutils/rocr/pkg-plist b/sysutils/rocr/pkg-plist new file mode 100644 index 000000000000..6f8b9fae156b --- /dev/null +++ b/sysutils/rocr/pkg-plist @@ -0,0 +1,16 @@ +include/hsa/Brig.h +include/hsa/amd_hsa_common.h +include/hsa/amd_hsa_elf.h +include/hsa/amd_hsa_kernel_code.h +include/hsa/amd_hsa_queue.h +include/hsa/amd_hsa_signal.h +include/hsa/hsa.h +include/hsa/hsa_api_trace.h +include/hsa/hsa_ext_amd.h +include/hsa/hsa_ext_finalize.h +include/hsa/hsa_ext_image.h +include/hsa/hsa_ven_amd_aqlprofile.h +include/hsa/hsa_ven_amd_loader.h +lib/libhsa-runtime64.so +lib/libhsa-runtime64.so.1 +lib/libhsa-runtime64.so.1.0.0 |