Longlong Yao
be242bfc46
libhsakmt: change the unit of clock according to kmd version
...
Windows KMD driver(25.10) has changed the unit of clock from
MHz to KHz.
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
Longlong Yao
65b42fb70a
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
lyndonli
b5a9a5c36b
wsl/hsakmt: Improve error handling in allocation
...
This change ensures consistent error
handling across build configurations.
Signed-off-by: lyndonli <Lyndon.Li@amd.com >
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/40 >
2025-11-05 18:53:36 +08:00
Longlong Yao
f44abf508e
wsl/libhsakmt: change device id
...
Reviewed-by: lyndonli <Lyndon.Li@amd.com >
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com >
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/38 >
2025-11-05 18:53:36 +08:00
tiancyin
fb429237ac
wsl/hsakmt: fix incorrect addr info of hsaKmtQueryPointerInfo
...
rocr runtime will take care of the block offset(ref Runtime::IPCCreate),
just returning the block base is enough in suballocator case.
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
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
29ed03ab0a
wsl/hsakmt: forcing enable_ipc_mode_legacy_ to false to support ipc mem
...
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
Horatio Zhang
914a8ecbc0
wsl/hsakmt: Configure Capability Info to Disable Fine-Grained VRAM Management
...
This fix is for Unit_cache_coherency_cpu_gpu. Regardless of whether the
HSA_FORCE_FINE_GRAIN_PCIE variable is set in the environment, set the user_visible
of the region to false. This applies to the functionality of exposing VRAM as
uncached/fine grain over PCIe or XGMI.
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/34 >
2025-11-05 18:53:35 +08:00
tiancyin
ee73fc046e
wsl/hsakmt: set to system domain when cpu want to access the buffer
...
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
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