Calculate the actual scratch memory size required based on the
packet information for kernel dispatch.
If the required size exceeds the total allocated memory, scratch
memory must be reallocated. Otherwise, no action is needed.
miopen_gtest: Full/GPU_MIOpenDriverRegressionTest_FP16.MIOpenDriverRegressionHalf/0
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com>
Reviewed-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Horatio Zhang <Hongkun.Zhang@amd.com>
Debug shows parameter count no impact on call relations, so revert this commit.
This reverts commit 5f710768aa2e68c5b06d0ece19f4268cc66f88d4.
Signed-off-by: Yang Su <Yang.Su2@amd.com>
Reviewed-by: Flora Cui <flora.cui@amd.com>
The use of std::call_once caused the initialization flag to be set permanently,
preventing proper re-attempts to load libdxcore.so when needed. This change removes
the once_flag mechanism and relies solely on dxcore_handle_ checks to manage library
loading, allowing proper re-initialization attempts.
Signed-off-by: yangsu13 <Yang.Su2@amd.com>
Reviewed-by: Flora Cui <flora.cui@amd.com>
Replace direct D3DKMT API calls with DXCORE_CALL macro in WDDM
thunk layer. This enables dynamic loading of DXCore functions
while maintaining the same API interface.
Updated thunk functions:
- MapGpuVirtualAddress, CreateAllocation, DestroyAllocation
- ReserveGpuVirtualAddress, FreeGpuVirtualAddress
- MakeResident, Evict, ShareObjects
- QueryResourceInfoFromNtHandle, OpenResourceFromNtHandle
All existing functionality is preserved while adding flexibility
for runtime DXCore availability detection.
Signed-off-by: Chengjun Yao <Chengjun.Yao@amd.com>
Signed-off-by: Yang Su <Yang.Su2@amd.com>
Reviewed-by: Shi.Leslie <Yuliang.Shi@amd.com>
Remove static linking to libdxcore library from CMakeLists.txt.
This prepares for dynamic loading implementation and eliminates
hard dependency on DXCore being present at build time.
The DXCore functionality will be loaded dynamically at runtime
in subsequent patches, making the library more flexible for
different deployment scenarios.
Signed-off-by: Chengjun Yao <Chengjun.Yao@amd.com>
Signed-off-by: Yang Su <Yang.Su2@amd.com>
Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Shi.Leslie <Yuliang.Shi@amd.com>
For multi-GPU supporting, local heap and system heap managers are
implemented in thunk runtime, so the heap allocation function
ReserveGpuVirtualAddress should be moved to runtime too.
Reviewed-by: Flora Cui <flora.cui@amd.com>
Signed-off-by: tiancyin <tianci.yin@amd.com>
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>
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 <flora.cui@amd.com>
Signed-off-by: tiancyin <tianci.yin@amd.com>
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>