diff --git a/.github/scripts/tests/therock_configure_ci_test.py b/.github/scripts/tests/therock_configure_ci_test.py index a8d7abd29c3..1deeb18455f 100644 --- a/.github/scripts/tests/therock_configure_ci_test.py +++ b/.github/scripts/tests/therock_configure_ci_test.py @@ -151,46 +151,21 @@ def test_docs_only_change_returns_empty_list(self, mock_run): project_to_run = therock_configure_ci.retrieve_projects(args) self.assertEqual(len(project_to_run), 0) - @patch("therock_configure_ci.get_modified_paths") - def test_linux_only_subtrees_returns_empty_list(self, mock_get_modified): + @patch("subprocess.run") + def test_linux_only_subtrees_returns_empty_list(self, mock_run): args = { "is_pull_request": True, "base_ref": "HEAD^", - "platform": "windows", + "platform": "windows" } - - mock_get_modified.return_value = [ - "projects/rocprofiler-compute/src/compute.cpp", - "projects/rccl/src/rccl.cpp", - "projects/amdsmi/src/amdsmi.cpp", - "projects/rocprofiler-register/src/register.cpp", - "projects/amdsmi/hello/test.cpp", - "projects/hipother/hello/test.cpp", - ] - project_to_run = therock_configure_ci.retrieve_projects(args) - self.assertEqual(len(project_to_run), 0) - - @patch("therock_configure_ci.get_modified_paths") - def test_linux_only_subtrees_returns_correct_list(self, mock_get_modified): - args = { - "is_pull_request": True, - "base_ref": "HEAD^", - "platform": "windows", - } - - mock_get_modified.return_value = [ - "projects/rocprofiler-compute/src/compute.cpp", - "projects/rccl/src/rccl.cpp", - "projects/amdsmi/src/amdsmi.cpp", - "projects/rocprofiler-register/src/register.cpp", - "projects/amdsmi/hello/test.cpp", - "projects/hip/src/hip.cpp", # contains windows CI trigger - "projects/clr/src/hip.cpp", # contains windows CI trigger - ] + # Mock git diff to return only below paths + mock_process = MagicMock() + mock_process.stdout = "projects/rocprofiler-compute/src/compute.cpp\nprojects/rccl/src/rccl.cpp\nprojects/amdsmi/src/amdsmi.cpp\nprojects/rocprofiler-register/src/register.cpp\nprojects/amdsmi/hello/test.cpp" + mock_run.return_value = mock_process project_to_run = therock_configure_ci.retrieve_projects(args) - self.assertEqual(len(project_to_run), 1) + self.assertEqual(len(project_to_run), 0) if __name__ == "__main__": unittest.main() diff --git a/.github/scripts/therock_configure_ci.py b/.github/scripts/therock_configure_ci.py index 158ea2d4876..b3039e1f6b9 100644 --- a/.github/scripts/therock_configure_ci.py +++ b/.github/scripts/therock_configure_ci.py @@ -9,7 +9,7 @@ import json import logging import subprocess -from therock_matrix import subtree_to_project_map, project_map, trigger_windows_ci_for_subtrees_paths +from therock_matrix import subtree_to_project_map, project_map, linux_only_subtrees_paths import time from typing import Mapping, Optional, Iterable import os @@ -81,14 +81,6 @@ def check_for_workflow_file_related_to_ci(paths: Optional[Iterable[str]]) -> boo return any(is_path_workflow_file_related_to_ci(p) for p in paths) -def check_trigger_windows_ci_for_subtree_path(path): - """Returns true if path matches any of matches windows ci subtree patterns""" - for windows_ci_subtree_patterns in trigger_windows_ci_for_subtrees_paths: - if fnmatch.fnmatch(path, windows_ci_subtree_patterns): - return True - return False - - # Paths matching any of these patterns are considered to have no influence over # build or test workflows so any related jobs can be skipped if all paths # modified by a commit/PR match a pattern in this list. @@ -159,10 +151,11 @@ def retrieve_projects(args): if related_to_therock_ci: subtrees = list(subtree_to_project_map.keys()) - # If the platform is windows and any modified paths do not require windows CI based on "trigger_windows_ci_for_subtrees_paths", we skip windows CI - if args.get("platform") == "windows" and not any(check_trigger_windows_ci_for_subtree_path(path) for path in modified_paths): - logging.info("Modified subtrees do not contain windows CI subtrees paths, skipping windows CI") - return [] + # If the platform is windows and the modified path is a "linux_only_subtrees", we skip the windows CI + for linux_only_subtree_pattern in linux_only_subtrees_paths: + if args.get("platform") == "windows" and any(fnmatch.fnmatch(modified_path, linux_only_subtree_pattern) for modified_path in modified_paths): + logging.info("Modified subtrees contain linux-only subtrees, skipping CI on windows") + return [] projects = set() # collect the associated subtree to project diff --git a/.github/scripts/therock_matrix.py b/.github/scripts/therock_matrix.py index a19d6c29af5..d2eef6b7aa7 100644 --- a/.github/scripts/therock_matrix.py +++ b/.github/scripts/therock_matrix.py @@ -35,9 +35,9 @@ }, } -trigger_windows_ci_for_subtrees_paths = [ - "projects/clr/*", - "projects/hip/*", - "projects/hip-tests/*", - "projects/rocr-runtime/*", +linux_only_subtrees_paths = [ + # TODO(#3475): Remove linux only subtrees when rocprofiler supports Windows + "projects/rocprofiler*/*", + "projects/rccl/*", + "projects/amdsmi/*" ] diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_drm.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_drm.h index 79003546103..ea6198c1187 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_drm.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_drm.h @@ -26,12 +26,15 @@ #include #include +#include #include // NOLINT #include #include "amd_smi/amdsmi.h" #include "amd_smi/impl/amd_smi_lib_loader.h" #include "amd_smi/impl/amdgpu_drm.h" +#include "amd_smi/impl/xf86drm.h" +#include "amd_smi/impl/scoped_fd.h" namespace amd::smi { diff --git a/projects/amdsmi/include/amd_smi/impl/amdgpu_drm.h b/projects/amdsmi/include/amd_smi/impl/amdgpu_drm.h index 0e483d13b38..b56a5ac4b20 100644 --- a/projects/amdsmi/include/amd_smi/impl/amdgpu_drm.h +++ b/projects/amdsmi/include/amd_smi/impl/amdgpu_drm.h @@ -1625,6 +1625,15 @@ struct drm_amdgpu_info_uq_metadata { #define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */ #define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */ +/* FIXME wrong namespace! */ +struct drm_color_ctm_3x4 { + /* + * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude + * (not two's complement!) format. + */ + __u64 matrix[12]; +}; + #if defined(__cplusplus) } #endif diff --git a/projects/amdsmi/include/amd_smi/impl/xf86drm.h b/projects/amdsmi/include/amd_smi/impl/xf86drm.h index 1fbfdd0ac78..04568e10083 100644 --- a/projects/amdsmi/include/amd_smi/impl/xf86drm.h +++ b/projects/amdsmi/include/amd_smi/impl/xf86drm.h @@ -34,7 +34,7 @@ #ifndef _XF86DRM_H_ #define _XF86DRM_H_ -#include +#include #include #include #ifndef __LIBDRM__ diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 560ca08309b..36361fd8086 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -21,11 +21,11 @@ * THE SOFTWARE. */ -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -42,10 +43,11 @@ #include #include #include +#include #include "config/amd_smi_config.h" #include "amd_smi/amdsmi.h" -#include "amd_smi/impl/scoped_fd.h" +#include "amd_smi/impl/fdinfo.h" #include "amd_smi/impl/amd_smi_common.h" #include "amd_smi/impl/amd_smi_cper.h" #include "amd_smi/impl/amd_smi_system.h" @@ -64,6 +66,7 @@ #include "amd_smi/impl/amd_smi_utils.h" #include "amd_smi/impl/amd_smi_processor.h" #include "rocm_smi/rocm_smi.h" +#include "rocm_smi/rocm_smi_common.h" #include "rocm_smi/rocm_smi_logger.h" #include "rocm_smi/rocm_smi_utils.h" #include "rocm_smi/rocm_smi_kfd.h" diff --git a/projects/amdsmi/src/amd_smi/amd_smi_drm.cc b/projects/amdsmi/src/amd_smi/amd_smi_drm.cc index ad98f524bad..de0cc7178fa 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi_drm.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi_drm.cc @@ -24,12 +24,12 @@ #include #include #include +#include #include #include #include "config/amd_smi_config.h" #include "amd_smi/impl/amd_smi_drm.h" #include "amd_smi/impl/amd_smi_utils.h" -#include "amd_smi/impl/xf86drm.h" #include "impl/scoped_fd.h" #include "rocm_smi/rocm_smi.h" #include "rocm_smi/rocm_smi_main.h" diff --git a/projects/amdsmi/src/amd_smi/amd_smi_utils.cc b/projects/amdsmi/src/amd_smi/amd_smi_utils.cc index ddf2efea519..aac3170b704 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi_utils.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi_utils.cc @@ -20,17 +20,17 @@ * THE SOFTWARE. */ -#include +#include #include #include #include #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include #include @@ -41,13 +41,14 @@ #include #include #include +#include #include #include #include "config/amd_smi_config.h" #include "amd_smi/impl/amd_smi_utils.h" -#include "amd_smi/impl/scoped_fd.h" #include "amd_smi/impl/amd_smi_system.h" +#include "shared_mutex.h" // NOLINT #include "rocm_smi/rocm_smi_logger.h" #include "rocm_smi/rocm_smi_utils.h" diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index 0af05910530..34a75978e66 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015 - 2026 Advanced Micro Devices, Inc. +/* Copyright (c) 2015 - 2025 Advanced Micro Devices, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -209,7 +209,6 @@ hipError_t hipDestroyExternalMemory(hipExternalMemory_t extMem) { hipError_t hipImportExternalSemaphore(hipExternalSemaphore_t* extSem_out, const hipExternalSemaphoreHandleDesc* semHandleDesc) { HIP_INIT_API(hipImportExternalSemaphore, extSem_out, semHandleDesc); - CHECK_STREAM_CAPTURE_SUPPORTED(); if (extSem_out == nullptr || semHandleDesc == nullptr) { HIP_RETURN(hipErrorInvalidValue); } @@ -309,7 +308,6 @@ hipError_t hipWaitExternalSemaphoresAsync(const hipExternalSemaphore_t* extSemAr hipError_t hipDestroyExternalSemaphore(hipExternalSemaphore_t extSem) { HIP_INIT_API(hipDestroyExternalSemaphore, extSem); - CHECK_STREAM_CAPTURE_SUPPORTED(); if (extSem == nullptr) { HIP_RETURN(hipErrorInvalidValue); } diff --git a/projects/clr/rocclr/device/pal/palcounters.cpp b/projects/clr/rocclr/device/pal/palcounters.cpp index b751e81f07e..77473b1b6d0 100644 --- a/projects/clr/rocclr/device/pal/palcounters.cpp +++ b/projects/clr/rocclr/device/pal/palcounters.cpp @@ -666,14 +666,20 @@ static constexpr std::array, 140> gfx10BlockIdPal = {{ }}; void PerfCounter::convertInfo() { - if (dev().properties().gfxTriple.major < 12) { - if (info_.blockIndex_ < gfx10BlockIdPal.size()) { - auto p = gfx10BlockIdPal[info_.blockIndex_]; - info_.blockIndex_ = std::get<0>(p); - info_.counterIndex_ = std::get<1>(p); - } - } else { - Unimplemented(); + switch (dev().ipLevel()) { + case Pal::GfxIpLevel::GfxIp10_1: + case Pal::GfxIpLevel::GfxIp10_3: + case Pal::GfxIpLevel::GfxIp11_0: + case Pal::GfxIpLevel::GfxIp11_5: + if (info_.blockIndex_ < gfx10BlockIdPal.size()) { + auto p = gfx10BlockIdPal[info_.blockIndex_]; + info_.blockIndex_ = std::get<0>(p); + info_.counterIndex_ = std::get<1>(p); + } + break; + default: + Unimplemented(); + break; } assert(info_.blockIndex_ < blockIdToIndexSelect.size()); diff --git a/projects/clr/rocclr/device/pal/paldevice.cpp b/projects/clr/rocclr/device/pal/paldevice.cpp index 6bd167ce8be..d039341560f 100644 --- a/projects/clr/rocclr/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/device/pal/paldevice.cpp @@ -76,34 +76,35 @@ struct PalDevice { uint32_t gfxipMajor_; //!< The core engine GFXIP Major version uint32_t gfxipMinor_; //!< The core engine GFXIP Minor version uint32_t gfxipStepping_; //!< The core engine GFXIP Stepping version + Pal::GfxIpLevel gfxIpLevel_; //!< PAL gfx IP level const char* palName_; //!< PAL device name Pal::AsicRevision asicRevision_; //!< PAL AsicRevision }; static constexpr PalDevice supportedPalDevices[] = { - // GFX Version PAL Name PAL ASIC Revision - {10, 1, 0, "gfx1010", Pal::AsicRevision::Navi10}, - {10, 1, 1, "gfx1011", Pal::AsicRevision::Navi12}, - {10, 1, 2, "gfx1012", Pal::AsicRevision::Navi14}, - {10, 3, 0, "gfx1030", Pal::AsicRevision::Navi21}, - {10, 3, 1, "gfx1031", Pal::AsicRevision::Navi22}, - {10, 3, 2, "gfx1032", Pal::AsicRevision::Navi23}, - {10, 3, 4, "gfx1034", Pal::AsicRevision::Navi24}, - {10, 3, 5, "gfx1035", Pal::AsicRevision::Rembrandt}, - {10, 3, 6, "gfx1036", Pal::AsicRevision::Raphael}, - {11, 0, 0, "gfx1100", Pal::AsicRevision::Navi31}, - {11, 0, 1, "gfx1101", Pal::AsicRevision::Navi32}, - {11, 0, 2, "gfx1102", Pal::AsicRevision::Navi33}, - {11, 0, 3, "gfx1103", Pal::AsicRevision::Phoenix1}, - {11, 0, 3, "gfx1103", Pal::AsicRevision::Phoenix2}, - {11, 0, 3, "gfx1103", Pal::AsicRevision::HawkPoint1}, - {11, 0, 3, "gfx1103", Pal::AsicRevision::HawkPoint2}, - {11, 5, 0, "gfx1150", Pal::AsicRevision::Strix1}, - {11, 5, 1, "gfx1151", Pal::AsicRevision::StrixHalo}, - {11, 5, 2, "gfx1152", Pal::AsicRevision::Krackan1}, - {11, 5, 3, "gfx1153", Pal::AsicRevision::Krackan2}, - {12, 0, 0, "gfx1200", Pal::AsicRevision::Navi44}, - {12, 0, 1, "gfx1201", Pal::AsicRevision::Navi48}, + // GFX Version PAL GFX IP Level PAL Name PAL ASIC Revision + {10, 1, 0, Pal::GfxIpLevel::GfxIp10_1, "gfx1010", Pal::AsicRevision::Navi10}, + {10, 1, 1, Pal::GfxIpLevel::GfxIp10_1, "gfx1011", Pal::AsicRevision::Navi12}, + {10, 1, 2, Pal::GfxIpLevel::GfxIp10_1, "gfx1012", Pal::AsicRevision::Navi14}, + {10, 3, 0, Pal::GfxIpLevel::GfxIp10_3, "gfx1030", Pal::AsicRevision::Navi21}, + {10, 3, 1, Pal::GfxIpLevel::GfxIp10_3, "gfx1031", Pal::AsicRevision::Navi22}, + {10, 3, 2, Pal::GfxIpLevel::GfxIp10_3, "gfx1032", Pal::AsicRevision::Navi23}, + {10, 3, 4, Pal::GfxIpLevel::GfxIp10_3, "gfx1034", Pal::AsicRevision::Navi24}, + {10, 3, 5, Pal::GfxIpLevel::GfxIp10_3, "gfx1035", Pal::AsicRevision::Rembrandt}, + {10, 3, 6, Pal::GfxIpLevel::GfxIp10_3, "gfx1036", Pal::AsicRevision::Raphael}, + {11, 0, 0, Pal::GfxIpLevel::GfxIp11_0, "gfx1100", Pal::AsicRevision::Navi31}, + {11, 0, 1, Pal::GfxIpLevel::GfxIp11_0, "gfx1101", Pal::AsicRevision::Navi32}, + {11, 0, 2, Pal::GfxIpLevel::GfxIp11_0, "gfx1102", Pal::AsicRevision::Navi33}, + {11, 0, 3, Pal::GfxIpLevel::GfxIp11_0, "gfx1103", Pal::AsicRevision::Phoenix1}, + {11, 0, 3, Pal::GfxIpLevel::GfxIp11_0, "gfx1103", Pal::AsicRevision::Phoenix2}, + {11, 0, 3, Pal::GfxIpLevel::GfxIp11_0, "gfx1103", Pal::AsicRevision::HawkPoint1}, + {11, 0, 3, Pal::GfxIpLevel::GfxIp11_0, "gfx1103", Pal::AsicRevision::HawkPoint2}, + {11, 5, 0, Pal::GfxIpLevel::GfxIp11_5, "gfx1150", Pal::AsicRevision::Strix1}, + {11, 5, 1, Pal::GfxIpLevel::GfxIp11_5, "gfx1151", Pal::AsicRevision::StrixHalo}, + {11, 5, 2, Pal::GfxIpLevel::GfxIp11_5, "gfx1152", Pal::AsicRevision::Krackan1}, + {11, 5, 3, Pal::GfxIpLevel::GfxIp11_5, "gfx1153", Pal::AsicRevision::Krackan2}, + {12, 0, 0, Pal::GfxIpLevel::GfxIp12, "gfx1200", Pal::AsicRevision::Navi44}, + {12, 0, 1, Pal::GfxIpLevel::GfxIp12, "gfx1201", Pal::AsicRevision::Navi48}, }; static std::tuple findIsa(uint32_t gfxipMajor, uint32_t gfxipMinor, @@ -126,9 +127,9 @@ static std::tuple findIsa(uint32_t gfxipMajor, uin isa, (palDeviceIter->gfxipMajor_ > 8) ? isa->targetId() : palDeviceIter->palName_); } -static std::tuple findPal(uint32_t gfxipMajor, - uint32_t gfxipMinor, - uint32_t gfxipStepping) { +static std::tuple findPal(uint32_t gfxipMajor, + uint32_t gfxipMinor, + uint32_t gfxipStepping) { auto palDeviceIter = std::find_if(std::begin(supportedPalDevices), std::end(supportedPalDevices), [&](const PalDevice& palDevice) { return palDevice.gfxipMajor_ == gfxipMajor && @@ -136,9 +137,10 @@ static std::tuple findPal(uint32_t gfxipMajor, palDevice.gfxipStepping_ == (gfxipStepping & 0xF); }); if (palDeviceIter == std::end(supportedPalDevices)) { - return std::make_tuple(Pal::AsicRevision::Unknown, nullptr); + return std::make_tuple(Pal::GfxIpLevel::None, Pal::AsicRevision::Unknown, nullptr); } - return std::make_tuple(palDeviceIter->asicRevision_, palDeviceIter->palName_); + return std::make_tuple(palDeviceIter->gfxIpLevel_, palDeviceIter->asicRevision_, + palDeviceIter->palName_); } } // namespace @@ -172,7 +174,7 @@ Pal::IDevice* gDeviceList[Pal::MaxDevices] = {}; uint32_t gStartDevice = 0; uint32_t gNumDevices = 0; -NullDevice::NullDevice() : amd::Device(), palName_(nullptr) {} +NullDevice::NullDevice() : amd::Device(), ipLevel_(Pal::GfxIpLevel::None), palName_(nullptr) {} bool NullDevice::init() { // Create offline devices for all ISAs not already associated with an online @@ -195,9 +197,10 @@ bool NullDevice::init() { continue; } + Pal::GfxIpLevel gfxIpLevel; Pal::AsicRevision asicRevision; const char* palName; - std::tie(asicRevision, palName) = + std::tie(gfxIpLevel, asicRevision, palName) = findPal(isa->versionMajor(), isa->versionMinor(), isa->versionStepping()); if (asicRevision == Pal::AsicRevision::Unknown) { // PAL does not support this asic. @@ -209,7 +212,7 @@ bool NullDevice::init() { LogPrintfError("Error allocating new instance of offline PAL Device %s", isa->targetId()); return false; } - if (!nullDevice->create(palName, *isa, asicRevision)) { + if (!nullDevice->create(palName, *isa, gfxIpLevel, asicRevision)) { // Skip over unsupported devices LogPrintfError("Skipping creating new instance of offline PAL Device %s", isa->targetId()); continue; @@ -219,7 +222,8 @@ bool NullDevice::init() { return true; } -bool NullDevice::create(const char* palName, const amd::Isa& isa, Pal::AsicRevision asicRevision) { +bool NullDevice::create(const char* palName, const amd::Isa& isa, Pal::GfxIpLevel ipLevel, + Pal::AsicRevision asicRevision) { if (!isa.runtimePalSupported()) { LogPrintfError("Offline PAL device %s is not supported", isa.targetId()); return false; @@ -231,7 +235,9 @@ bool NullDevice::create(const char* palName, const amd::Isa& isa, Pal::AsicRevis // Use fake GFX IP for the device init asicRevision_ = asicRevision; + ipLevel_ = ipLevel; properties.revision = asicRevision; + properties.gfxLevel = ipLevel; properties.gfxTriple.major = isa.versionMajor(); properties.gfxTriple.minor = isa.versionMinor(); properties.gfxTriple.stepping = isa.versionStepping(); @@ -856,6 +862,8 @@ bool Device::create(Pal::IDevice* device) { return false; } + // Save the IP level for the offline detection + ipLevel_ = properties().gfxLevel; asicRevision_ = flagIsDefault(PAL_FORCE_ASIC_REVISION) ? properties().revision : static_cast(PAL_FORCE_ASIC_REVISION); diff --git a/projects/clr/rocclr/device/pal/paldevice.hpp b/projects/clr/rocclr/device/pal/paldevice.hpp index 8dd093d5572..82922181265 100644 --- a/projects/clr/rocclr/device/pal/paldevice.hpp +++ b/projects/clr/rocclr/device/pal/paldevice.hpp @@ -66,6 +66,7 @@ class NullDevice : public amd::Device { //! Creates an offline device with the specified target bool create(const char* palName, //!< Device name const amd::Isa& isa, //!< Device ISA + Pal::GfxIpLevel ipLevel, //!< GPU ip level Pal::AsicRevision asicRevision //!< PAL ASIC revision ); @@ -117,6 +118,7 @@ class NullDevice : public amd::Device { //! Releases non-blocking map target memory virtual void freeMapTarget(amd::Memory& mem, void* target) {} + Pal::GfxIpLevel ipLevel() const { return ipLevel_; } Pal::AsicRevision asicRevision() const { return asicRevision_; } //! Empty implementation on Null device @@ -183,6 +185,7 @@ class NullDevice : public amd::Device { static Util::GenericAllocator allocator_; //!< Generic memory allocator in PAL Pal::AsicRevision asicRevision_; //!< ASIC revision + Pal::GfxIpLevel ipLevel_; //!< Device IP level const char* palName_; //!< Device name //! Fills OpenCL device info structure diff --git a/projects/clr/rocclr/device/pal/palsettings.cpp b/projects/clr/rocclr/device/pal/palsettings.cpp index f03984d5088..fecb0bd866d 100644 --- a/projects/clr/rocclr/device/pal/palsettings.cpp +++ b/projects/clr/rocclr/device/pal/palsettings.cpp @@ -198,7 +198,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp, enableWave32Mode_ = 0; } lcWavefrontSize64_ = !enableWave32Mode_; - if (palProp.gfxTriple.major == 10 && palProp.gfxTriple.minor == 1) { + if (palProp.gfxLevel == Pal::GfxIpLevel::GfxIp10_1) { // GFX10.1 HW doesn't support custom pitch. Enable double copy workaround imageBufferWar_ = GPU_IMAGE_BUFFER_WAR; } diff --git a/projects/clr/rocclr/thread/monitor.hpp b/projects/clr/rocclr/thread/monitor.hpp index 7433fe77cf3..cf03245398e 100644 --- a/projects/clr/rocclr/thread/monitor.hpp +++ b/projects/clr/rocclr/thread/monitor.hpp @@ -170,7 +170,7 @@ class Monitor { private: std::variant mutex_; - enum class notifyState : uint32_t { notNotified = 0, oneNotified = 1, allNotified = 2 }; + enum class notifyState { notNotified = 0, oneNotified = 1, allNotified = 2 }; std::condition_variable cv_; //!< The condition variable for sync on the mutex const bool recursive_; //!< True if this is a recursive mutex, false otherwise. std::atomic waits_; diff --git a/projects/hip-tests/catch/CMakeLists.txt b/projects/hip-tests/catch/CMakeLists.txt index ecd1cca3e9d..9733d27b044 100644 --- a/projects/hip-tests/catch/CMakeLists.txt +++ b/projects/hip-tests/catch/CMakeLists.txt @@ -199,22 +199,6 @@ if (WIN32) SET(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "") endif() -# Add debug flags for RelWithDebInfo and Debug builds on Windows -if(WIN32) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - add_compile_options($<$,$,$>>:-g>) - add_compile_options($<$,$,$>>:-gcodeview>) - add_compile_options($<$,$,$>>:-gline-tables-only>) - endif() - if(CMAKE_HIP_COMPILER_ID STREQUAL "Clang" OR HIP_PLATFORM STREQUAL "amd") - add_compile_options($<$,$,$>>:-g>) - add_compile_options($<$,$,$>>:-gcodeview>) - add_compile_options($<$,$,$>>:-gline-tables-only>) - add_link_options($<$,$>:-Xlinker>) - add_link_options($<$,$>:/DEBUG:FULL>) - endif() -endif() - if(HIP_PLATFORM STREQUAL "amd") if(WIN32) set(win_disable_warnings ${win_disable_warnings} -Wno-ignored-attributes -Wno-microsoft-cast) diff --git a/projects/rocm-core/rdhc/README.md b/projects/rocm-core/rdhc/README.md index e6a57ab54cf..3d6dd61a28e 100644 --- a/projects/rocm-core/rdhc/README.md +++ b/projects/rocm-core/rdhc/README.md @@ -75,6 +75,7 @@ optional arguments: -s, --silent Silent mode (errors only) -j FILE, --json FILE Export results to JSON file -d DIR, --dir DIR Directory path for temporary files (default: /tmp/rdhc/) + --install-prefix DIR ROCm installation prefix. If set, this path is used; otherwise `ROCM_PATH` env or `/opt/rocm` is used. Usage examples: # Run quick test (default tests only) @@ -97,6 +98,12 @@ sudo -E ./rdhc.py --all --json rdhc-results.json # Specify a directory for temp files and logs (default: /tmp/rdhc/) sudo -E ./rdhc.py -d /home/user/rdhc-dir/ + +# Custom install prefix +sudo -E ./rdhc.py --install-prefix /usr/local/rocm + +# Custom prefix and run all tests +sudo -E ./rdhc.py --install-prefix /usr/local/rocm --all -v ``` ## RDHC Environment VARIABLES diff --git a/projects/rocm-core/rdhc/rdhc.py b/projects/rocm-core/rdhc/rdhc.py index c87e5add777..c48b39a23f4 100755 --- a/projects/rocm-core/rdhc/rdhc.py +++ b/projects/rocm-core/rdhc/rdhc.py @@ -233,13 +233,18 @@ def export_to_json(results, filename): return False class ROCMHealthCheck: - def __init__(self, logger=None): + def __init__(self, logger=None, rocm_path=None): if logger is None: self.logger = logging.getLogger("RDHC") self.logger.setLevel(logging.INFO) else: self.logger = logger + # ROCm path: from constructor, or env, or default (used everywhere instead of os.environ.get) + self.rocm_path = rocm_path if (rocm_path and str(rocm_path).strip()) else os.environ.get("ROCM_PATH", "/opt/rocm") + if isinstance(self.rocm_path, str): + self.rocm_path = self.rocm_path.strip() + # List of all possible ROCm components to check self.all_components = [ "hipcc", @@ -282,7 +287,7 @@ def __init__(self, logger=None): def get_rocm_version(self): """Get the ROCm version string from /opt/rocm/.info/version""" try: - rocm_path = os.environ.get("ROCM_PATH", "/opt/rocm") + rocm_path = self.rocm_path with open(f"{rocm_path}/.info/version", "r") as f: return f.read().strip() except Exception as e: @@ -335,7 +340,7 @@ def get_installed_components(self): # If no packages found, or if ROCM_PATH points to a non-standard location, # check for folder-based installation if not package_installed: - rocm_path = os.environ.get("ROCM_PATH", "/opt/rocm") + rocm_path = self.rocm_path folder_installed = self._get_components_from_folders(rocm_path) # Log the detection method used @@ -713,7 +718,7 @@ def test_check_lib_dependencies(self): """Check library dependencies of installed ROCm components""" # Determine ROCm installation path - rocm_path = os.environ.get("ROCM_PATH", "/opt/rocm") + rocm_path = self.rocm_path rocm_lib_path = os.path.join(rocm_path, "lib") max_depth = os.environ.get("LIBDIR_MAX_DEPTH", "") @@ -1623,7 +1628,7 @@ def _build_target_and_run(self, comp_name, test_target_name): def test_check_miopen_hip(self): """Test miopen-hip package""" # Find ROCM path - rocm_path = os.environ.get("ROCM_PATH", "/opt/rocm") + rocm_path = self.rocm_path miopen_driver = os.path.join(rocm_path, "bin", "MIOpenDriver") # Check if MIOpenDriver exists @@ -1964,6 +1969,9 @@ def main(): "# Specify a directory for temp files and logs (default: /tmp/rdhc/)\n" + "sudo -E ./rdhc.py -d /home/user/rdhc-dir/\n" + "\n"+ + "# Use a custom ROCm install prefix\n" + + "sudo -E ./rdhc.py --install-prefix /usr/local/rocm\n" + + "\n"+ "NOTE for Ubuntu 24.04 (Python 3.12) users:\n" + "Due to enhanced security policies, you must use a virtual environment:\n" + " # Create and activate virtual environment (one-time setup)\n" + @@ -1983,6 +1991,7 @@ def main(): parser.add_argument("-s", "--silent", action="store_true", help="Silent mode (errors only)") parser.add_argument("-j", "--json", metavar="FILE", help="Export results to JSON file", default="rdhc_results.json") parser.add_argument("-d", "--dir", metavar="DIR", help="Directory path for temporary files (default: /tmp/rdhc/)", default="/tmp/rdhc/") + parser.add_argument("--install-prefix", metavar="DIR", help="ROCm installation prefix. If set, overrides ROCM_PATH; otherwise ROCM_PATH or /opt/rocm is used.", default=None) args = parser.parse_args() # Setup logger @@ -1998,8 +2007,18 @@ def main(): logger.info("Falling back to current directory") temp_dir = "./" + # If --install-prefix was passed and is non-empty; else keep current logic + if args.install_prefix is not None: + rocm_path = (args.install_prefix or "").strip() + if rocm_path: + logger.debug(f"Using ROCm install prefix: {rocm_path}") + else: + # Incase no install prefix provided + # Support Legacy logic to use ROCM_PATH or default /opt/rocm + rocm_path = os.environ.get("ROCM_PATH", "/opt/rocm") + # Create the health check instance - health_check = ROCMHealthCheck(logger) + health_check = ROCMHealthCheck(logger, rocm_path=rocm_path) # Run tests with the temp_dir health_check.run_tests(run_all=args.all, temp_dir=temp_dir)