wsl/libhsakmt: move local heap and va_Mgr from device to thunk runtime

In multi-GPU, local heap space 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 local heap for all GPUs.

Reviewed-by: Flora Cui <flora.cui@amd.com>
Signed-off-by: tiancyin <tianci.yin@amd.com>
This commit is contained in:
tiancyin
2025-06-27 09:08:19 +08:00
کامیت شده توسط Frank Min
والد a53f1a7c1e
کامیت 602ed1aff8
+1 -6
مشاهده پرونده
@@ -183,6 +183,7 @@ public:
D3DKMT_HANDLE PagingFence() const { return page_syncobj_; }
D3DKMT_HANDLE DeviceHandle() const { return device_; }
LUID GetLuid() const { return adapter_luid_; }
D3DKMT_HANDLE GetAdapter() const { return adapter_; }
const thunk_proxy::DeviceInfo& DeviceInfo() const { return device_info_; }
@@ -225,14 +226,11 @@ private:
void InitCmdbufInfo(void);
bool ReserveSystemHeapSpace(void);
bool FreeSystemHeapSpace(void);
bool ReserveLocalHeapSpace(void);
bool InitHandleApertureSpace(void);
bool CommitSystemHeapSpace(void* addr, int64_t size, bool lock=false);
bool DecommitSystemHeapSpace(void* addr, int64_t size);
bool CommitSystemHeapSpaceIPC(void* addr, int64_t size, int &fd, bool lock=false);
bool DecommitSystemHeapSpaceIPC(void* addr, int64_t size, int &memfd);
bool FreeLocalHeapSpace(void);
void InitVaMgr();
void InitHandleApertureMgr();
D3DKMT_HANDLE adapter_;
@@ -246,8 +244,6 @@ private:
uint64_t handle_aperture_start_;
uint64_t handle_aperture_size_;
uint64_t local_heap_space_start_;
uint64_t local_heap_space_size_;
uint64_t system_heap_space_start_;
uint64_t system_heap_space_size_;
uint32_t cmdbuf_size_;
@@ -257,7 +253,6 @@ private:
// device info
thunk_proxy::DeviceInfo device_info_;
std::unique_ptr<VaMgr> local_va_mgr_;
std::unique_ptr<VaMgr> handle_aperture_mgr_;
//CmdUtil cmd_util;
};