feature: System Allocator support for Level Zero#782
feature: System Allocator support for Level Zero#782johntfalk wants to merge 2 commits intointel:masterfrom
Conversation
Related-To: NEO-12988 Signed-off-by: John Falkowski [email protected]
| auto alloc = allocData->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex()); | ||
| commandContainer.addToResidencyContainer(alloc); | ||
|
|
||
| if (allocData) { |
There was a problem hiding this comment.
this should only be allowed if system shared USM is enabled
| return pageFaultSupported; | ||
| } | ||
|
|
||
| void Drm::checkSystemAllocEnabled() { |
There was a problem hiding this comment.
please change the name to clearly indicate that this is for Shared System USM
| DECLARE_DEBUG_VARIABLE(int32_t, ForceExtendedKernelIsaSize, -1, "-1: default, 0: disabled, >=1: Forces extended kernel isa size by specified pageSize number") | ||
| DECLARE_DEBUG_VARIABLE(int32_t, ForceSimdMessageSizeInWalker, -1, "-1: default, >=0 Program given value in Walker command for SIMD size") | ||
| DECLARE_DEBUG_VARIABLE(int32_t, EnableRecoverablePageFaults, -1, "-1: default - ignore, 0: disable, 1: enable recoverable page faults on all VMs (on faultable hardware)") | ||
| DECLARE_DEBUG_VARIABLE(int32_t, EnableSystemAllocator, -1, "-1: default - ignore, 0: disable, 1: enable use of system-allocated memory for GPU access") |
There was a problem hiding this comment.
please make sure that System Shared USM terminology is used
| return ZE_RESULT_ERROR_INVALID_ARGUMENT; | ||
| DeviceImp *deviceImp = static_cast<DeviceImp *>(device); | ||
| if (!deviceImp->isSystemAllocEnabled()) { | ||
| NEO::SvmAllocationData *allocData = nullptr; |
There was a problem hiding this comment.
why this code is skipped for Shared System USM ?
| vmBind.vmId = static_cast<uint32_t>(ctl.vmId); | ||
| vmBind.flags = DRM_XE_VM_BIND_FLAG_SYSTEM_ALLOCATOR; | ||
| vmBind.handle = 0; | ||
| vmBind.length = (0x1ull << 48); |
There was a problem hiding this comment.
this should be dependant on CPU VA range
| int index = invalidIndex; | ||
|
|
||
| if (this->drm.isVmBindSystemAlloc()) { | ||
| drm_xe_vm_bind bind = {}; |
There was a problem hiding this comment.
why this path is taken for all vm_binds?
this overwrites other ioctl calls, please unify the logic so we have a single ioctl calling point
| void setDirectSubmissionActive(bool value) { this->directSubmissionActive = value; } | ||
| bool isDirectSubmissionActive() const { return this->directSubmissionActive; } | ||
|
|
||
| void setVmBindSystemAlloc(bool value) { this->vmBindSystemAlloc = value; } |
There was a problem hiding this comment.
please remove, this needs to be passed via arguments and not by modyfing global drm state.
| bool isDirectSubmissionActive() const { return this->directSubmissionActive; } | ||
|
|
||
| void setVmBindSystemAlloc(bool value) { this->vmBindSystemAlloc = value; } | ||
| bool isVmBindSystemAlloc() const { return this->vmBindSystemAlloc; } |
There was a problem hiding this comment.
please remove and pass via arguments
| bind.bind.op = DRM_XE_VM_BIND_OP_UNMAP; | ||
| } | ||
| bind.bind.obj = 0; | ||
| //if (bindInfo[index].userptr) { |
There was a problem hiding this comment.
please remove commented code
Related-To: NEO-12988 Signed-off-by: John Falkowski [email protected] Signed-off-by: Falkowski, John <[email protected]>
Related-To: NEO-12988
Signed-off-by: John Falkowski [email protected]