mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 07:14:10 +08:00
fix: stop Direct Submission on device teardown
This prevents a race condition, causing page faults, where device related resources are released, but are still in use by commands (e.g. cache flushes) submitted by the Direct Submission Controller. Related-To: NEO-15017 Signed-off-by: Radoslaw Jablonski <radoslaw.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6511837348
commit
be6fe9294c
@@ -1717,6 +1717,8 @@ void DeviceImp::releaseResources() {
|
||||
|
||||
UNRECOVERABLE_IF(neoDevice == nullptr);
|
||||
|
||||
neoDevice->stopDirectSubmissionAndWaitForCompletion();
|
||||
|
||||
if (this->globalTimestampAllocation) {
|
||||
driverHandle->getSvmAllocsManager()->freeSVMAlloc(this->globalTimestampAllocation);
|
||||
}
|
||||
|
||||
@@ -4439,6 +4439,15 @@ TEST_F(DeviceTest, givenValidDeviceWhenCallingReleaseResourcesThenResourcesRelea
|
||||
EXPECT_TRUE(deviceImp->resourcesReleased);
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, givenValidDeviceWhenCallingReleaseResourcesThenDirectSubmissionIsStopped) {
|
||||
auto deviceImp = static_cast<DeviceImp *>(device);
|
||||
EXPECT_FALSE(neoDevice->stopDirectSubmissionCalled);
|
||||
neoDevice->incRefInternal();
|
||||
deviceImp->releaseResources();
|
||||
EXPECT_TRUE(neoDevice->stopDirectSubmissionCalled);
|
||||
neoDevice->decRefInternal();
|
||||
}
|
||||
|
||||
HWTEST_F(DeviceTest, givenCooperativeDispatchSupportedWhenQueryingPropertiesFlagsThenCooperativeKernelsAreSupported) {
|
||||
struct MockGfxCoreHelper : NEO::GfxCoreHelperHw<FamilyType> {
|
||||
bool isCooperativeDispatchSupported(const EngineGroupType engineGroupType, const RootDeviceEnvironment &rootDeviceEnvironment) const override {
|
||||
|
||||
Reference in New Issue
Block a user