mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Revert "feature(sysman): Win support PMT based getMemoryBandWidth"
This reverts commit 8d80941fff.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
15e8f135ba
commit
659075ffe5
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
|
||||
#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h"
|
||||
#include "level_zero/sysman/source/shared/windows/sysman_kmd_sys_manager.h"
|
||||
|
||||
namespace L0 {
|
||||
@@ -178,8 +177,52 @@ ze_result_t WddmMemoryImp::getProperties(zes_mem_properties_t *pProperties) {
|
||||
}
|
||||
|
||||
ze_result_t WddmMemoryImp::getBandwidth(zes_mem_bandwidth_t *pBandwidth) {
|
||||
auto pSysmanProductHelper = pWddmSysmanImp->getSysmanProductHelper();
|
||||
return pSysmanProductHelper->getMemoryBandWidth(pBandwidth, pWddmSysmanImp);
|
||||
uint32_t retValu32 = 0;
|
||||
uint64_t retValu64 = 0;
|
||||
std::vector<KmdSysman::RequestProperty> vRequests = {};
|
||||
std::vector<KmdSysman::ResponseProperty> vResponses = {};
|
||||
KmdSysman::RequestProperty request = {};
|
||||
|
||||
request.commandId = KmdSysman::Command::Get;
|
||||
request.componentId = KmdSysman::Component::MemoryComponent;
|
||||
|
||||
request.requestId = KmdSysman::Requests::Memory::MaxBandwidth;
|
||||
vRequests.push_back(request);
|
||||
|
||||
request.requestId = KmdSysman::Requests::Memory::CurrentBandwidthRead;
|
||||
vRequests.push_back(request);
|
||||
|
||||
request.requestId = KmdSysman::Requests::Memory::CurrentBandwidthWrite;
|
||||
vRequests.push_back(request);
|
||||
|
||||
ze_result_t status = pKmdSysManager->requestMultiple(vRequests, vResponses);
|
||||
|
||||
if ((status != ZE_RESULT_SUCCESS) || (vResponses.size() != vRequests.size())) {
|
||||
return status;
|
||||
}
|
||||
|
||||
pBandwidth->maxBandwidth = 0;
|
||||
if (vResponses[0].returnCode == KmdSysman::Success) {
|
||||
memcpy_s(&retValu32, sizeof(uint32_t), vResponses[0].dataBuffer, sizeof(uint32_t));
|
||||
pBandwidth->maxBandwidth = static_cast<uint64_t>(retValu32) * static_cast<uint64_t>(mbpsToBytesPerSecond);
|
||||
}
|
||||
|
||||
pBandwidth->readCounter = 0;
|
||||
if (vResponses[1].returnCode == KmdSysman::Success) {
|
||||
memcpy_s(&retValu64, sizeof(uint64_t), vResponses[1].dataBuffer, sizeof(uint64_t));
|
||||
pBandwidth->readCounter = retValu64;
|
||||
}
|
||||
|
||||
pBandwidth->writeCounter = 0;
|
||||
if (vResponses[2].returnCode == KmdSysman::Success) {
|
||||
memcpy_s(&retValu64, sizeof(uint64_t), vResponses[2].dataBuffer, sizeof(uint64_t));
|
||||
pBandwidth->writeCounter = retValu64;
|
||||
}
|
||||
|
||||
std::chrono::time_point<std::chrono::steady_clock> ts = std::chrono::steady_clock::now();
|
||||
pBandwidth->timestamp = std::chrono::duration_cast<std::chrono::microseconds>(ts.time_since_epoch()).count();
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ze_result_t WddmMemoryImp::getState(zes_mem_state_t *pState) {
|
||||
@@ -226,7 +269,7 @@ ze_result_t WddmMemoryImp::getState(zes_mem_state_t *pState) {
|
||||
}
|
||||
|
||||
WddmMemoryImp::WddmMemoryImp(OsSysman *pOsSysman, ze_bool_t onSubdevice, uint32_t subdeviceId) : isSubdevice(onSubdevice), subdeviceId(subdeviceId) {
|
||||
pWddmSysmanImp = static_cast<WddmSysmanImp *>(pOsSysman);
|
||||
WddmSysmanImp *pWddmSysmanImp = static_cast<WddmSysmanImp *>(pOsSysman);
|
||||
pKmdSysManager = &pWddmSysmanImp->getKmdSysManager();
|
||||
|
||||
hGetProcPDH = LoadLibrary(L"C:\\Windows\\System32\\pdh.dll");
|
||||
|
||||
@@ -35,7 +35,6 @@ class WddmMemoryImp : public OsMemory, NEO::NonCopyableOrMovableClass {
|
||||
|
||||
protected:
|
||||
KmdSysManager *pKmdSysManager = nullptr;
|
||||
WddmSysmanImp *pWddmSysmanImp = nullptr;
|
||||
bool isSubdevice = false;
|
||||
uint32_t subdeviceId = 0;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ ze_result_t PlatformMonitoringTech::readValue(const std::string &key, uint32_t &
|
||||
|
||||
auto res = ioctlReadWriteData(deviceInterface, PmtSysman::IoctlPmtGetTelemtryDword, (void *)&readRequest, sizeof(PmtSysman::PmtTelemetryRead), &value, sizeof(uint32_t), &bytesReturned);
|
||||
|
||||
if (res == ZE_RESULT_SUCCESS && bytesReturned != 0) {
|
||||
if (res == ZE_RESULT_SUCCESS && value != NULL && bytesReturned != 0) {
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ ze_result_t PlatformMonitoringTech::readValue(const std::string &key, uint64_t &
|
||||
|
||||
auto res = ioctlReadWriteData(deviceInterface, PmtSysman::IoctlPmtGetTelemtryQword, (void *)&readRequest, sizeof(PmtSysman::PmtTelemetryRead), &value, sizeof(uint64_t), &bytesReturned);
|
||||
|
||||
if (res == ZE_RESULT_SUCCESS && bytesReturned != 0) {
|
||||
if (res == ZE_RESULT_SUCCESS && value != NULL && bytesReturned != 0) {
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,6 @@ class SysmanProductHelper {
|
||||
// Pci
|
||||
virtual ze_result_t getPciStats(zes_pci_stats_t *pStats, WddmSysmanImp *pWddmSysmanImp) = 0;
|
||||
|
||||
// Memory
|
||||
virtual ze_result_t getMemoryBandWidth(zes_mem_bandwidth_t *pBandwidth, WddmSysmanImp *pWddmSysmanImp) = 0;
|
||||
|
||||
protected:
|
||||
SysmanProductHelper() = default;
|
||||
};
|
||||
|
||||
@@ -31,9 +31,6 @@ class SysmanProductHelperHw : public SysmanProductHelper {
|
||||
// Pci
|
||||
ze_result_t getPciStats(zes_pci_stats_t *pStats, WddmSysmanImp *pWddmSysmanImp) override;
|
||||
|
||||
// Memory
|
||||
ze_result_t getMemoryBandWidth(zes_mem_bandwidth_t *pBandwidth, WddmSysmanImp *pWddmSysmanImp) override;
|
||||
|
||||
protected:
|
||||
SysmanProductHelperHw() = default;
|
||||
};
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h"
|
||||
#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h"
|
||||
#include "level_zero/sysman/source/sysman_const.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace Sysman {
|
||||
@@ -91,56 +90,5 @@ ze_result_t SysmanProductHelperHw<gfxProduct>::getPciStats(zes_pci_stats_t *pSta
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
ze_result_t SysmanProductHelperHw<gfxProduct>::getMemoryBandWidth(zes_mem_bandwidth_t *pBandwidth, WddmSysmanImp *pWddmSysmanImp) {
|
||||
KmdSysManager *pKmdSysManager = &pWddmSysmanImp->getKmdSysManager();
|
||||
uint32_t retValu32 = 0;
|
||||
uint64_t retValu64 = 0;
|
||||
std::vector<KmdSysman::RequestProperty> vRequests = {};
|
||||
std::vector<KmdSysman::ResponseProperty> vResponses = {};
|
||||
KmdSysman::RequestProperty request = {};
|
||||
|
||||
request.commandId = KmdSysman::Command::Get;
|
||||
request.componentId = KmdSysman::Component::MemoryComponent;
|
||||
|
||||
request.requestId = KmdSysman::Requests::Memory::MaxBandwidth;
|
||||
vRequests.push_back(request);
|
||||
|
||||
request.requestId = KmdSysman::Requests::Memory::CurrentBandwidthRead;
|
||||
vRequests.push_back(request);
|
||||
|
||||
request.requestId = KmdSysman::Requests::Memory::CurrentBandwidthWrite;
|
||||
vRequests.push_back(request);
|
||||
|
||||
ze_result_t status = pKmdSysManager->requestMultiple(vRequests, vResponses);
|
||||
|
||||
if ((status != ZE_RESULT_SUCCESS) || (vResponses.size() != vRequests.size())) {
|
||||
return status;
|
||||
}
|
||||
|
||||
pBandwidth->maxBandwidth = 0;
|
||||
if (vResponses[0].returnCode == KmdSysman::Success) {
|
||||
memcpy_s(&retValu32, sizeof(uint32_t), vResponses[0].dataBuffer, sizeof(uint32_t));
|
||||
pBandwidth->maxBandwidth = static_cast<uint64_t>(retValu32) * static_cast<uint64_t>(mbpsToBytesPerSecond);
|
||||
}
|
||||
|
||||
pBandwidth->readCounter = 0;
|
||||
if (vResponses[1].returnCode == KmdSysman::Success) {
|
||||
memcpy_s(&retValu64, sizeof(uint64_t), vResponses[1].dataBuffer, sizeof(uint64_t));
|
||||
pBandwidth->readCounter = retValu64;
|
||||
}
|
||||
|
||||
pBandwidth->writeCounter = 0;
|
||||
if (vResponses[2].returnCode == KmdSysman::Success) {
|
||||
memcpy_s(&retValu64, sizeof(uint64_t), vResponses[2].dataBuffer, sizeof(uint64_t));
|
||||
pBandwidth->writeCounter = retValu64;
|
||||
}
|
||||
|
||||
std::chrono::time_point<std::chrono::steady_clock> ts = std::chrono::steady_clock::now();
|
||||
pBandwidth->timestamp = std::chrono::duration_cast<std::chrono::microseconds>(ts.time_since_epoch()).count();
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
} // namespace Sysman
|
||||
} // namespace L0
|
||||
|
||||
@@ -73,7 +73,7 @@ constexpr uint64_t minTimeoutModeHeartbeat = 5000u;
|
||||
constexpr uint64_t minTimeoutInMicroSeconds = 1000u;
|
||||
constexpr uint16_t milliSecsToMicroSecs = 1000;
|
||||
constexpr uint32_t milliFactor = 1000u;
|
||||
constexpr uint32_t microFactor = milliFactor * milliFactor;
|
||||
constexpr uint32_t microFacor = milliFactor * milliFactor;
|
||||
constexpr uint64_t gigaUnitTransferToUnitTransfer = 1000 * 1000 * 1000;
|
||||
|
||||
constexpr int32_t memoryBusWidth = 128; // bus width in bytes
|
||||
|
||||
Reference in New Issue
Block a user