mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 12:42:54 +08:00
Fix P2P support for implicit scaling
when using implicit scaling, 2 dma-buf handles, one per tile, are needed to support dma access from peer. Related-To: LOCI-3122 Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
09c68a6bb1
commit
325db6a99c
@@ -554,10 +554,22 @@ NEO::GraphicsAllocation *DriverHandleImp::getPeerAllocation(Device *device,
|
||||
} else {
|
||||
alloc = allocData->gpuAllocations.getDefaultGraphicsAllocation();
|
||||
UNRECOVERABLE_IF(alloc == nullptr);
|
||||
uint64_t handle = alloc->peekInternalHandle(this->getMemoryManager());
|
||||
ze_ipc_memory_flags_t flags = {};
|
||||
|
||||
peerPtr = this->importFdHandle(device, flags, handle, &alloc);
|
||||
if (!deviceImp->isSubdevice && deviceImp->isImplicitScalingCapable()) {
|
||||
uint32_t numHandles = alloc->getNumHandles();
|
||||
UNRECOVERABLE_IF(numHandles == 0);
|
||||
std::vector<NEO::osHandle> handles;
|
||||
for (uint32_t i = 0; i < numHandles; i++) {
|
||||
int handle = static_cast<int>(alloc->peekInternalHandle(this->getMemoryManager(), i));
|
||||
handles.push_back(handle);
|
||||
}
|
||||
peerPtr = this->importFdHandles(device, flags, handles, &alloc);
|
||||
} else {
|
||||
uint64_t handle = alloc->peekInternalHandle(this->getMemoryManager());
|
||||
peerPtr = this->importFdHandle(device, flags, handle, &alloc);
|
||||
}
|
||||
|
||||
if (peerPtr == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user