feature: Add CPU side USM allocation to trim candidate list on page fault

Enable eviction of CPU side USM allocation for UMD migrations on Windows.
Reverts incorrect auto-revert commit 218de586a4f28b1de3e983b9006e7a99d3a4d10e.

Related-To: NEO-8015

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2023-07-25 09:01:53 +00:00
committed by Compute-Runtime-Automation
parent 6656e23b86
commit 027c51d396
13 changed files with 152 additions and 1 deletions

View File

@@ -6,6 +6,8 @@
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/page_fault_manager/cpu_page_fault_manager.h"
#include "level_zero/core/source/cmdlist/cmdlist.h"
@@ -40,6 +42,20 @@ void PageFaultManager::transferToGpu(void *ptr, void *device) {
this->evictMemoryAfterImplCopy(allocData->cpuAllocation, deviceImp->getNEODevice());
}
void PageFaultManager::allowCPUMemoryEviction(void *ptr, PageFaultData &pageFaultData) {
L0::DeviceImp *deviceImp = static_cast<L0::DeviceImp *>(pageFaultData.cmdQ);
CommandStreamReceiver *csr = nullptr;
if (deviceImp->getActiveDevice()->getInternalCopyEngine()) {
csr = deviceImp->getActiveDevice()->getInternalCopyEngine()->commandStreamReceiver;
} else {
csr = deviceImp->getActiveDevice()->getInternalEngine().commandStreamReceiver;
}
UNRECOVERABLE_IF(csr == nullptr);
auto osInterface = deviceImp->getNEODevice()->getRootDeviceEnvironment().osInterface.get();
allowCPUMemoryEvictionImpl(ptr, *csr, osInterface);
}
} // namespace NEO
namespace L0 {