[SWDEV-483526] Fix MI3x partitions not showing all logical nodes
Changes:
- Updates to amdsmi_asic_info_t structure to include:
target_graphics_version, kfd_id, node_id, partition_id
- Updates to amd-smi static --asic to display new
samdsmi_asic_info_t fields
- Updates to gpu enumeration during amdsmi_init()
to discover all logical GPUs when in a non-SPX mode
(ex. DPX, TPX, QPX, or CPX)
- Updates to amdsmi_get_gpu_bdf_id(..) to include
partition_id details when in BDF or optional bits.
- bits [63:32] = domain
- bits [31:28] or bits [2:0] = partition id
- bits [27:16] = reserved
- bits [15:8] = Bus
- bits [7:3] = Device
- bits [2:0] = Function (partition id maybe in bits [2:0]) <-- Fallback for non SPX modes
- C++/Python tests updated to reflect these outputs
Change-Id: I4be0ea35bb98f3109ae2ca9e82f6b21baa38de29
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <limits>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amdsmi.h"
|
||||
@@ -58,7 +59,9 @@
|
||||
TestSysInfoRead::TestSysInfoRead() : TestBase() {
|
||||
set_title("AMDSMI System Info Read Test");
|
||||
set_description("This test verifies that system information such as the "
|
||||
"BDFID, AMDSMI version, VBIOS version, etc. can be read properly.");
|
||||
"BDFID, AMDSMI version, VBIOS version, "
|
||||
"vendor_id, unique_id, target_gfx_version, kfd_id, node_id, partition_id, etc. "
|
||||
"can be read properly.");
|
||||
}
|
||||
|
||||
TestSysInfoRead::~TestSysInfoRead(void) {
|
||||
@@ -150,22 +153,39 @@ void TestSysInfoRead::Run(void) {
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
|
||||
// vendor_id, unique_id
|
||||
amdsmi_asic_info_t asci_info;
|
||||
err = amdsmi_get_gpu_asic_info(processor_handles_[0], &asci_info);
|
||||
// vendor_id, unique_id, target_gfx_version, kfd_id, node_id, partition_id
|
||||
amdsmi_asic_info_t asci_info = {};
|
||||
err = amdsmi_get_gpu_asic_info(processor_handles_[i], &asci_info);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout <<
|
||||
"\t**amdsmi_dev_unique_id() is not supported"
|
||||
" on this machine" << std::endl;
|
||||
EXPECT_EQ(asci_info.target_graphics_version, std::numeric_limits<uint64_t>::max());
|
||||
EXPECT_EQ(asci_info.kfd_id, std::numeric_limits<uint64_t>::max());
|
||||
EXPECT_EQ(asci_info.node_id, std::numeric_limits<uint32_t>::max());
|
||||
EXPECT_EQ(asci_info.partition_id, std::numeric_limits<uint32_t>::max());
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_get_gpu_asic_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
if (err == AMDSMI_STATUS_SUCCESS) {
|
||||
IF_VERB(STANDARD) {
|
||||
std:: cout << "\t**GPU PCIe Vendor : "
|
||||
std:: cout << "\t**GPU PCIe Vendor : "
|
||||
<< asci_info.vendor_name << std::endl;
|
||||
std::cout << "\t**Target GFX version: " << std::dec
|
||||
<< asci_info.target_graphics_version << "\n";
|
||||
std::cout << "\t**KFD ID: " << std::dec
|
||||
<< asci_info.kfd_id << "\n";
|
||||
std::cout << "\t**Node ID: " << std::dec
|
||||
<< asci_info.node_id << "\n";
|
||||
std::cout << "\t**Partition ID: " << std::dec
|
||||
<< asci_info.partition_id << "\n";
|
||||
}
|
||||
EXPECT_EQ(err, AMDSMI_STATUS_SUCCESS);
|
||||
EXPECT_NE(asci_info.target_graphics_version, std::numeric_limits<uint64_t>::max());
|
||||
EXPECT_NE(asci_info.kfd_id, std::numeric_limits<uint64_t>::max());
|
||||
EXPECT_NE(asci_info.node_id, std::numeric_limits<uint32_t>::max());
|
||||
EXPECT_NE(asci_info.partition_id, std::numeric_limits<uint32_t>::max());
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_get_gpu_asic_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
@@ -137,8 +137,7 @@ void TestTempRead::Run(void) {
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**" << label << ": " << val_i64/1000 <<
|
||||
"C" << std::endl;
|
||||
std::cout << "\t**" << label << ": " << val_i64 << "C" << std::endl;
|
||||
}
|
||||
};
|
||||
for (type = AMDSMI_TEMPERATURE_TYPE_FIRST; type <= AMDSMI_TEMPERATURE_TYPE__MAX; ++type) {
|
||||
|
||||
Reference in New Issue
Block a user