Add env var to override SRAM ECC
Add HSA_ENABLE_SRAMECC environment variable that can be used to
override SRAM ECC mode reported by KFD
Change-Id: I2b95511820a2d3d146a76b03070659c0695b61fd
[ROCm/ROCR-Runtime commit: a180c9ee78]
Этот коммит содержится в:
@@ -124,8 +124,18 @@ GpuAgent::GpuAgent(HSAuint32 node, const HsaNodeProperties& node_props, bool xna
|
|||||||
|
|
||||||
rocr::core::IsaFeature sramecc = rocr::core::IsaFeature::Unsupported;
|
rocr::core::IsaFeature sramecc = rocr::core::IsaFeature::Unsupported;
|
||||||
if (isa_base->IsSrameccSupported()) {
|
if (isa_base->IsSrameccSupported()) {
|
||||||
sramecc = node_props.Capability.ui32.SRAM_EDCSupport == 1 ? core::IsaFeature::Enabled
|
switch (core::Runtime::runtime_singleton_->flag().sramecc_enable()) {
|
||||||
: core::IsaFeature::Disabled;
|
case Flag::SRAMECC_DISABLED:
|
||||||
|
sramecc = core::IsaFeature::Disabled;
|
||||||
|
break;
|
||||||
|
case Flag::SRAMECC_ENABLED:
|
||||||
|
sramecc = core::IsaFeature::Enabled;
|
||||||
|
break;
|
||||||
|
case Flag::SRAMECC_DEFAULT:
|
||||||
|
sramecc = node_props.Capability.ui32.SRAM_EDCSupport == 1 ? core::IsaFeature::Enabled
|
||||||
|
: core::IsaFeature::Disabled;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rocr::core::IsaFeature xnack = rocr::core::IsaFeature::Unsupported;
|
rocr::core::IsaFeature xnack = rocr::core::IsaFeature::Unsupported;
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ namespace rocr {
|
|||||||
class Flag {
|
class Flag {
|
||||||
public:
|
public:
|
||||||
enum SDMA_OVERRIDE { SDMA_DISABLE, SDMA_ENABLE, SDMA_DEFAULT };
|
enum SDMA_OVERRIDE { SDMA_DISABLE, SDMA_ENABLE, SDMA_DEFAULT };
|
||||||
|
enum SRAMECC_ENABLE { SRAMECC_DISABLED, SRAMECC_ENABLED, SRAMECC_DEFAULT };
|
||||||
|
|
||||||
// The values are meaningful and chosen to satisfy the thunk API.
|
// The values are meaningful and chosen to satisfy the thunk API.
|
||||||
enum XNACK_REQUEST { XNACK_DISABLE = 0, XNACK_ENABLE = 1, XNACK_UNCHANGED = 2 };
|
enum XNACK_REQUEST { XNACK_DISABLE = 0, XNACK_ENABLE = 1, XNACK_UNCHANGED = 2 };
|
||||||
@@ -175,6 +176,10 @@ class Flag {
|
|||||||
var = os::GetEnvVar("HSA_SVM_PROFILE");
|
var = os::GetEnvVar("HSA_SVM_PROFILE");
|
||||||
svm_profile_ = var;
|
svm_profile_ = var;
|
||||||
|
|
||||||
|
var = os::GetEnvVar("HSA_ENABLE_SRAMECC");
|
||||||
|
sramecc_enable_ =
|
||||||
|
(var == "0") ? SRAMECC_DISABLED : ((var == "1") ? SRAMECC_ENABLED : SRAMECC_DEFAULT);
|
||||||
|
|
||||||
var = os::GetEnvVar("HSA_IMAGE_PRINT_SRD");
|
var = os::GetEnvVar("HSA_IMAGE_PRINT_SRD");
|
||||||
image_print_srd_ = (var == "1") ? true : false;
|
image_print_srd_ = (var == "1") ? true : false;
|
||||||
|
|
||||||
@@ -269,6 +274,8 @@ class Flag {
|
|||||||
|
|
||||||
const std::string& svm_profile() const { return svm_profile_; }
|
const std::string& svm_profile() const { return svm_profile_; }
|
||||||
|
|
||||||
|
SRAMECC_ENABLE sramecc_enable() const { return sramecc_enable_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool check_flat_scratch_;
|
bool check_flat_scratch_;
|
||||||
bool enable_vm_fault_message_;
|
bool enable_vm_fault_message_;
|
||||||
@@ -312,6 +319,8 @@ class Flag {
|
|||||||
// Indicates user preference for Xnack state.
|
// Indicates user preference for Xnack state.
|
||||||
XNACK_REQUEST xnack_;
|
XNACK_REQUEST xnack_;
|
||||||
|
|
||||||
|
SRAMECC_ENABLE sramecc_enable_;
|
||||||
|
|
||||||
// Map GPU index post RVD to its default cu mask.
|
// Map GPU index post RVD to its default cu mask.
|
||||||
std::map<uint32_t, std::vector<uint32_t>> cu_mask_;
|
std::map<uint32_t, std::vector<uint32_t>> cu_mask_;
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user