SWDEV-452795 - Disable RAS plugin, fix XGMI
RAS plugin loaded rocm-smi which is in conflict with amd-smi library Main source of grief was the map 'devInfoTypesStrings' that is defined in both rocm-smi and amd-smi We assume that rocm-smi would get lazy-loaded by RAS library and overwrite symbols defined in amd-smi. devInfoTypesStrings in rocm-smi contains different number of elements, the enums are also different. RDC relies on amd-smi's enums. One such enum is kDevGpuMetrics: rocm-smi: kDevGpuMetrics = 68 amd-smi: kDevGpuMetrics = 75 Example of overlapping map definitions: $ objdump --dynamic-syms /opt/rocm/lib/libamd_smi.so | grep devInfoTypesStrings 00000000003c4980 g DO .data.rel.ro0000000000000008 Base devInfoTypesStrings 00000000003db830 g DO .bss0000000000000030 Base _ZN3amd3smi6Device19devInfoTypesStringsE $ objdump --dynamic-syms /opt/rocm/lib/librocm_smi64.so | grep devInfoTypesStrings 00000000003dc590 g DO .bss0000000000000030 Base _ZN3amd3smi6Device19devInfoTypesStringsE 00000000003c9c68 g DO .data.rel.ro0000000000000008 Base devInfoTypesStrings Change-Id: Ib2f2db32b6abd7ebe84e7807c25581461eb86bae Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
Цей коміт міститься в:
+47
-41
@@ -185,47 +185,46 @@ typedef enum {
|
||||
RDC_FI_ECC_CORRECT_TOTAL = 600, //!< Accumulated correctable ECC errors
|
||||
RDC_FI_ECC_UNCORRECT_TOTAL, //!< Accumulated uncorrectable ECC errors
|
||||
|
||||
RDC_FI_ECC_SDMA_SEC, //!< SDMA Single Error Correction
|
||||
RDC_FI_ECC_SDMA_DED, //!< SDMA Double Error Detection
|
||||
|
||||
RDC_FI_ECC_GFX_SEC, //!< GFX Single Error Correction
|
||||
RDC_FI_ECC_GFX_DED, //!< GFX Double Error Detection
|
||||
|
||||
RDC_FI_ECC_MMHUB_SEC, //!< MMHUB Single Error Correction
|
||||
RDC_FI_ECC_MMHUB_DED, //!< MMHUB Double Error Detection
|
||||
|
||||
RDC_FI_ECC_ATHUB_SEC, //!< ATHUB Single Error Correction
|
||||
RDC_FI_ECC_ATHUB_DED, //!< ATHUB Double Error Detection
|
||||
|
||||
RDC_FI_ECC_BIF_SEC, //!< BIF Single Error Correction
|
||||
RDC_FI_ECC_BIF_DED, //!< BIF Double Error Detection
|
||||
|
||||
RDC_FI_ECC_HDP_SEC, //!< HDP Single Error Correction
|
||||
RDC_FI_ECC_HDP_DED, //!< HDP Double Error Detection
|
||||
|
||||
RDC_FI_ECC_XGMI_WAFL_SEC, //!< XGMI WAFL Single Error Correction
|
||||
RDC_FI_ECC_XGMI_WAFL_DED, //!< XGMI WAFL Double Error Detection
|
||||
|
||||
RDC_FI_ECC_DF_SEC, //!< DF Single Error Correction
|
||||
RDC_FI_ECC_DF_DED, //!< DF Double Error Detection
|
||||
|
||||
RDC_FI_ECC_SMN_SEC, //!< SMN Single Error Correction
|
||||
RDC_FI_ECC_SMN_DED, //!< SMN Double Error Detection
|
||||
|
||||
RDC_FI_ECC_SEM_SEC, //!< SEM Single Error Correction
|
||||
RDC_FI_ECC_SEM_DED, //!< SEM Double Error Detection
|
||||
|
||||
RDC_FI_ECC_MP0_SEC, //!< MP0 Single Error Correction
|
||||
RDC_FI_ECC_MP0_DED, //!< MP0 Double Error Detection
|
||||
|
||||
RDC_FI_ECC_MP1_SEC, //!< MP1 Single Error Correction
|
||||
RDC_FI_ECC_MP1_DED, //!< MP1 Double Error Detection
|
||||
|
||||
RDC_FI_ECC_FUSE_SEC, //!< FUSE Single Error Correction
|
||||
RDC_FI_ECC_FUSE_DED, //!< FUSE Double Error Detection
|
||||
|
||||
RDC_FI_ECC_UMC_SEC, //!< UMC Single Error Correction
|
||||
RDC_FI_ECC_UMC_DED, //!< UMC Double Error Detection
|
||||
RDC_FI_ECC_FIRST = 602, //!< FIRST Error Correction and Detection field
|
||||
RDC_FI_ECC_SDMA_CE = RDC_FI_ECC_FIRST,
|
||||
RDC_FI_ECC_SDMA_UE,
|
||||
RDC_FI_ECC_GFX_CE,
|
||||
RDC_FI_ECC_GFX_UE,
|
||||
RDC_FI_ECC_MMHUB_CE,
|
||||
RDC_FI_ECC_MMHUB_UE,
|
||||
RDC_FI_ECC_ATHUB_CE,
|
||||
RDC_FI_ECC_ATHUB_UE,
|
||||
RDC_FI_ECC_PCIE_BIF_CE,
|
||||
RDC_FI_ECC_PCIE_BIF_UE,
|
||||
RDC_FI_ECC_HDP_CE,
|
||||
RDC_FI_ECC_HDP_UE,
|
||||
RDC_FI_ECC_XGMI_WAFL_CE,
|
||||
RDC_FI_ECC_XGMI_WAFL_UE,
|
||||
RDC_FI_ECC_DF_CE,
|
||||
RDC_FI_ECC_DF_UE,
|
||||
RDC_FI_ECC_SMN_CE,
|
||||
RDC_FI_ECC_SMN_UE,
|
||||
RDC_FI_ECC_SEM_CE,
|
||||
RDC_FI_ECC_SEM_UE,
|
||||
RDC_FI_ECC_MP0_CE,
|
||||
RDC_FI_ECC_MP0_UE,
|
||||
RDC_FI_ECC_MP1_CE,
|
||||
RDC_FI_ECC_MP1_UE,
|
||||
RDC_FI_ECC_FUSE_CE,
|
||||
RDC_FI_ECC_FUSE_UE,
|
||||
RDC_FI_ECC_UMC_CE,
|
||||
RDC_FI_ECC_UMC_UE,
|
||||
RDC_FI_ECC_MCA_CE,
|
||||
RDC_FI_ECC_MCA_UE,
|
||||
RDC_FI_ECC_VCN_CE,
|
||||
RDC_FI_ECC_VCN_UE,
|
||||
RDC_FI_ECC_JPEG_CE,
|
||||
RDC_FI_ECC_JPEG_UE,
|
||||
RDC_FI_ECC_IH_CE,
|
||||
RDC_FI_ECC_IH_UE,
|
||||
RDC_FI_ECC_MPIO_CE,
|
||||
RDC_FI_ECC_MPIO_UE,
|
||||
RDC_FI_ECC_LAST = RDC_FI_ECC_MPIO_UE,
|
||||
|
||||
// In new ASCI, such as MI300, the XGMI events is not supported
|
||||
// Using below XGMI related fields to calculate the bandwidth.
|
||||
@@ -320,6 +319,13 @@ typedef enum {
|
||||
|
||||
RDC_EVNT_NOTIF_LAST = RDC_EVNT_NOTIF_RING_HANG,
|
||||
} rdc_field_t;
|
||||
|
||||
// even and odd numbers are used for correctable and uncorrectable errors
|
||||
static_assert(RDC_FI_ECC_SDMA_CE % 2 == 0, "Correctable Error enum is not even");
|
||||
static_assert(RDC_FI_ECC_SDMA_UE % 2 == 1, "Uncorrectable Error enum is not odd");
|
||||
static_assert(RDC_FI_ECC_MPIO_CE % 2 == 0, "Correctable Error enum is not even");
|
||||
static_assert(RDC_FI_ECC_MPIO_UE % 2 == 1, "Uncorrectable Error enum is not odd");
|
||||
|
||||
#define RDC_EVNT_IS_NOTIF_FIELD(FIELD) \
|
||||
((FIELD) >= RDC_EVNT_NOTIF_FIRST && (FIELD) <= RDC_EVNT_NOTIF_LAST)
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ THE SOFTWARE.
|
||||
#ifndef INCLUDE_RDC_LIB_RDCDIAGNOSTICLIBINTERFACE_H_
|
||||
#define INCLUDE_RDC_LIB_RDCDIAGNOSTICLIBINTERFACE_H_
|
||||
|
||||
// The telemetry interface for libraries, for example, RAS.
|
||||
// The telemetry interface for libraries, for example, AMD-SMI.
|
||||
#include <rdc/rdc.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -22,7 +22,7 @@ THE SOFTWARE.
|
||||
#ifndef INCLUDE_RDC_LIB_RDCTELEMETRYLIBINTERFACE_H_
|
||||
#define INCLUDE_RDC_LIB_RDCTELEMETRYLIBINTERFACE_H_
|
||||
|
||||
// The telemetry interface for libraries, for example, RAS.
|
||||
// The telemetry interface for libraries, for example, AMD-SMI.
|
||||
#include <rdc/rdc.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -84,7 +84,8 @@ class RdcMetricFetcherImpl final : public RdcMetricFetcher {
|
||||
std::shared_ptr<FieldSMIData> get_smi_data(RdcFieldKey key);
|
||||
|
||||
uint64_t now();
|
||||
void get_ecc_error(uint32_t gpu_index, rdc_field_t field_id, rdc_field_value* value);
|
||||
void get_ecc(uint32_t gpu_index, rdc_field_t field_id, rdc_field_value* value);
|
||||
void get_ecc_total(uint32_t gpu_index, rdc_field_t field_id, rdc_field_value* value);
|
||||
|
||||
//!< return true if starting async_get
|
||||
bool async_get_pcie_throughput(uint32_t gpu_index, rdc_field_t field_id, rdc_field_value* value);
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2020 - present Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#ifndef INCLUDE_RDC_LIB_IMPL_RDCRASLIB_H_
|
||||
#define INCLUDE_RDC_LIB_IMPL_RDCRASLIB_H_
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "rdc_lib/RdcDiagnostic.h"
|
||||
#include "rdc_lib/RdcLibraryLoader.h"
|
||||
#include "rdc_lib/RdcTelemetry.h"
|
||||
|
||||
namespace amd {
|
||||
namespace rdc {
|
||||
class RdcRasLib : public RdcTelemetry, public RdcDiagnostic {
|
||||
public:
|
||||
// get support field ids
|
||||
rdc_status_t rdc_telemetry_fields_query(uint32_t field_ids[MAX_NUM_FIELDS],
|
||||
uint32_t* field_count) override;
|
||||
|
||||
// Fetch
|
||||
rdc_status_t rdc_telemetry_fields_value_get(rdc_gpu_field_t* fields, uint32_t fields_count,
|
||||
rdc_field_value_f callback, void* user_data) override;
|
||||
|
||||
rdc_status_t rdc_telemetry_fields_watch(rdc_gpu_field_t* fields, uint32_t fields_count) override;
|
||||
|
||||
rdc_status_t rdc_telemetry_fields_unwatch(rdc_gpu_field_t* fields,
|
||||
uint32_t fields_count) override;
|
||||
|
||||
rdc_status_t rdc_diag_test_cases_query(rdc_diag_test_cases_t test_cases[MAX_TEST_CASES],
|
||||
uint32_t* test_case_count) override;
|
||||
|
||||
// Run a specific test case
|
||||
rdc_status_t rdc_test_case_run(rdc_diag_test_cases_t test_case,
|
||||
uint32_t gpu_index[RDC_MAX_NUM_DEVICES], uint32_t gpu_count,
|
||||
const char* config, size_t config_size,
|
||||
rdc_diag_test_result_t* result) override;
|
||||
|
||||
rdc_status_t rdc_diagnostic_run(const rdc_group_info_t& gpus, rdc_diag_level_t level,
|
||||
const char* config, size_t config_size,
|
||||
rdc_diag_response_t* response) override;
|
||||
|
||||
rdc_status_t rdc_diag_init(uint64_t flags) override;
|
||||
rdc_status_t rdc_diag_destroy() override;
|
||||
|
||||
RdcRasLib();
|
||||
|
||||
~RdcRasLib();
|
||||
|
||||
private:
|
||||
RdcLibraryLoader lib_loader_;
|
||||
rdc_status_t (*fields_value_get_)(rdc_gpu_field_t*, uint32_t, rdc_field_value_f, void*);
|
||||
rdc_status_t (*fields_query_)(uint32_t[MAX_NUM_FIELDS], uint32_t*);
|
||||
|
||||
rdc_status_t (*fields_watch_)(rdc_gpu_field_t*, uint32_t);
|
||||
rdc_status_t (*fields_unwatch_)(rdc_gpu_field_t*, uint32_t);
|
||||
|
||||
rdc_status_t (*rdc_module_init_)(uint64_t);
|
||||
rdc_status_t (*rdc_module_destroy_)();
|
||||
};
|
||||
typedef std::shared_ptr<RdcRasLib> RdcRasLibPtr;
|
||||
|
||||
} // namespace rdc
|
||||
} // namespace amd
|
||||
|
||||
#endif // INCLUDE_RDC_LIB_IMPL_RDCRASLIB_H_
|
||||
@@ -29,7 +29,6 @@ THE SOFTWARE.
|
||||
|
||||
#include "rdc_lib/RdcMetricFetcher.h"
|
||||
#include "rdc_lib/RdcTelemetry.h"
|
||||
#include "rdc_lib/impl/RdcRasLib.h"
|
||||
#include "rdc_lib/impl/RdcSmiLib.h"
|
||||
|
||||
namespace amd {
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача