fix: Disable IPC windows support by default

Related-to: NEO-15981

- Disables IPC windows support by default by setting
EnableShareableWithoutNTHandle to 0
- EnableShareableWithoutNTHandle can be set to 1 to enable
IPC windows support
- Addresses issue with potential performance issues On Windows
given shareable memory until a better soluition is found
to support IPC on Windows.

Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
This commit is contained in:
Neil R. Spruit
2025-09-11 17:54:52 +00:00
committed by Compute-Runtime-Automation
parent afe219879c
commit c32e639472
4 changed files with 48 additions and 3 deletions

View File

@@ -2152,6 +2152,52 @@ TEST_F(MemoryTest, whenAllocatingSharedMemoryWithHostInitialPlacementBiasFlagThe
ASSERT_EQ(result, ZE_RESULT_SUCCESS);
}
HWTEST2_F(MemoryTest, whenAllocatingDeviceMemoryWithEnableShareableWithoutNTHandleFlagOnNonDG1ThenShareableWithoutNTHandleIsSet, IsNotDG1) {
DebugManagerStateRestore restorer;
NEO::debugManager.flags.EnableShareableWithoutNTHandle.set(1);
size_t size = 10;
size_t alignment = 1u;
void *ptr = nullptr;
ze_device_mem_alloc_desc_t deviceDesc = {};
ze_result_t result = context->allocDeviceMem(device->toHandle(),
&deviceDesc,
size, alignment, &ptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_NE(nullptr, ptr);
auto allocData = driverHandle->getSvmAllocsManager()->getSVMAlloc(ptr);
EXPECT_NE(nullptr, allocData);
EXPECT_EQ(allocData->allocationFlagsProperty.flags.shareableWithoutNTHandle, 1u);
result = context->freeMem(ptr);
ASSERT_EQ(result, ZE_RESULT_SUCCESS);
}
HWTEST2_F(MemoryTest, whenAllocatingDeviceMemoryWithEnableShareableWithoutNTHandleFlagOnDG1ThenShareableWithoutNTHandleIsNotSet, IsDG1) {
DebugManagerStateRestore restorer;
NEO::debugManager.flags.EnableShareableWithoutNTHandle.set(1);
size_t size = 10;
size_t alignment = 1u;
void *ptr = nullptr;
ze_device_mem_alloc_desc_t deviceDesc = {};
ze_result_t result = context->allocDeviceMem(device->toHandle(),
&deviceDesc,
size, alignment, &ptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_NE(nullptr, ptr);
auto allocData = driverHandle->getSvmAllocsManager()->getSVMAlloc(ptr);
EXPECT_NE(nullptr, allocData);
EXPECT_EQ(allocData->allocationFlagsProperty.flags.shareableWithoutNTHandle, 0u);
result = context->freeMem(ptr);
ASSERT_EQ(result, ZE_RESULT_SUCCESS);
}
struct SVMAllocsManagerFreeExtMock : public NEO::SVMAllocsManager {
SVMAllocsManagerFreeExtMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager) {}
bool freeSVMAlloc(void *ptr, bool blocking) override {

View File

@@ -30,7 +30,6 @@ struct AllocUsmPoolMemoryTest : public ::testing::Test {
NEO::debugManager.flags.EnableHostUsmAllocationPool.set(hostUsmPoolFlag);
NEO::debugManager.flags.EnableDeviceUsmAllocationPool.set(deviceUsmPoolFlag);
NEO::debugManager.flags.ExperimentalUSMAllocationReuseVersion.set(poolingVersionFlag);
NEO::debugManager.flags.EnableShareableWithoutNTHandle.set(false);
executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(numRootDevices);