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
f342af52c5
wsl/hsakmt: fix gpu_mem handle
...
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/28 >
2025-11-05 18:53:35 +08:00
Flora Cui
5db21f53da
wsl/hsakmt: add get_gpu_mem()
...
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/28 >
2025-11-05 18:53:35 +08:00
Flora Cui
f7d2df7486
wsl/hsakmt: add more gfx1100 asic to kGfxipTable
...
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/27 >
2025-11-05 18:53:35 +08:00
lyndonli
33ea72a993
wsl/hsakmt: Implement fetching of UUID
...
Signed-off-by: lyndonli <Lyndon.Li@amd.com >
Reviewed-by: Shi.Leslie <Yuliang.Shi@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/25 >
2025-11-05 18:53:35 +08:00
Flora Cui
73a64175a1
wsl/hsakmt: fix pci bdf
...
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/24 >
2025-11-05 18:53:35 +08:00
Longlong Yao
255069da95
wsl/hsakmt: Add is_dgpu check for wddm device
...
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/18 >
2025-11-05 18:53:35 +08:00
Longlong Yao
3c3af5c586
wsl/hsakmt: check hsakmt_is_dgpu for hsakmt
...
To align with Native Linux, use NumCPUCores in GPU and
NumFComputeCores in CPU to determine if the asic is dGPU.
This value is only for libhsakmt internal use.
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/18 >
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
Flora Cui
9f5bda00ca
wsl/hsakmt: refactor topology related code
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed by: Shi.Leslie <Yuliang.Shi@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/13 >
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
4b9ef909b4
wsl/hsakmt: relax the check conditions for the pointer
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
Reviewed-by: Longlong Yao <Longlong.Yao@amd.com >
Reviewed-by: tiancyin <tianci.yin@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/9 >
2025-11-05 18:53:35 +08:00
lyndonli
2f18d996fd
wsl/hsakmt: Fix inaccurate elapsed time measurement
...
Signed-off-by: lyndonli <Lyndon.Li@amd.com >
Reviewed-by: Shane Xiao <shane.xiao@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/7 >
2025-11-05 18:53:35 +08:00
Flora Cui
31e133ae49
wsl/hsakmt: drop duplicated MIN&MAX
...
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
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
820f24b4df
wsl/hsakmt: make hsaKmtImportDMABufHandle as internal interface
...
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
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
tiancyin
b4df74f198
wsl/hsakmt: add sub-allocator
...
Reviewed-by: Shane Xiao <shane.xiao@amd.com >
Reviewed-by: lyndonli <Lyndon.Li@amd.com >
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:35 +08:00
Flora Cui
b062a23dfa
wsl/hsakmt: add mem flag to protect queue cmd buffer
...
Signed-off-by: Flora Cui <flora.cui@amd.com >
2025-11-05 18:53:35 +08:00
Horatio Zhang
7466852f0c
wsl/hsakmt: Adjust the event handling warning log
...
InterruptSignal is not used in wsl thunk. In order to avoid printing
redundancy caused by calling related event interfaces, the warning log
has been adjusted here.
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
2025-11-05 18:53:35 +08:00
Horatio Zhang
f552bbc199
wsl/hsakmt: Remove redundant debug logging functions in utils.h
...
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
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
6d5324c957
wsl/hsakmt: Standardize warning logging with pr_warn_once
...
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
f648688c45
wsl/hsakmt: Refactor logging function
...
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
5cd49fb600
wsl/hsakmt: Resolve snprintf Truncation Warning
...
This patch addresses a warning encountered during the build process:
warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a
region of size between 0 and 544 [-Wformat-truncation=]
snprintf(path, MAXPATHSIZE, "%s/%s/cache", node_dir, dir->d_name);
^~
note: ‘snprintf’ output between 8 and 807 bytes into a destination of size 545
snprintf(path, MAXPATHSIZE, "%s/%s/cache", node_dir, dir->d_name);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/38 >
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
Horatio Zhang
09f8f15d90
wsl/hsakmt: Ensure Immediate Output of Debug and Warning Messages
...
Added fflush(stderr) to the WARN_ONCE and debug_print macros in utils.h
to ensure that warning and debug messages are immediately flushed to the
standard error stream.
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/libhsakmt/-/merge_requests/36 >
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
lyndonli
5c13bc7509
wsl/hsakmt: Modify num_subdirs parameter to resolve the warning
...
Signed-off-by: lyndonli <Lyndon.Li@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/32 >
2025-11-05 18:53:35 +08:00
lyndonli
c898104228
wsl/hsakmt: Introduce WSL_CHECK_AVAIL_SYSRAM environment variable
...
By default, this variable is 0. Set it to 1 to compare available
system memory with the requested amount before allocation. It helps
identify system hangs caused by excessive memory allocation.
Signed-off-by: lyndonli <Lyndon.Li@amd.com >
Reviewed-by: Flora Cui <flora.cui@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/32 >
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
a2b449a370
wsl/hsakmt: refine the header guard
...
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/26 >
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
Horatio Zhang
ea04f9f62f
wsl/hsakmt: Remove unused flag file in libhsakmt
...
Clean up unused flag* file in libhsakmt, because we reuse the flag
from the ROCr layer and pass the support list upwards using
HsaVersionCapability.
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/libhsakmt/-/merge_requests/23 >
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
tiancyin
efd0158724
wsl/hsakmt: use GpuMemory object address as va in physical memory handle case
...
Signed-off-by: tiancyin <tianci.yin@amd.com >
2025-11-05 18:53:35 +08:00
Longlong Yao
6f331de20d
wsl/hsakmt: drop doorbell signal
...
For wsl, doorbell ring needs to call hsaKmtQueueRingDoorbell
instead of atomic store in hsa runtime. It does not care about
the doorbell signal value. So just return a pointer that points
a memory allocation of 8 bytes.
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com >
Reviewed-by: lyndonli <Lyndon.Li@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/14 >
2025-11-05 18:53:35 +08:00
Aaron Liu
9c59764f97
wsl/hsakmt: fix support ASICs for WSL
...
Signed-off-by: Aaron Liu <aaron.liu@amd.com >
Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/9 >
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
Horatio Zhang
e8235d4a50
wsl/rocr: Add rocr4wsl project version
...
Users can obtain rocr4wsl version information through the following methods:
strings /opt/rocm/lib/libhsa-runtime64.so | grep ROCR4WSL
strings /opt/rocm/lib/libhsakmt.a | grep ROCR4WSL
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/1 >
2025-11-05 18:53:35 +08:00