Flora Cui
0761dd0146
librocdxg: Increase AQL frame size calculation
...
to prevent PM4 command buffer overflow
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/113 >
2025-11-28 14:53:07 +08:00
Chengjun Yao
15ff43c4ce
librocdxg: Integrate DXCore loader into WDDM thunks
...
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 >
2025-11-05 18:53:37 +08:00
Flora Cui
3149006d29
librocdxg: update rocr queue type to amd_queue_v2_t
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
2025-11-05 18:53:37 +08:00
Flora Cui
45cc96aeb8
librocdxg: include rocr headers
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
2025-11-05 18:53:37 +08:00
Flora Cui
c5d7d487dc
wsl/libhsakmt: adapt to the new check for kernel object
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/99 >
2025-11-05 18:53:37 +08:00
Flora Cui
72cbeeff6d
wsl/libhsakmt: refactor handling of kmd priv data
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/98 >
2025-11-05 18:53:37 +08:00
Flora Cui
c3f022822b
wsl/libhsakmt: add !atomic handling for vender specific packet
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >q
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/97 >
2025-11-05 18:53:37 +08:00
Flora Cui
d520b11006
wsl/libhsakmt: refactor WDDMDevice creation
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Tianci Yin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/95 >
2025-11-05 18:53:37 +08:00
Flora Cui
e0f40ae8d4
wsl/libhsakmt: refactor check for supported device
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Tianci Yin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/95 >
2025-11-05 18:53:37 +08:00
Flora Cui
b39d8a7487
wsl/libhsakmt: remove redundant #include "libhsakmt.h"
...
move libhsakmt.h inclusion to he makefile
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Tianci Yin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/95 >
2025-11-05 18:53:37 +08:00
Chengjun Yao
c16ea5e561
wsl/libhskmt: Remove scratch_backing_memory_byte_size
...
Signed-off-by: Chengjun Yao <Chengjun.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/93 >
2025-11-05 18:53:37 +08:00
tiancyin
ccc3849de8
wsl/libhsakmt: move IPC functions from device to thunk runtime
...
IPC use system memory, it has nothing to do with wddm device.
Reviewed-by: Flora Cui <flora.cui@amd.com >
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:37 +08:00
tiancyin
8c6a4d59d4
wsl/libhsakmt: move ReserveGpuVirtualAddress from device to thunk runtime
...
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 >
2025-11-05 18:53:37 +08:00
tiancyin
f8d1663b39
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 >
2025-11-05 18:53:36 +08:00
tiancyin
8e07aca2ae
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 <flora.cui@amd.com >
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:36 +08:00
tiancyin
d5eb871bbb
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 >
2025-11-05 18:53:36 +08:00
Flora Cui
8b6d919b4b
wsl/libhsakmt: add same process check for ipc buffer
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Tianci Yin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/85 >
2025-11-05 18:53:36 +08:00
Flora Cui
237377aa02
wsl/libhsakmt: refactor ipc implementation
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Tianci Yin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/85 >
2025-11-05 18:53:36 +08:00
Flora Cui
b3c685585e
wsl/libhsakmt: add .NodeId() in WDDMDevice
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Tianci Yin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/82 >
2025-11-05 18:53:36 +08:00
Longlong Yao
7855113a9f
wsl/libhsakmt: reimplement GetClockCounters
...
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/80 >
2025-11-05 18:53:36 +08:00
tiancyin
c6627102d3
libhsakmt: fix resource count in memory export
...
D3DKMTShareObjects() need resource count paramenter not the allocations count.
There is only one resource no matter how many allocations for a buffer.
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:36 +08:00
Flora Cui
aff8e508df
wsl/libhsakmt: move PAGE_SIZE/SHIFT to static global var
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Tianci Yin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/68 >
2025-11-05 18:53:36 +08:00
Flora Cui
e98a872650
wsl/libhsakmt/openclose: Dynamically allocate static global memory
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Tianci Yin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/68 >
2025-11-05 18:53:36 +08:00
tiancyin
a343839e3c
libhsakmt: work around VaMgr free_list_ size is not 1
...
In some cases, the upper modules of rocr-runtime did not free all of the
memories at the end of the application's life time, it causes below
error logs:
pid:13066 tid:0x7f08718c4080 [~VaMgr] free_list_ size is not 1.
pid:13066 tid:0x7f08718c4080 [~VaMgr] frag_map_ size is not 1.
Change the log level from debug to info to work around this problem.
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:36 +08:00
Longlong Yao
b016d1e09c
libhsakmt: filter AMD asics before QueryAdapterInfo
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com >
Reviewed-by: lyndonli <Lyndon.Li@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/45 >
2025-11-05 18:53:36 +08:00
tiancyin
f4390637fb
wsl/hsakmt: implement ipc signal
...
IPC Signal only support sys ram backend and CPU&GPU both accessible,
IPC Memory only support vram backend and only GPU accessible.
Reviewed-by: Flora Cui <flora.cui@amd.com >
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:35 +08:00
tiancyin
390708c594
wsl/hsakmt: implement ipc mem of rocr non-legacy mode
...
The legacy mode means buffer sharing through KFD, KFD provide a buffer
id to exporter, exporter pass it to importer, importer pass buffer id
to KFD to query and import this buffer.
The non-legcay mode relys on socket to pass dmabuf fd between processes.
In hsa-runtime, the legcay mode is the default mode, setting environment
variable HSA_ENABLE_IPC_MODE_LEGACY to 0 can force hsa-runtime to new
mode code path.
Reviewed-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:35 +08:00
tiancyin
c83aca9878
wsl/hsakmt: fix a typo in FreeSystemHeapSpace
...
Reviewed-by: Flora Cui <flora.cui@amd.com >
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:35 +08:00
Flora Cui
7734c0baad
wsl/hsakmt: move src/inc to include/impl
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Horatio Zhang <Hongkun.Zhang@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/15 >
2025-11-05 18:53:35 +08:00
Horatio Zhang
ce64cf0314
wsl/hsakmt: Fix conversion warnings by using 0 for Non-Pointers
...
This patch addresses several compiler warnings related to the use of
NULL with non-pointer types, such as D3DKMT_HANDLE, uint64_t, and uint32_t.
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com >
Reviewed-by: tiancyin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/16 >
2025-11-05 18:53:35 +08:00
tiancyin
0fae2bb262
wsl/hsakmt: add supporting contiguous memory allocation
...
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:35 +08:00
Flora Cui
0e6b5e4f9e
wsl/hsakmt: fix missing []
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: lyndonli <Lyndon.Li@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/5 >
2025-11-05 18:53:35 +08:00
Longlong Yao
670178cc5f
wsl/hsakmt: fix missing the notify_one
...
Reviewed-by: Flora Cui <flora.cui@amd.com >
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/4 >
2025-11-05 18:53:35 +08:00
tiancyin
15a1702636
wsl/hsakmt: add handle aperture
...
The CLR use memory handle as svm ptr, this cause
problem in BLAS test, add handle aperture to align with native.
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Reviewed-by: Shane Xiao <shane.xiao@amd.com >
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:35 +08:00
Horatio Zhang
1f4fdb6d1c
wsl/hsakmt: Standardize error logging with pr_err
...
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Shane Xiao <shane.xiao@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/40 >
2025-11-05 18:53:35 +08:00
Horatio Zhang
c52d47b644
wsl/hsakmt: Standardize debug logging with pr_debug
...
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Shane Xiao <shane.xiao@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/40 >
2025-11-05 18:53:35 +08:00
Horatio Zhang
263623c198
wsl/hsakmt: Fix the warning about debug print
...
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com >
Reviewed-by: Shane Xiao <shane.xiao@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/33 >
2025-11-05 18:53:35 +08:00
Flora Cui
954807feff
wsl/hsakmt: rename vendor_packet_support
...
to vendor_packet_process.
:1 process vender specific packet (acquire_mem, handle signal, update
rptr)
:0 skip vender specific packet (handle signal by cpu, update rptr by
gpu)
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/35 >
2025-11-05 18:53:35 +08:00
Flora Cui
7a67eb90e2
wsl/hsakmt: add lock for sdma packet processing
...
Suggested-by: Shane Xiao <shane.xiao@amd.com >
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Shane Xiao <shane.xiao@amd.com >
Reviewed-by: Shi.Leslie <Yuliang.Shi@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/31 >
2025-11-05 18:53:35 +08:00
Flora Cui
55fc454b9d
wsl/hsakmt: move amd_queue_rocr_ above aql_to_pm4_thread_
...
to avoid segfault
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/28 >
2025-11-05 18:53:35 +08:00
Longlong Yao
84bfbf8e52
wsl/hsakmt: skip vender specific packet by default
...
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: lyndonli <Lyndon.Li@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/25 >
2025-11-05 18:53:35 +08:00
Horatio Zhang
9587e8b33d
wsl/hsakmt: Remove redundant variable for AqlToPm4Thread
...
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com >
Reviewed-by: lyndonli <Lyndon.Li@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/24 >
2025-11-05 18:53:35 +08:00
Shane Xiao
8c7d5a01f9
wsl/hsakmt: Add no pcie atomic support for dispatch packet
...
This patch adds no pcie atomic support. This patch uses cpu to update
cmd queue completion signal to resolve potential contention issue,
and replaces ATOMIC_MEM with WRITE_DATA packet to update ring_index.
Signed-off-by: Shane Xiao <shane.xiao@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/22 >
2025-11-05 18:53:35 +08:00
Shane Xiao
23243ba966
wsl/hsakmt: Add pm4 WRITE_DATA packet
...
This patch adds WRITE_DATA packet, which will be used
in no PCIe atomic platform.
Signed-off-by: Shane Xiao <shane.xiao@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/22 >
2025-11-05 18:53:35 +08:00
lyndonli
c06c3fd82b
wsl/hsakmt: Fix boundary condition in VaMgr::Alloc
...
Signed-off-by: lyndonli <Lyndon.Li@amd.com >
Reviewed by: Shi.Leslie <Yuliang.Shi@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/19 >
2025-11-05 18:53:35 +08:00
lyndonli
4c11077c58
wsl/hsakmt: Replace asserts with warnings in VaMgr destructor
...
When NDEBUG is defined, assertions become ineffective.
Signed-off-by: lyndonli <Lyndon.Li@amd.com >
Reviewed by: Shi.Leslie <Yuliang.Shi@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/19 >
2025-11-05 18:53:35 +08:00
Shi.Leslie
3161be1619
wsl/hsakmt: Add ring ptr check before lock
...
This patch also move the invalid packet check outside the critical section.
Signed-off-by: Shi.Leslie <Yuliang.Shi@amd.com >
Reviewed-by: Shane Xiao <shane.xiao@amd.com >
2025-11-05 18:53:35 +08:00
lyndonli
56f4bb18f5
wsl/hsakmt: Fix memory leak in WDDMDevice::CreateGpuMemory
...
Signed-off-by: lyndonli <Lyndon.Li@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/4 >
2025-11-05 18:53:35 +08:00
lyndonli
186b0843ca
wsl/hsakmt: Set PRIV for gfx11
...
To fix the hang issue when enabling CWSR on gfx11.
Signed-off-by: lyndonli <Lyndon.Li@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/4 >
2025-11-05 18:53:35 +08:00
Flora Cui
4d4b203412
wsl/hsakmt: adapt optimized sdma poll command
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/31 >
2025-11-05 18:53:35 +08:00