[SWDEV-488276/SWDEV-497613] Update memory partition set functionality
Changes:
- Added warning screen to ROCm SMI users
setting memory partition
- Added new API (rsmi_dev_memory_partition_capabilities_get)
to retrieve memory partition capabilities
(What users can set memory partition modes to)
- Increased time-bar for CLI sets display to 40 seconds
- API now waits until the driver reloads with SYSFS files active
- [SWDEV-475712] [CLI/API] Fixed target_graphics_version field
not properly displaying for MI2x or Navi 3x ASICs.
- Updated tests
Change-Id: Iaf89d1b7ad9ceb449b289bc82ea198fe3b23992e
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
このコミットが含まれているのは:
1 親
568cc6e7c7
コミット
46902274b6
10ファイル変更
+595
-123
検索条件に一致するファイルはありません
@@ -111,13 +111,13 @@ mapStringToRSMIMemoryPartitionTypes {
|
||||
};
|
||||
|
||||
void TestMemoryPartitionReadWrite::Run(void) {
|
||||
GTEST_SKIP_("Temporarily disabled"); // Skipped due to SWDEV-491215 -
|
||||
// will be re-enabled in rocm 6.4
|
||||
rsmi_status_t ret, err;
|
||||
rsmi_status_t ret, err, ret_set;
|
||||
char orig_memory_partition[255];
|
||||
char current_memory_partition[255];
|
||||
char current_memory_capabilities[255];
|
||||
orig_memory_partition[0] = '\0';
|
||||
current_memory_partition[0] = '\0';
|
||||
current_memory_capabilities[0] = '\0';
|
||||
|
||||
TestBase::Run();
|
||||
if (setup_failed_) {
|
||||
@@ -179,7 +179,18 @@ void TestMemoryPartitionReadWrite::Run(void) {
|
||||
|
||||
if (err == RSMI_STATUS_INVALID_ARGS) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**"
|
||||
std::cout << "\t**rsmi_dev_memory_partition_get(dv_ind, nullptr, 255): "
|
||||
<< "Confirmed RSMI_STATUS_INVALID_ARGS was returned."
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
err = rsmi_dev_memory_partition_capabilities_get(dv_ind, nullptr, 255);
|
||||
ASSERT_EQ(err, RSMI_STATUS_INVALID_ARGS);
|
||||
|
||||
if (err == RSMI_STATUS_INVALID_ARGS) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**rsmi_dev_memory_partition_capabilities_get(dv_ind, nullptr, 255): "
|
||||
<< "Confirmed RSMI_STATUS_INVALID_ARGS was returned."
|
||||
<< std::endl;
|
||||
}
|
||||
@@ -187,11 +198,24 @@ void TestMemoryPartitionReadWrite::Run(void) {
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = rsmi_dev_memory_partition_get(dv_ind, orig_memory_partition, 0);
|
||||
ASSERT_TRUE((err == RSMI_STATUS_INVALID_ARGS) ||
|
||||
(err == RSMI_STATUS_NOT_SUPPORTED));
|
||||
if (err == RSMI_STATUS_INVALID_ARGS) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**rsmi_dev_memory_partition_get(dv_ind, orig_memory_partition, 0): "
|
||||
<< "Confirmed RSMI_STATUS_INVALID_ARGS was returned."
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
err = rsmi_dev_memory_partition_capabilities_get(dv_ind, current_memory_capabilities, 0);
|
||||
ASSERT_TRUE((err == RSMI_STATUS_INVALID_ARGS) ||
|
||||
(err == RSMI_STATUS_NOT_SUPPORTED));
|
||||
if (err == RSMI_STATUS_INVALID_ARGS) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**"
|
||||
<< "rsmi_dev_memory_partition_capabilities_get(dv_ind, "
|
||||
<< "current_memory_capabilities, 0): "
|
||||
<< "Confirmed RSMI_STATUS_INVALID_ARGS was returned."
|
||||
<< std::endl;
|
||||
}
|
||||
@@ -256,6 +280,8 @@ void TestMemoryPartitionReadWrite::Run(void) {
|
||||
for (int partition = RSMI_MEMORY_PARTITION_NPS1;
|
||||
partition <= RSMI_MEMORY_PARTITION_NPS8;
|
||||
partition++) {
|
||||
ret_set = RSMI_STATUS_NOT_SUPPORTED;
|
||||
wasSetSuccess = false;
|
||||
new_memory_partition = static_cast<rsmi_memory_partition_type>(partition);
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << std::endl;
|
||||
@@ -269,17 +295,46 @@ void TestMemoryPartitionReadWrite::Run(void) {
|
||||
<< "Attempting to set memory partition to: "
|
||||
<< memoryPartitionString(new_memory_partition) << std::endl;
|
||||
}
|
||||
ret = rsmi_dev_memory_partition_set(dv_ind, new_memory_partition);
|
||||
if (ret == RSMI_STATUS_NOT_SUPPORTED) {
|
||||
|
||||
rsmi_status_t ret_caps = rsmi_dev_memory_partition_capabilities_get(dv_ind,
|
||||
current_memory_capabilities, 255);
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**"
|
||||
<< "rsmi_dev_memory_partition_capabilities_get(" << dv_ind
|
||||
<< ", current_memory_capabilities, 255): "
|
||||
<< amd::smi::getRSMIStatusString(ret_caps, false) << std::endl;
|
||||
std::cout << "\t**"
|
||||
<< "current_memory_capabilities: " << current_memory_capabilities
|
||||
<< std::endl;
|
||||
}
|
||||
ASSERT_TRUE((ret_caps == RSMI_STATUS_NOT_SUPPORTED) ||
|
||||
(ret_caps == RSMI_STATUS_SUCCESS));
|
||||
|
||||
ret_set = rsmi_dev_memory_partition_set(dv_ind, new_memory_partition);
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**" << "rsmi_dev_memory_partition_set("
|
||||
<< dv_ind << " , " << memoryPartitionString(new_memory_partition) << "): "
|
||||
<< amd::smi::getRSMIStatusString(ret_set, false) << "\n";
|
||||
}
|
||||
if (ret_set == RSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**" << ": "
|
||||
<< "Not supported on this machine" << std::endl;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
CHK_ERR_ASRT(ret)
|
||||
ASSERT_TRUE((ret_set == RSMI_STATUS_SUCCESS)
|
||||
|| (ret_set == RSMI_STATUS_BUSY)
|
||||
|| (ret_set == RSMI_STATUS_AMDGPU_RESTART_ERR)
|
||||
|| (ret_set == RSMI_STATUS_INVALID_ARGS)
|
||||
|| (ret_set == RSMI_STATUS_NOT_SUPPORTED));
|
||||
}
|
||||
if (ret != RSMI_STATUS_SUCCESS) { // do not continue trying to reset
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**" << "rsmi_dev_memory_partition_set("
|
||||
<< dv_ind << " , " << memoryPartitionString(new_memory_partition) << "): "
|
||||
<< amd::smi::getRSMIStatusString(ret_set, false) << "\n";
|
||||
}
|
||||
if (ret_set == RSMI_STATUS_SUCCESS) { // do not continue trying to reset
|
||||
wasSetSuccess = true;
|
||||
}
|
||||
|
||||
@@ -291,17 +346,25 @@ void TestMemoryPartitionReadWrite::Run(void) {
|
||||
<< "Current memory partition: " << current_memory_partition
|
||||
<< std::endl;
|
||||
}
|
||||
ASSERT_EQ(RSMI_STATUS_SUCCESS, ret);
|
||||
ASSERT_STREQ(memoryPartitionString(new_memory_partition).c_str(),
|
||||
if (wasSetSuccess) {
|
||||
ASSERT_EQ(RSMI_STATUS_SUCCESS, ret_set);
|
||||
ASSERT_STREQ(memoryPartitionString(new_memory_partition).c_str(),
|
||||
current_memory_partition);
|
||||
CHK_ERR_ASRT(ret_set)
|
||||
} else {
|
||||
ASSERT_NE(RSMI_STATUS_SUCCESS, ret_set);
|
||||
ASSERT_STRNE(memoryPartitionString(new_memory_partition).c_str(),
|
||||
current_memory_partition);
|
||||
}
|
||||
}
|
||||
|
||||
/* TEST RETURN TO BOOT MEMORY PARTITION SETTING */
|
||||
/* TEST RETURN TO ORIGINAL MEMORY PARTITION SETTING */
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << std::endl;
|
||||
std::cout << "\t**"
|
||||
<< "=========== TEST RETURN TO BOOT MEMORY PARTITION "
|
||||
<< "SETTING ========" << std::endl;
|
||||
<< "=========== TEST RETURN TO ORIGINAL MEMORY PARTITION "
|
||||
<< "SETTING ( " << orig_memory_partition
|
||||
<< " ) ========" << std::endl;
|
||||
}
|
||||
std::string oldMode = current_memory_partition;
|
||||
|
||||
@@ -312,31 +375,7 @@ void TestMemoryPartitionReadWrite::Run(void) {
|
||||
<< "Current memory partition: " << current_memory_partition
|
||||
<< std::endl;
|
||||
}
|
||||
if (wasSetSuccess) {
|
||||
ASSERT_STRNE(oldMode.c_str(), current_memory_partition);
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**"
|
||||
<< "Confirmed prior memory partition (" << oldMode << ") is "
|
||||
<< "not equal to current memory partition ("
|
||||
<< current_memory_partition << ")" << std::endl;
|
||||
}
|
||||
} else {
|
||||
ASSERT_STREQ(oldMode.c_str(), current_memory_partition);
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**"
|
||||
<< "Confirmed prior memory partition (" << oldMode << ") is "
|
||||
<< "equal to current memory partition ("
|
||||
<< current_memory_partition << ")" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
/* TEST RETURN TO ORIGINAL MEMORY PARTITION SETTING */
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << std::endl;
|
||||
std::cout << "\t**"
|
||||
<< "=========== TEST RETURN TO ORIGINAL MEMORY PARTITION "
|
||||
<< "SETTING ========" << std::endl;
|
||||
}
|
||||
new_memory_partition
|
||||
= mapStringToRSMIMemoryPartitionTypes.at(orig_memory_partition);
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -344,6 +383,12 @@ void TestMemoryPartitionReadWrite::Run(void) {
|
||||
<< memoryPartitionString(new_memory_partition) << std::endl;
|
||||
}
|
||||
ret = rsmi_dev_memory_partition_set(dv_ind, new_memory_partition);
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**"
|
||||
<< "rsmi_dev_memory_partition_set(" << dv_ind
|
||||
<< ", " << orig_memory_partition << "): "
|
||||
<< amd::smi::getRSMIStatusString(ret, false) << std::endl;
|
||||
}
|
||||
CHK_ERR_ASRT(ret)
|
||||
ret = rsmi_dev_memory_partition_get(dv_ind, current_memory_partition, 255);
|
||||
CHK_ERR_ASRT(ret)
|
||||
@@ -355,6 +400,12 @@ void TestMemoryPartitionReadWrite::Run(void) {
|
||||
<< std::endl;
|
||||
}
|
||||
ASSERT_EQ(RSMI_STATUS_SUCCESS, ret);
|
||||
ASSERT_STREQ(memoryPartitionString(new_memory_partition).c_str(), current_memory_partition);
|
||||
ASSERT_STREQ(orig_memory_partition, current_memory_partition);
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**"
|
||||
<< "Confirmed prior memory partition (" << orig_memory_partition
|
||||
<< ") is equal to current memory partition ("
|
||||
<< current_memory_partition << ")" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする