SWDEV-344210 - Fixed page fault when mempool accessed from remote device

Change-Id: Ie41b0c0499f7733d4541ccd50b3d0d976c6431c9
This commit is contained in:
Sarbojit Sarkar authored and Sarbojit Sarkar committed 2022-08-09 23:26:27 -04:00
1 parent 1afcf53133
commit a28b22d9b4
6 files changed
+50 -7

No files matched your search

+16
View File
@@ -2045,6 +2045,22 @@ bool Device::deviceAllowAccess(void* ptr) const {
return true;
}
bool Device::allowPeerAccess(device::Memory* memory) const {
if (memory == nullptr) {
return false;
}
if (!p2pAgents().empty()) {
void* ptr = reinterpret_cast<void*>(memory->virtualAddress());
hsa_agent_t agent = getBackendDevice();
hsa_status_t stat = hsa_amd_agents_allow_access(1, &agent, nullptr, ptr);
if (stat != HSA_STATUS_SUCCESS) {
LogError("Allow p2p access failed");
return false;
}
}
return true;
}
void* Device::deviceLocalAlloc(size_t size, bool atomics) const {
const hsa_amd_memory_pool_t& pool = (atomics)? gpu_fine_grained_segment_ : gpuvm_segment_;