diff options
Diffstat (limited to 'dev-util/roctracer/files')
10 files changed, 251 insertions, 0 deletions
diff --git a/dev-util/roctracer/files/roctracer-4.3.0-glibc-2.34.patch b/dev-util/roctracer/files/roctracer-4.3.0-glibc-2.34.patch new file mode 100644 index 000000000000..e11b1148bb89 --- /dev/null +++ b/dev-util/roctracer/files/roctracer-4.3.0-glibc-2.34.patch @@ -0,0 +1,35 @@ +From 5f4c1c01de8f0da24956c1c931d3ffe7410b5b78 Mon Sep 17 00:00:00 2001 +From: David Seifert <soap@gentoo.org> +Date: Sat, 30 Oct 2021 18:35:53 +0200 +Subject: [PATCH] pthread_yield -> sched_yield (glibc 2.34) + +Bug: https://bugs.gentoo.org/808049 +Upstream: https://github.com/ROCm-Developer-Tools/roctracer/pull/63 +--- + src/core/memory_pool.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/core/memory_pool.h b/src/core/memory_pool.h +index fe2f1a6..fbd9060 100644 +--- a/src/core/memory_pool.h ++++ b/src/core/memory_pool.h +@@ -24,6 +24,7 @@ THE SOFTWARE. + #define MEMORY_POOL_H_ + + #include <pthread.h> ++#include <sched.h> + #include <stdlib.h> + + #include <atomic> +@@ -152,7 +153,7 @@ class MemoryPool { + } + + static void sync_reader(const consumer_arg_t* arg) { +- while(arg->valid.load() == true) PTHREAD_CALL(pthread_yield()); ++ while(arg->valid.load() == true) PTHREAD_CALL(sched_yield()); + } + + static void* reader_fun(void* consumer_arg) { +-- +2.33.1 + diff --git a/dev-util/roctracer/files/roctracer-5.0.2-Werror.patch b/dev-util/roctracer/files/roctracer-5.0.2-Werror.patch new file mode 100644 index 000000000000..ddcfd7d669df --- /dev/null +++ b/dev-util/roctracer/files/roctracer-5.0.2-Werror.patch @@ -0,0 +1,18 @@ +User code should not use the aggressive warning and error flags. + +Index: roctracer-rocm-5.0.2/cmake_modules/env.cmake +=================================================================== +--- roctracer-rocm-5.0.2.orig/cmake_modules/env.cmake ++++ roctracer-rocm-5.0.2/cmake_modules/env.cmake +@@ -39,10 +39,8 @@ add_definitions ( -D__HIP_PLATFORM_HCC__ + + ## Linux Compiler options + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +-set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" ) +-set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" ) +-set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type" ) + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions" ) ++set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive" ) + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden" ) + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-math-errno" ) + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics" ) diff --git a/dev-util/roctracer/files/roctracer-5.0.2-headers.patch b/dev-util/roctracer/files/roctracer-5.0.2-headers.patch new file mode 100644 index 000000000000..91e48892bc45 --- /dev/null +++ b/dev-util/roctracer/files/roctracer-5.0.2-headers.patch @@ -0,0 +1,36 @@ +do not install a second set of header files, strip package name from +libraries and headers. + +Index: roctracer-rocm-5.0.2/CMakeLists.txt +=================================================================== +--- roctracer-rocm-5.0.2.orig/CMakeLists.txt ++++ roctracer-rocm-5.0.2/CMakeLists.txt +@@ -131,16 +131,12 @@ add_custom_target ( so-patch-link ALL WO + COMMAND ${CMAKE_COMMAND} -E create_symlink ../${DEST_NAME}/lib/${ROCTRACER_LIBRARY}.so.${LIB_VERSION_STRING} so-patch-link ) + + ## Install information +-install ( TARGETS ${ROCTRACER_TARGET} LIBRARY DESTINATION ${DEST_NAME}/lib ) ++install ( TARGETS ${ROCTRACER_TARGET} LIBRARY DESTINATION lib ) + foreach ( header ${PUBLIC_HEADERS} ) +- get_filename_component ( header_subdir ${header} DIRECTORY ) +- install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/inc/${header} DESTINATION ${DEST_NAME}/include/${header_subdir} ) +- install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/inc/${header} DESTINATION include/${DEST_NAME}/${header_subdir} ) ++ install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/inc/${header} DESTINATION include ) + endforeach () + foreach ( header ${GEN_HEADERS} ) +- get_filename_component ( header_subdir ${header} DIRECTORY ) +- install ( FILES ${PROJECT_BINARY_DIR}/inc/${header} DESTINATION ${DEST_NAME}/include/${header_subdir} ) +- install ( FILES ${PROJECT_BINARY_DIR}/inc/${header} DESTINATION include/${DEST_NAME}/${header_subdir} ) ++ install ( FILES ${PROJECT_BINARY_DIR}/inc/${header} DESTINATION include ) + endforeach () + #install ( FILES ${PROJECT_BINARY_DIR}/inc-link DESTINATION include RENAME ${DEST_NAME} ) + install ( FILES ${PROJECT_BINARY_DIR}/so-link DESTINATION lib RENAME ${ROCTRACER_LIBRARY}.so ) +@@ -162,7 +158,7 @@ add_custom_target ( so-roctx-major-link + add_custom_target ( so-roctx-patch-link ALL WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E create_symlink ../${DEST_NAME}/lib/${ROCTX_LIBRARY}.so.${LIB_VERSION_STRING} so-roctx-patch-link ) + +-install ( TARGETS "roctx64" LIBRARY DESTINATION ${DEST_NAME}/lib ) ++install ( TARGETS "roctx64" LIBRARY DESTINATION lib ) + install ( FILES ${PROJECT_BINARY_DIR}/so-roctx-link DESTINATION lib RENAME ${ROCTX_LIBRARY}.so ) + install ( FILES ${PROJECT_BINARY_DIR}/so-roctx-major-link DESTINATION lib RENAME ${ROCTX_LIBRARY}.so.${LIB_VERSION_MAJOR} ) + install ( FILES ${PROJECT_BINARY_DIR}/so-roctx-patch-link DESTINATION lib RENAME ${ROCTX_LIBRARY}.so.${LIB_VERSION_STRING} ) diff --git a/dev-util/roctracer/files/roctracer-5.0.2-strip-license.patch b/dev-util/roctracer/files/roctracer-5.0.2-strip-license.patch new file mode 100644 index 000000000000..e9c33885a01c --- /dev/null +++ b/dev-util/roctracer/files/roctracer-5.0.2-strip-license.patch @@ -0,0 +1,14 @@ +Index: roctracer-rocm-5.0.2/CMakeLists.txt +=================================================================== +--- roctracer-rocm-5.0.2.orig/CMakeLists.txt ++++ roctracer-rocm-5.0.2/CMakeLists.txt +@@ -173,9 +173,6 @@ set ( CPACK_PACKAGE_CONTACT "ROCm Profil + set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "AMD ROCTRACER library" ) + set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" ) + +-# Install license file +-install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION share/doc/${CPACK_PACKAGE_NAME}) +- + ## Debian package specific variables + if ( DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE} ) + set ( CPACK_DEBIAN_PACKAGE_RELEASE $ENV{CPACK_DEBIAN_PACKAGE_RELEASE} ) diff --git a/dev-util/roctracer/files/roctracer-5.1.3-no-aqlprofile.patch b/dev-util/roctracer/files/roctracer-5.1.3-no-aqlprofile.patch new file mode 100644 index 000000000000..93ddee3e5b43 --- /dev/null +++ b/dev-util/roctracer/files/roctracer-5.1.3-no-aqlprofile.patch @@ -0,0 +1,39 @@ +Skip loading proprietary AQLProfile lib +Index: roctracer-rocm-5.1.3/src/util/hsa_rsrc_factory.cpp +=================================================================== +--- roctracer-rocm-5.1.3.orig/src/util/hsa_rsrc_factory.cpp ++++ roctracer-rocm-5.1.3/src/util/hsa_rsrc_factory.cpp +@@ -127,14 +127,6 @@ HsaRsrcFactory::HsaRsrcFactory(bool init + if (cpu_pool_ == NULL) CHECK_STATUS("CPU memory pool is not found", HSA_STATUS_ERROR); + if (kern_arg_pool_ == NULL) CHECK_STATUS("Kern-arg memory pool is not found", HSA_STATUS_ERROR); + +- // Get AqlProfile API table +- aqlprofile_api_ = {0}; +-#ifdef ROCP_LD_AQLPROFILE +- status = LoadAqlProfileLib(&aqlprofile_api_); +-#else +- status = hsa_api_.hsa_system_get_major_extension_table(HSA_EXTENSION_AMD_AQLPROFILE, hsa_ven_amd_aqlprofile_VERSION_MAJOR, sizeof(aqlprofile_api_), &aqlprofile_api_); +-#endif +- CHECK_STATUS("aqlprofile API table load failed", status); + + // Get Loader API table + loader_api_ = {0}; +Index: roctracer-rocm-5.1.3/test/hsa/src/hsa_rsrc_factory.cpp +=================================================================== +--- roctracer-rocm-5.1.3.orig/test/hsa/src/hsa_rsrc_factory.cpp ++++ roctracer-rocm-5.1.3/test/hsa/src/hsa_rsrc_factory.cpp +@@ -125,14 +125,6 @@ HsaRsrcFactory::HsaRsrcFactory(bool init + if (cpu_pool_ == NULL) CHECK_STATUS("CPU memory pool is not found", HSA_STATUS_ERROR); + if (kern_arg_pool_ == NULL) CHECK_STATUS("Kern-arg memory pool is not found", HSA_STATUS_ERROR); + +- // Get AqlProfile API table +- aqlprofile_api_ = {0}; +-#ifdef ROCP_LD_AQLPROFILE +- status = LoadAqlProfileLib(&aqlprofile_api_); +-#else +- status = hsa_api_.hsa_system_get_major_extension_table(HSA_EXTENSION_AMD_AQLPROFILE, hsa_ven_amd_aqlprofile_VERSION_MAJOR, sizeof(aqlprofile_api_), &aqlprofile_api_); +-#endif +- CHECK_STATUS("aqlprofile API table load failed", status); + + // Get Loader API table + loader_api_ = {0}; diff --git a/dev-util/roctracer/files/roctracer-5.3.3-Werror.patch b/dev-util/roctracer/files/roctracer-5.3.3-Werror.patch new file mode 100644 index 000000000000..b932bb5cb5d3 --- /dev/null +++ b/dev-util/roctracer/files/roctracer-5.3.3-Werror.patch @@ -0,0 +1,15 @@ +Should not use the aggressive -Werror flag. + +Index: roctracer-rocm-5.3.3/CMakeLists.txt +=================================================================== +--- roctracer-rocm-5.3.3.orig/CMakeLists.txt ++++ roctracer-rocm-5.3.3/CMakeLists.txt +@@ -37,7 +37,7 @@ endif() + + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +-add_compile_options(-Wall -Werror) ++add_compile_options(-Wall) + + set(THREADS_PREFER_PTHREAD_FLAG ON) + diff --git a/dev-util/roctracer/files/roctracer-5.3.3-do-not-install-test-files.patch b/dev-util/roctracer/files/roctracer-5.3.3-do-not-install-test-files.patch new file mode 100644 index 000000000000..ac3e53c1f405 --- /dev/null +++ b/dev-util/roctracer/files/roctracer-5.3.3-do-not-install-test-files.patch @@ -0,0 +1,37 @@ +Remove all install commands for test +=================================================================== +--- roctracer-rocm-5.3.3.orig/test/CMakeLists.txt ++++ roctracer-rocm-5.3.3/test/CMakeLists.txt +@@ -87,7 +87,6 @@ function(generate_hsaco TARGET_ID INPUT_ + DEPENDS ${INPUT_FILE} clang + COMMENT "Building ${OUTPUT_FILE}..." + VERBATIM) +- install(FILES ${PROJECT_BINARY_DIR}/${OUTPUT_FILE} DESTINATION test/${PROJECT_NAME} COMPONENT tests) + set(HSACO_TARGET_LIST ${HSACO_TARGET_LIST} ${PROJECT_BINARY_DIR}/${OUTPUT_FILE} PARENT_SCOPE) + endfunction(generate_hsaco) + +@@ -150,24 +149,10 @@ add_dependencies(mytest dlopen) + ## Copy the golden traces and test scripts + configure_file(run.sh ${PROJECT_BINARY_DIR} COPYONLY) + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink run.sh ${PROJECT_BINARY_DIR}/run_ci.sh) +-install(PROGRAMS ${PROJECT_BINARY_DIR}/run.sh DESTINATION test/${PROJECT_NAME} COMPONENT tests) + + configure_file(${PROJECT_SOURCE_DIR}/script/check_trace.py ${PROJECT_BINARY_DIR}/test/check_trace.py COPYONLY) +-install(PROGRAMS ${PROJECT_BINARY_DIR}/test/check_trace.py DESTINATION test/${PROJECT_NAME}/test COMPONENT tests) + + file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "golden_traces/tests_trace_cmp_levels.txt" "golden_traces/*_trace.txt") + foreach(file ${files}) + configure_file(${file} ${PROJECT_BINARY_DIR}/test/${file} COPYONLY) + endforeach() +-install(DIRECTORY ${PROJECT_BINARY_DIR}/test/golden_traces DESTINATION test/${PROJECT_NAME}/test COMPONENT tests) +- +-# install all executables +-set(all_executables) +-get_property(all_targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY BUILDSYSTEM_TARGETS) +-foreach(target IN LISTS all_targets) +- get_target_property(target_type ${target} TYPE) +- if (target_type STREQUAL "EXECUTABLE") +- list(APPEND all_executables ${target}) +- endif() +-endforeach() +-install(TARGETS ${all_executables} DESTINATION test/${PROJECT_NAME}/test COMPONENT tests) diff --git a/dev-util/roctracer/files/roctracer-5.3.3-flat-lib-layout.patch b/dev-util/roctracer/files/roctracer-5.3.3-flat-lib-layout.patch new file mode 100644 index 000000000000..46c8d1a168b8 --- /dev/null +++ b/dev-util/roctracer/files/roctracer-5.3.3-flat-lib-layout.patch @@ -0,0 +1,34 @@ +Install libs directly into /usr/lib64 +=================================================================== +Index: roctracer-rocm-5.3.3/src/CMakeLists.txt +=================================================================== +--- roctracer-rocm-5.3.3.orig/src/CMakeLists.txt ++++ roctracer-rocm-5.3.3/src/CMakeLists.txt +@@ -215,12 +215,12 @@ target_include_directories(roctracer_too + target_link_libraries(roctracer_tool util roctracer hsa-runtime64::hsa-runtime64 stdc++fs Threads::Threads atomic dl) + target_link_options(roctracer_tool PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/tracer_tool/exportmap -Wl,--no-undefined) + +-install(TARGETS roctracer_tool LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME} COMPONENT runtime) ++install(TARGETS roctracer_tool LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime) + + add_library(hip_stats SHARED hip_stats/hip_stats.cpp) + target_compile_definitions(hip_stats PRIVATE __HIP_PLATFORM_AMD__) + target_link_libraries(hip_stats roctracer stdc++fs) +-install(TARGETS hip_stats LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME} COMPONENT runtime) ++install(TARGETS hip_stats LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime) + + endif() + +Index: roctracer-rocm-5.3.3/plugin/file/CMakeLists.txt +=================================================================== +--- roctracer-rocm-5.3.3.orig/plugin/file/CMakeLists.txt ++++ roctracer-rocm-5.3.3/plugin/file/CMakeLists.txt +@@ -38,5 +38,5 @@ target_link_options(file_plugin PRIVATE + target_link_libraries(file_plugin PRIVATE util roctracer hsa-runtime64::hsa-runtime64 stdc++fs) + + install(TARGETS file_plugin LIBRARY +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME} +- COMPONENT runtime) +\ No newline at end of file ++ DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ COMPONENT runtime) diff --git a/dev-util/roctracer/files/roctracer-5.3.3-rocm-path.patch b/dev-util/roctracer/files/roctracer-5.3.3-rocm-path.patch new file mode 100644 index 000000000000..d8cc792b4dbb --- /dev/null +++ b/dev-util/roctracer/files/roctracer-5.3.3-rocm-path.patch @@ -0,0 +1,12 @@ +Append flags for clang to recognize device lib path +=================================================================== +--- roctracer-rocm-5.3.3.orig/test/CMakeLists.txt ++++ roctracer-rocm-5.3.3/test/CMakeLists.txt +@@ -80,6 +80,7 @@ add_dependencies(mytest codeobj_test) + function(generate_hsaco TARGET_ID INPUT_FILE OUTPUT_FILE) + separate_arguments(CLANG_ARG_LIST UNIX_COMMAND + "-O2 -x cl -Xclang -finclude-default-header -cl-denorms-are-zero -cl-std=CL2.0 -Wl,--build-id=sha1 ++ --rocm-path=@GENTOO_PORTAGE_EPREFIX@/usr --rocm-device-lib-path=@GENTOO_PORTAGE_EPREFIX@/usr/lib/amdgcn/bitcode + -target amdgcn-amd-amdhsa -mcpu=${TARGET_ID} -o ${OUTPUT_FILE} ${INPUT_FILE}") + add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${OUTPUT_FILE} + COMMAND clang ${CLANG_ARG_LIST} diff --git a/dev-util/roctracer/files/roctracer-5.7.1-with-tests.patch b/dev-util/roctracer/files/roctracer-5.7.1-with-tests.patch new file mode 100644 index 000000000000..eb728b8f7237 --- /dev/null +++ b/dev-util/roctracer/files/roctracer-5.7.1-with-tests.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -56,7 +56,7 @@ endif() + add_subdirectory(src) + + ## Build tests +-if(${LIBRARY_TYPE} STREQUAL SHARED) ++if(WITH_TESTS) + add_subdirectory(test) + endif() + |