76333 Commits

Author SHA1 Message Date
Flora Cui 28c81cffda librocdxg: include rocr headers
Signed-off-by: Flora Cui <flora.cui@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 25c2b74037 librocdxg: add rocr header files
Signed-off-by: Flora Cui <flora.cui@amd.com>
2025-11-05 18:53:37 +08:00
Flora Cui c5d2a0040e librocdxg: load rocr symbols
Signed-off-by: Flora Cui <flora.cui@amd.com>
2025-11-05 18:53:37 +08:00
Flora Cui 99da7e60ec 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 45cc96aeb8 librocdxg: include rocr headers
Signed-off-by: Flora Cui <flora.cui@amd.com>
2025-11-05 18:53:37 +08:00
Flora Cui e2a1f0c7fc 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 3915c38957 librocdxg: rename hsakmt to rocdxg
Signed-off-by: Flora Cui <flora.cui@amd.com>
2025-11-05 18:53:37 +08:00
Flora Cui 0e8f794b1c wsl/libhsakmt: simplify adapter_info
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/97>
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 70b9951b0c 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 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 838421c540 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 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 887056d64a 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
Flora Cui 1217d4eae7 wsl/libhsakmt: simplify adapter_info
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/97>
2025-11-05 18:53:37 +08:00
tiancyin 575e25b7e4 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
Flora Cui 15b8ce7529 wsl/libhsakmt: fix handling of HSA_OVERRIDE_GFX_VERSION option
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/96>
2025-11-05 18:53:37 +08:00
tiancyin 3e40beb68c 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
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
Flora Cui e41b405f53 wsl/libhsakmt: fix hsaKmtRuntimeDisable ret value
As ROCR exclusively accepts HSAKMT_STATUS_SUCCESS. returning any other
value is treated as an error and will trigger an exit due to failure.

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 e99fcfee51 wsl/libhsakmt: remove redundant PAGE_SHIFT
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
Horatio Zhang 5c16eddc67 wsl/libhsakmt: update WIN_KMD_VERSION to 25.20
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com>
Reviewed-by: Flora Cui <flora.cui@amd.com>
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/92>
2025-11-05 18:53:37 +08:00
Flora Cui 6ffd750632 wsl/libhsakmt: fix return value for hsaKmtUnmapMemoryToGPU
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/89>
2025-11-05 18:53:37 +08:00
Flora Cui 23bc53e9a8 wsl/libhsakmt: fix abused memory flag in allocation_map_
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/89>
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 593e919bcd 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 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 557f888e1c 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 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 602ed1aff8 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
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 a53f1a7c1e 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 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 6d941db5ec 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 972e74e723 wsl/libhsakmt: move userptr release to hsaKmtDeregisterMemory()
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 61add17468 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
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
Longlong Yao 250d43508e 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
Flora Cui 77093f8f85 wsl/libhsakmt: extract is_ipc_sysmemfd()
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 c01d09114b wsl/libhsakmt: correct gfx family id
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/54>
2025-11-05 18:53:36 +08:00
Flora Cui 5a89405bf8 wsl/libhsakmt: fix check for queue 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/83>
2025-11-05 18:53:36 +08:00
Longlong Yao 1c4f3e86fa libhsakmt: add support to get driver version number
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/43>
2025-11-05 18:53:36 +08:00
Flora Cui 62aee13f7b wsl/libhsakmt: fix hsaKmtRegisterGraphicsHandleToNodesExt
if nodes array is nullptr

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/83>
2025-11-05 18:53:36 +08:00
Flora Cui 75cbeda847 wsl/libhsakmt: fix default device in memory allocation
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
Flora Cui 67332944d2 wsl/libhsakmt: set default node
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