Revert "refactor: Gate shared system mem caps with KMD cap"
This reverts commit 8e59ac7576
.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
parent
786bf8a9fa
commit
7167f45199
|
@ -319,7 +319,7 @@ TEST_F(CommandListCreateTests, givenValidSystemAlloctedPtrAndSharedSystemAllocat
|
||||||
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||||
|
|
||||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
|
||||||
auto res = commandList->appendMemAdvise(device, ptr, size, ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION);
|
auto res = commandList->appendMemAdvise(device, ptr, size, ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION);
|
||||||
EXPECT_EQ(1u, commandList->getMemAdviseOperations().size());
|
EXPECT_EQ(1u, commandList->getMemAdviseOperations().size());
|
||||||
|
@ -354,7 +354,7 @@ TEST_P(SupportedMemAdviceSystemAllocatorTests, givenValidSystemAlloctedPtrWhenEx
|
||||||
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||||
|
|
||||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
|
||||||
auto res = commandList->executeMemAdvise(device, ptr, size, GetParam());
|
auto res = commandList->executeMemAdvise(device, ptr, size, GetParam());
|
||||||
EXPECT_EQ(1u, memoryManager->setSharedSystemMemAdviseCalledCount);
|
EXPECT_EQ(1u, memoryManager->setSharedSystemMemAdviseCalledCount);
|
||||||
|
@ -396,7 +396,7 @@ TEST_P(UnSupportedMemAdviceSystemAllocatorTests, givenValidSystemAlloctedPtrWhen
|
||||||
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||||
|
|
||||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
|
||||||
auto res = commandList->executeMemAdvise(device, ptr, size, GetParam());
|
auto res = commandList->executeMemAdvise(device, ptr, size, GetParam());
|
||||||
EXPECT_EQ(0u, memoryManager->setSharedSystemMemAdviseCalledCount);
|
EXPECT_EQ(0u, memoryManager->setSharedSystemMemAdviseCalledCount);
|
||||||
|
|
|
@ -490,7 +490,7 @@ HWTEST2_F(CommandListStatePrefetchXe2HpgCore, givenSharedSystemAllocationOnSuppo
|
||||||
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
|
|
||||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
|
||||||
size_t size = 10;
|
size_t size = 10;
|
||||||
void *ptr = malloc(size);
|
void *ptr = malloc(size);
|
||||||
|
@ -513,7 +513,7 @@ HWTEST2_F(CommandListStatePrefetchXe2HpgCore, givenSharedSystemAllocationOnSuppo
|
||||||
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
|
|
||||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
|
||||||
size_t size = 10;
|
size_t size = 10;
|
||||||
void *ptr = malloc(size);
|
void *ptr = malloc(size);
|
||||||
|
|
|
@ -128,7 +128,7 @@ HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenSharedSystemAllocationOnSuppor
|
||||||
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
|
|
||||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
|
||||||
size_t size = 10;
|
size_t size = 10;
|
||||||
void *ptr = malloc(size);
|
void *ptr = malloc(size);
|
||||||
|
@ -151,7 +151,7 @@ HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenSharedSystemAllocationOnSuppor
|
||||||
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
|
|
||||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
|
||||||
size_t size = 10;
|
size_t size = 10;
|
||||||
void *ptr = malloc(size);
|
void *ptr = malloc(size);
|
||||||
|
|
|
@ -310,7 +310,7 @@ TEST_F(clSetKernelArgSVMPointerTests, givenSvmAndValidArgValueWhenSettingSameKer
|
||||||
EXPECT_EQ(++callCounter, pMockKernel->setArgSvmAllocCalls);
|
EXPECT_EQ(++callCounter, pMockKernel->setArgSvmAllocCalls);
|
||||||
++mockSvmManager->allocationsCounter;
|
++mockSvmManager->allocationsCounter;
|
||||||
|
|
||||||
pDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
pDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
mockSvmManager->freeSVMAlloc(nextPtrSvm);
|
mockSvmManager->freeSVMAlloc(nextPtrSvm);
|
||||||
// same values but no svmData - called
|
// same values but no svmData - called
|
||||||
retVal = clSetKernelArgSVMPointer(
|
retVal = clSetKernelArgSVMPointer(
|
||||||
|
|
|
@ -858,7 +858,7 @@ TEST(clUnifiedSharedMemoryTests, whenClSetKernelArgMemPointerINTELisCalledWithIn
|
||||||
TEST(clUnifiedSharedMemoryTests, whenDeviceSupportSharedMemoryAllocationsAndSystemPointerIsPassedThenItIsProperlySetInKernel) {
|
TEST(clUnifiedSharedMemoryTests, whenDeviceSupportSharedMemoryAllocationsAndSystemPointerIsPassedThenItIsProperlySetInKernel) {
|
||||||
auto mockContext = std::make_unique<MockContext>();
|
auto mockContext = std::make_unique<MockContext>();
|
||||||
auto device = mockContext->getDevice(0u);
|
auto device = mockContext->getDevice(0u);
|
||||||
device->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
device->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
REQUIRE_SVM_OR_SKIP(device);
|
REQUIRE_SVM_OR_SKIP(device);
|
||||||
|
|
||||||
MockKernelWithInternals mockKernel(*device, mockContext.get(), true);
|
MockKernelWithInternals mockKernel(*device, mockContext.get(), true);
|
||||||
|
|
|
@ -1315,10 +1315,11 @@ TEST_F(DeviceGetCapsTest, givenUnifiedMemorySharedSystemFlagWhenDeviceIsCreatedT
|
||||||
|
|
||||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||||
device->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = 0;
|
device->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = 0;
|
||||||
|
EXPECT_EQ(0u, device->getDeviceInfo().sharedSystemMemCapabilities);
|
||||||
EXPECT_FALSE(device->areSharedSystemAllocationsAllowed());
|
EXPECT_FALSE(device->areSharedSystemAllocationsAllowed());
|
||||||
|
|
||||||
device.reset(new MockClDevice{MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get())});
|
device.reset(new MockClDevice{MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get())});
|
||||||
device->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
device->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
EXPECT_TRUE(device->areSharedSystemAllocationsAllowed());
|
EXPECT_TRUE(device->areSharedSystemAllocationsAllowed());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "shared/source/memory_manager/memory_manager.h"
|
#include "shared/source/memory_manager/memory_manager.h"
|
||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
|
||||||
#include "shared/test/common/mocks/mock_device.h"
|
#include "shared/test/common/mocks/mock_device.h"
|
||||||
|
|
||||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||||
|
@ -23,8 +22,6 @@ struct GetDeviceInfoMemCapabilitiesTest : ::testing::Test {
|
||||||
};
|
};
|
||||||
|
|
||||||
void check(std::vector<TestParams> ¶ms) {
|
void check(std::vector<TestParams> ¶ms) {
|
||||||
DebugManagerStateRestore restore;
|
|
||||||
debugManager.flags.EnableSharedSystemUsmSupport.set(0);
|
|
||||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||||
const bool isKmdMigrationAvailable{device->getMemoryManager()->isKmdMigrationAvailable(device->getRootDeviceIndex())};
|
const bool isKmdMigrationAvailable{device->getMemoryManager()->isKmdMigrationAvailable(device->getRootDeviceIndex())};
|
||||||
|
|
||||||
|
|
|
@ -727,8 +727,8 @@ bool Device::areSharedSystemAllocationsAllowed() const {
|
||||||
if ((debugManager.flags.EnableRecoverablePageFaults.get() == 0) || (debugManager.flags.EnableSharedSystemUsmSupport.get() == 0)) {
|
if ((debugManager.flags.EnableRecoverablePageFaults.get() == 0) || (debugManager.flags.EnableSharedSystemUsmSupport.get() == 0)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
uint64_t mask = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
uint64_t mask = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
if (getHardwareInfo().capabilityTable.sharedSystemMemCapabilities & mask) {
|
if (((getHardwareInfo().capabilityTable.sharedSystemMemCapabilities) & mask) == mask) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -63,6 +63,11 @@ Drm *Drm::create(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironm
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (drm->isSharedSystemAllocEnabled()) {
|
||||||
|
auto hwInfo = drm->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
|
hwInfo->capabilityTable.sharedSystemMemCapabilities |= UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
if (drm->enableTurboBoost()) {
|
if (drm->enableTurboBoost()) {
|
||||||
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to request OCL Turbo Boost\n");
|
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to request OCL Turbo Boost\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,7 +496,6 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl
|
||||||
|
|
||||||
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
|
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
|
||||||
device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper);
|
device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper);
|
||||||
this->adjustSharedSystemMemCapabilities();
|
|
||||||
|
|
||||||
querySystemInfo();
|
querySystemInfo();
|
||||||
|
|
||||||
|
@ -1862,12 +1861,6 @@ bool Drm::queryDeviceIdAndRevision() {
|
||||||
return IoctlHelperI915::queryDeviceIdAndRevision(*this);
|
return IoctlHelperI915::queryDeviceIdAndRevision(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Drm::adjustSharedSystemMemCapabilities() {
|
|
||||||
if (!this->isSharedSystemAllocEnabled()) {
|
|
||||||
this->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t Drm::getAggregatedProcessCount() const {
|
uint32_t Drm::getAggregatedProcessCount() const {
|
||||||
return ioctlHelper->getNumProcesses();
|
return ioctlHelper->getNumProcesses();
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,6 @@ class Drm : public DriverModel {
|
||||||
bool isDirectSubmissionActive() const { return this->directSubmissionActive; }
|
bool isDirectSubmissionActive() const { return this->directSubmissionActive; }
|
||||||
MOCKABLE_VIRTUAL void setSharedSystemAllocEnable(bool value) { this->sharedSystemAllocEnable = value; }
|
MOCKABLE_VIRTUAL void setSharedSystemAllocEnable(bool value) { this->sharedSystemAllocEnable = value; }
|
||||||
MOCKABLE_VIRTUAL bool isSharedSystemAllocEnabled() const { return this->sharedSystemAllocEnable; }
|
MOCKABLE_VIRTUAL bool isSharedSystemAllocEnabled() const { return this->sharedSystemAllocEnable; }
|
||||||
void adjustSharedSystemMemCapabilities();
|
|
||||||
|
|
||||||
MOCKABLE_VIRTUAL bool isSetPairAvailable();
|
MOCKABLE_VIRTUAL bool isSetPairAvailable();
|
||||||
MOCKABLE_VIRTUAL bool getSetPairAvailable() { return setPairAvailable; }
|
MOCKABLE_VIRTUAL bool getSetPairAvailable() { return setPairAvailable; }
|
||||||
|
|
|
@ -160,7 +160,7 @@ bool IoctlHelperXe::queryDeviceIdAndRevision(Drm &drm) {
|
||||||
hwInfo->platform.usDeviceID = config->info[DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID] & 0xffff;
|
hwInfo->platform.usDeviceID = config->info[DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID] & 0xffff;
|
||||||
hwInfo->platform.usRevId = static_cast<int>((config->info[DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID] >> 16) & 0xff);
|
hwInfo->platform.usRevId = static_cast<int>((config->info[DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID] >> 16) & 0xff);
|
||||||
|
|
||||||
if ((debugManager.flags.EnableRecoverablePageFaults.get() != 0) && (debugManager.flags.EnableSharedSystemUsmSupport.get() == 1) && (config->info[DRM_XE_QUERY_CONFIG_FLAGS] & DRM_XE_QUERY_CONFIG_FLAG_HAS_CPU_ADDR_MIRROR)) {
|
if ((debugManager.flags.EnableRecoverablePageFaults.get() != 0) && (debugManager.flags.EnableSharedSystemUsmSupport.get() != 0) && (config->info[DRM_XE_QUERY_CONFIG_FLAGS] & DRM_XE_QUERY_CONFIG_FLAG_HAS_CPU_ADDR_MIRROR)) {
|
||||||
drm.setSharedSystemAllocEnable(true);
|
drm.setSharedSystemAllocEnable(true);
|
||||||
drm.setPageFaultSupported(true);
|
drm.setPageFaultSupported(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,11 +180,13 @@ uint64_t ProductHelperHw<gfxProduct>::getHostMemCapabilities(const HardwareInfo
|
||||||
|
|
||||||
template <PRODUCT_FAMILY gfxProduct>
|
template <PRODUCT_FAMILY gfxProduct>
|
||||||
uint64_t ProductHelperHw<gfxProduct>::getSharedSystemMemCapabilities(const HardwareInfo *hwInfo) const {
|
uint64_t ProductHelperHw<gfxProduct>::getSharedSystemMemCapabilities(const HardwareInfo *hwInfo) const {
|
||||||
|
bool supported = false;
|
||||||
|
|
||||||
if ((debugManager.flags.EnableRecoverablePageFaults.get() == 0) || (debugManager.flags.EnableSharedSystemUsmSupport.get() == 0)) {
|
if (debugManager.flags.EnableSharedSystemUsmSupport.get() != -1) {
|
||||||
return 0;
|
supported = !!debugManager.flags.EnableSharedSystemUsmSupport.get();
|
||||||
}
|
}
|
||||||
return (hwInfo->capabilityTable.sharedSystemMemCapabilities);
|
|
||||||
|
return (supported ? (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <PRODUCT_FAMILY gfxProduct>
|
template <PRODUCT_FAMILY gfxProduct>
|
||||||
|
|
|
@ -15,4 +15,5 @@ inline constexpr uint64_t access = 1 << 0;
|
||||||
inline constexpr uint64_t atomicAccess = 1 << 1;
|
inline constexpr uint64_t atomicAccess = 1 << 1;
|
||||||
inline constexpr uint64_t concurrentAccess = 1 << 2;
|
inline constexpr uint64_t concurrentAccess = 1 << 2;
|
||||||
inline constexpr uint64_t concurrentAtomicAccess = 1 << 3;
|
inline constexpr uint64_t concurrentAtomicAccess = 1 << 3;
|
||||||
|
inline constexpr uint64_t sharedSystemPageFaultEnabled = 1 << 4;
|
||||||
} // namespace UnifiedSharedMemoryFlags
|
} // namespace UnifiedSharedMemoryFlags
|
||||||
|
|
|
@ -37,7 +37,7 @@ TEST(PrefetchManagerTests, givenPrefetchManagerWhenCallingInterfaceFunctionsThen
|
||||||
auto &hwInfo = *device->getRootDeviceEnvironment().getMutableHardwareInfo();
|
auto &hwInfo = *device->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
|
|
||||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
|
||||||
auto svmData = svmManager->getSVMAlloc(ptr);
|
auto svmData = svmManager->getSVMAlloc(ptr);
|
||||||
ASSERT_NE(nullptr, svmData);
|
ASSERT_NE(nullptr, svmData);
|
||||||
|
|
|
@ -336,7 +336,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenSharedSystemAllocationWhenPrefetchMemor
|
||||||
auto &hwInfo = *device->getRootDeviceEnvironment().getMutableHardwareInfo();
|
auto &hwInfo = *device->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||||
|
|
||||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||||
|
|
||||||
csr->setupContext(*device->getDefaultEngine().osContext);
|
csr->setupContext(*device->getDefaultEngine().osContext);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include "shared/source/os_interface/linux/memory_info.h"
|
#include "shared/source/os_interface/linux/memory_info.h"
|
||||||
#include "shared/source/os_interface/linux/os_context_linux.h"
|
#include "shared/source/os_interface/linux/os_context_linux.h"
|
||||||
#include "shared/source/os_interface/product_helper.h"
|
#include "shared/source/os_interface/product_helper.h"
|
||||||
#include "shared/source/unified_memory/usm_memory_support.h"
|
|
||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||||
#include "shared/test/common/mocks/linux/mock_drm_memory_manager.h"
|
#include "shared/test/common/mocks/linux/mock_drm_memory_manager.h"
|
||||||
|
@ -2784,7 +2783,6 @@ TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionConfigFlagHasGpuAddrMirror
|
||||||
MockExecutionEnvironment executionEnvironment{};
|
MockExecutionEnvironment executionEnvironment{};
|
||||||
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
|
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
|
||||||
DebugManagerStateRestore restore;
|
DebugManagerStateRestore restore;
|
||||||
debugManager.flags.EnableSharedSystemUsmSupport.set(1);
|
|
||||||
mockIoctl = [](int fileDescriptor, unsigned long int request, void *arg) -> int {
|
mockIoctl = [](int fileDescriptor, unsigned long int request, void *arg) -> int {
|
||||||
if (request == DRM_IOCTL_XE_DEVICE_QUERY) {
|
if (request == DRM_IOCTL_XE_DEVICE_QUERY) {
|
||||||
struct drm_xe_device_query *deviceQuery = static_cast<struct drm_xe_device_query *>(arg);
|
struct drm_xe_device_query *deviceQuery = static_cast<struct drm_xe_device_query *>(arg);
|
||||||
|
@ -2804,10 +2802,6 @@ TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionConfigFlagHasGpuAddrMirror
|
||||||
|
|
||||||
EXPECT_TRUE(IoctlHelperXe::queryDeviceIdAndRevision(*drm));
|
EXPECT_TRUE(IoctlHelperXe::queryDeviceIdAndRevision(*drm));
|
||||||
EXPECT_TRUE(drm->isSharedSystemAllocEnabled());
|
EXPECT_TRUE(drm->isSharedSystemAllocEnabled());
|
||||||
uint64_t caps = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
|
||||||
drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = caps;
|
|
||||||
drm->adjustSharedSystemMemCapabilities();
|
|
||||||
EXPECT_EQ(caps, drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
|
|
||||||
EXPECT_TRUE(drm->hasPageFaultSupport());
|
EXPECT_TRUE(drm->hasPageFaultSupport());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2834,10 +2828,6 @@ TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionAndConfigFlagHasGpuAddrMir
|
||||||
|
|
||||||
EXPECT_TRUE(IoctlHelperXe::queryDeviceIdAndRevision(*drm));
|
EXPECT_TRUE(IoctlHelperXe::queryDeviceIdAndRevision(*drm));
|
||||||
EXPECT_FALSE(drm->isSharedSystemAllocEnabled());
|
EXPECT_FALSE(drm->isSharedSystemAllocEnabled());
|
||||||
uint64_t caps = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
|
||||||
drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = caps;
|
|
||||||
drm->adjustSharedSystemMemCapabilities();
|
|
||||||
EXPECT_EQ(0lu, drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionAndSharedSystemUsmSupportDebugFlagClearThenSharedSystemAllocEnableFalse) {
|
TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionAndSharedSystemUsmSupportDebugFlagClearThenSharedSystemAllocEnableFalse) {
|
||||||
|
@ -2864,10 +2854,6 @@ TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionAndSharedSystemUsmSupportD
|
||||||
|
|
||||||
EXPECT_TRUE(IoctlHelperXe::queryDeviceIdAndRevision(*drm));
|
EXPECT_TRUE(IoctlHelperXe::queryDeviceIdAndRevision(*drm));
|
||||||
EXPECT_FALSE(drm->isSharedSystemAllocEnabled());
|
EXPECT_FALSE(drm->isSharedSystemAllocEnabled());
|
||||||
uint64_t caps = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
|
||||||
drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = caps;
|
|
||||||
drm->adjustSharedSystemMemCapabilities();
|
|
||||||
EXPECT_EQ(0lu, drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
|
|
||||||
EXPECT_FALSE(drm->hasPageFaultSupport());
|
EXPECT_FALSE(drm->hasPageFaultSupport());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,27 +71,18 @@ HWTEST_F(ProductHelperTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThen
|
||||||
HWTEST_F(ProductHelperTest, givenProductHelperWhenGettingSharedSystemMemCapabilitiesThenCorrectValueIsReturned) {
|
HWTEST_F(ProductHelperTest, givenProductHelperWhenGettingSharedSystemMemCapabilitiesThenCorrectValueIsReturned) {
|
||||||
DebugManagerStateRestore restore;
|
DebugManagerStateRestore restore;
|
||||||
|
|
||||||
uint64_t caps = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
EXPECT_EQ(0u, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
||||||
pInHwInfo.capabilityTable.sharedSystemMemCapabilities = caps;
|
|
||||||
EXPECT_EQ(caps, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
|
||||||
|
|
||||||
for (auto enable : {-1, 0, 1}) {
|
for (auto enable : {-1, 0, 1}) {
|
||||||
debugManager.flags.EnableSharedSystemUsmSupport.set(enable);
|
debugManager.flags.EnableSharedSystemUsmSupport.set(enable);
|
||||||
if (enable != 0) {
|
|
||||||
|
if (enable > 0) {
|
||||||
|
auto caps = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess;
|
||||||
EXPECT_EQ(caps, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
EXPECT_EQ(caps, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
||||||
} else {
|
} else {
|
||||||
EXPECT_EQ(0u, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
EXPECT_EQ(0u, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (auto enable : {-1, 0, 1}) {
|
|
||||||
debugManager.flags.EnableRecoverablePageFaults.set(enable);
|
|
||||||
if (enable != 0) {
|
|
||||||
EXPECT_EQ(caps, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
|
||||||
} else {
|
|
||||||
EXPECT_EQ(0u, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pInHwInfo.capabilityTable.sharedSystemMemCapabilities = caps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfIsBlitSplitEnqueueWARequiredThenReturnFalse) {
|
HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfIsBlitSplitEnqueueWARequiredThenReturnFalse) {
|
||||||
|
@ -104,7 +95,7 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenGettingMemoryCapabilitiesThenC
|
||||||
|
|
||||||
for (auto capabilityBitmask : {0, 0b0001, 0b0010, 0b0100, 0b1000, 0b1111}) {
|
for (auto capabilityBitmask : {0, 0b0001, 0b0010, 0b0100, 0b1000, 0b1111}) {
|
||||||
debugManager.flags.EnableUsmConcurrentAccessSupport.set(capabilityBitmask);
|
debugManager.flags.EnableUsmConcurrentAccessSupport.set(capabilityBitmask);
|
||||||
std::bitset<5> capabilityBitset(capabilityBitmask);
|
std::bitset<4> capabilityBitset(capabilityBitmask);
|
||||||
|
|
||||||
auto hostMemCapabilities = productHelper->getHostMemCapabilities(&pInHwInfo);
|
auto hostMemCapabilities = productHelper->getHostMemCapabilities(&pInHwInfo);
|
||||||
if (hostMemCapabilities > 0) {
|
if (hostMemCapabilities > 0) {
|
||||||
|
|
Loading…
Reference in New Issue