refactor: print faulted address when waiting for tag

getDeviceState on Windows prints faulted GPU VA
if OOB access happened.

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2025-10-02 13:06:00 +00:00
committed by Compute-Runtime-Automation
parent 98b6259129
commit ee032982a6
5 changed files with 29 additions and 3 deletions

View File

@@ -42,6 +42,11 @@ class MockDriverModel : public NEO::DriverModel {
return isGpuHangDetectedToReturn;
}
bool getDeviceState() override {
getDeviceStateCalledCount++;
return false;
}
PhysicalDevicePciSpeedInfo getPciSpeedInfo() const override { return pciSpeedInfo; }
const HardwareInfo *getHardwareInfo() const override { return nullptr; }
@@ -51,6 +56,7 @@ class MockDriverModel : public NEO::DriverModel {
bool isGpuHangDetectedToReturn{};
std::function<void()> isGpuHangDetectedSideEffect{};
size_t maxAllocSize = 0;
uint32_t getDeviceStateCalledCount = 0;
};
class MockDriverModelWDDM : public MockDriverModel {

View File

@@ -445,6 +445,20 @@ HWTEST_F(CommandStreamReceiverTest, givenDisableGpuHangDetectionFlagWhenChecking
EXPECT_FALSE(csr.isGpuHangDetected());
}
HWTEST_F(CommandStreamReceiverTest, givenCheckingGpuHangWhenGpuHangDetectedThenGetDeviceStateIsCalled) {
auto driverModelMock = std::make_unique<MockDriverModel>();
driverModelMock->isGpuHangDetectedToReturn = true;
auto driverModel = driverModelMock.get();
auto osInterface = std::make_unique<OSInterface>();
osInterface->setDriverModel(std::move(driverModelMock));
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
csr.executionEnvironment.rootDeviceEnvironments[csr.rootDeviceIndex]->osInterface = std::move(osInterface);
EXPECT_TRUE(csr.isGpuHangDetected());
EXPECT_EQ(1u, driverModel->getDeviceStateCalledCount);
}
HWTEST_F(CommandStreamReceiverTest, givenGpuHangWhenWaititingForCompletionWithTimeoutThenGpuHangIsReturned) {
auto driverModelMock = std::make_unique<MockDriverModel>();
driverModelMock->isGpuHangDetectedToReturn = true;