wsl/libhsakmt: move handle aperture from device to thunk runtime
In multi-GPU, handle aperture is shared between all GPUs, not belongs to specific one GPU, so move it from wddm device (which presents a specific GPU) to thunk runtime which has gloable view, can manage handle aperture for all GPUs. Reviewed-by: Flora Cui <flora.cui@amd.com> Signed-off-by: tiancyin <tianci.yin@amd.com>
This commit is contained in:
+3
-3
@@ -49,7 +49,7 @@ GpuMemory::~GpuMemory() {
|
||||
FreeGpuVirtualAddress(GpuAddress(), Size());
|
||||
FreePhysicalMemory();
|
||||
if (desc_.handle_ape_addr > 0)
|
||||
device_->HandleApertureFree(desc_.handle_ape_addr);
|
||||
dxg_runtime->HandleApertureFree(desc_.handle_ape_addr);
|
||||
}
|
||||
|
||||
ErrorCode GpuMemory::Init(const GpuMemoryCreateInfo &create_info) {
|
||||
@@ -92,7 +92,7 @@ ErrorCode GpuMemory::Init(const GpuMemoryCreateInfo &create_info) {
|
||||
if (IsPhysicalOnly()) {
|
||||
code = CreatePhysicalMemory();
|
||||
if (code == ErrorCode::Success)
|
||||
code = device_->HandleApertureAlloc(desc_.size, &desc_.handle_ape_addr);
|
||||
code = dxg_runtime->HandleApertureAlloc(desc_.size, &desc_.handle_ape_addr);
|
||||
return code;
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ ErrorCode GpuMemory::ImportPhysicalHandle(const GpuMemoryCreateInfo &create_info
|
||||
return ret;
|
||||
} else {
|
||||
desc_.flags.is_imported_vram_vmem = 1;
|
||||
return device_->HandleApertureAlloc(desc_.size, &desc_.handle_ape_addr);
|
||||
return dxg_runtime->HandleApertureAlloc(desc_.size, &desc_.handle_ape_addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user