From 602ed1aff84280353a48cb0017224c304d287223 Mon Sep 17 00:00:00 2001 From: tiancyin Date: Fri, 27 Jun 2025 09:08:19 +0800 Subject: [PATCH] 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 Signed-off-by: tiancyin --- wddm/device.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/wddm/device.h b/wddm/device.h index 1d78acf925..1d7b3d1cb2 100644 --- a/wddm/device.h +++ b/wddm/device.h @@ -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 local_va_mgr_; std::unique_ptr handle_aperture_mgr_; //CmdUtil cmd_util; };