Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions smi-lib/cli/cpp/src/smi_cli_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,16 @@ AmdSmiPlatform::AmdSmiPlatform()
operating_system = "unknown";
#endif
if(is_windows_) {
std::string diskpart_out = exec("diskpart /?");
if (diskpart_out.find("MININT") != std::string::npos) {
#ifdef _WIN64
// Preserve the MININT computer-name check without launching an elevated utility.
wchar_t computer_name[MAX_COMPUTERNAME_LENGTH + 1] = {};
DWORD computer_name_size = MAX_COMPUTERNAME_LENGTH + 1;
if (GetComputerNameW(computer_name, &computer_name_size) &&
std::wstring(computer_name, computer_name_size).find(L"MININT") != std::wstring::npos) {
is_baremetal_ = true;
is_nv_ = true;
return;
}
#ifdef _WIN64
std::string output = get_device_ids();
is_mi300_ = check_if_mi30x(output);
is_nv_ = check_if_nv(output);
Expand All @@ -323,12 +326,7 @@ AmdSmiPlatform::AmdSmiPlatform()
} else if (status == "FALSE") {
is_baremetal_ = true;
} else {
std::string diskpart_out = exec("diskpart /?");
if (diskpart_out.find("MININT") != std::string::npos) {
is_baremetal_ = true;
} else {
unknown_platform = true;
}
unknown_platform = true;
}
}
#endif
Expand Down