From 557f888e1ce2a0972b42be5cd341ba03bd87fc31 Mon Sep 17 00:00:00 2001 From: tiancyin Date: Fri, 27 Jun 2025 16:47:51 +0800 Subject: [PATCH] wsl/libhsakmt: move system heap from device to thunk runtime In multi-GPU, system 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 system heap for all GPUs. Introduce a new va_Mgr instance to manage system heap, since local heap and system heap both comply with SVM(Shared Virtual Memory), without this new mgr, every allocation has to call KMD at least once (each GPU needs a call) to allocate GPU VA, the new mgr manage the space itself, no longer call KMD. Reviewed-by: Flora Cui Signed-off-by: tiancyin --- wddm/device.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/wddm/device.h b/wddm/device.h index 1d7b3d1cb2..40e2632ec1 100644 --- a/wddm/device.h +++ b/wddm/device.h @@ -111,7 +111,6 @@ public: uint64_t PrivateApertureSize() { return device_info_.private_aperture_size; } uint64_t SharedApertureBase() { return device_info_.shared_aperture_base; } uint64_t SharedApertureSize() { return device_info_.shared_aperture_size; } - uint64_t SystemHeapSize() { return system_heap_space_size_; } uint32_t LdsSize() { return device_info_.lds_size; } uint64_t GPUCounterFrequency() { return device_info_.gpu_counter_frequency; } uint32_t GetSwsQueueSize(void) const { return device_info_.user_queue_size; } @@ -224,8 +223,6 @@ private: void SetPowerOptimization(bool restore); void InitCmdbufInfo(void); - bool ReserveSystemHeapSpace(void); - bool FreeSystemHeapSpace(void); bool InitHandleApertureSpace(void); bool CommitSystemHeapSpace(void* addr, int64_t size, bool lock=false); bool DecommitSystemHeapSpace(void* addr, int64_t size); @@ -244,8 +241,6 @@ private: uint64_t handle_aperture_start_; uint64_t handle_aperture_size_; - uint64_t system_heap_space_start_; - uint64_t system_heap_space_size_; uint32_t cmdbuf_size_; uint32_t cmdbuf_aql_frame_size_; static const uint32_t cmdbuf_aql_frame_num_;