mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
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:
committed by
Compute-Runtime-Automation
parent
98b6259129
commit
ee032982a6
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user