Grafico dei commit

175 Commit

Autore SHA1 Messaggio Data
Alex Sierra e94ff8a36c kfdtest: Add gfx 9.5 as FAMILY_AV
Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Change-Id: Ib5696eee1d4f64c9c87d714eae7c80fbbd1e2b23
2025-01-26 21:43:55 -05:00
Tony Gutierrez 15107afb11 rocr: Generalize driver discovery
Generalize the driver discovery and move driver-specific
functionality to the concrete driver implementations.
Currently, this process is tightly coupled to the hsakmt
which is GPU and OS specific.

Change-Id: Ie1c53fef407a71b5ec4c6eaf3a3ed00871184409
2025-01-23 15:09:14 -05:00
Shweta Khatri 2d4a578020 Revert "Revert "hsakmt: Only set exec flag when requested""
This reverts commit 80da7d5ee4.

Reason for revert: This will put back the change ID - Id1154f08f6ba21c633905fd46b06053994d6f3cc to ROCR repo, which will prevent memory allocations from being automatically granted the 'executable' flag, addressing previously -  incorrect and unsafe behavior in ROCm driver.

Change-Id: I3d45c45859929a80f7791681b411251e099a1901
2025-01-23 09:08:25 -05:00
Apurv Mishra ecf57310ca hsakmt: move 'counter_id' array to heap
local variable 'counter_id' exceeded the max single
use of stack, thus move to heap to prevent overflow

also, use of a contiguous memory block for 2D array
to reduce space complexity, add error messages for
NO_MEMORY exits and check MAX_COUNTER limit for IDs

Change-Id: Id0249ca767a336b31c759c693a82d3f5c950a2fa
Signed-off-by: Apurv Mishra <apurv.mishra@amd.com>
2025-01-13 16:29:16 -05:00
Harish Kasiviswanathan 1d71975fcc kfdtest: Fix KFDASMTest failure on older ASICs
HW_REG_HW_ID1 is only available from gfx12 onwards

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: Ibf4bd62e01ada3dee6dd88762ccb853bab63ff87
2025-01-13 15:22:20 -05:00
Harish Kasiviswanathan f8ae5c47ba kfdtest: Add gfx12 to TargetList for AssembleShaders
Add gfx12 so that it gets tested when KFDASMTest.AssembleShaders is run.
GWS support has been removed for gfx12. Modify shaders to take that into
account.

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I70e87febb6388852ea54d69cf9201339a7910581
2025-01-13 15:22:15 -05:00
Lang Yu fe5f12342d kfdtest: consolidate LoopIsa
1, Initialize the registers before using them is the best practice.
Though the use case here doesn't care whether the registers are
initialized or not, some emulators complain the "read_before_write"
behavior. Initialize the registers used to silence these complaints.

2, Update s_wait stuff for gfx12.

Change-Id: I462b2b0b5017dd2876a5954169d3b6b2f1c2a75b
Signed-off-by: Lang Yu <lang.yu@amd.com>
2025-01-10 21:27:23 -05:00
Kent Russell cc7ff73e7f kfdtest: Can't initialize variable-sized objects
Do a memset, since we can't initialize variable-sized objects

Change-Id: I57faf4a0581a29f9d30391aa387812c2b7bb5011
Signed-off-by: Kent Russell <kent.russell@amd.com>
2025-01-09 10:36:06 -05:00
Tim Huang 7bad0cb4a1 kfdtest: add blacklist for gfx1153
Change-Id: I1f132858cb79c6d0561477fe8ce69aafd93ad351
Signed-off-by: Tim Huang <tim.huang@amd.com>
2025-01-08 21:20:17 -05:00
David Belanger 9667af97d9 kfdtest: Add ExtendedCuMasking test case
New implementation of CU mask testing that focuses on correctness of
masking.  Unlike previous implementations, this new implementation does not
rely on performance measurements to decide on the results of the test.
Instead, this implementation checks if waves were executed on all the CUs
enabled and only the CUs enabled.

Test case initially supported on GFX12.

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: I5af8b890179bc9a415fc7f47e736f4971fc40c4a
2025-01-08 17:36:59 -05:00
Kent Russell eda54222ea kfdtest: Explicitly include tuple in KFDCWSR
We can inherit it from gtest, but not in ASAN builds. And we should be
including what we use, instead of hoping to inherit it through other
headers

Change-Id: Id47ab06a57e1c71c88f72da5f21a71f37db8a2f3
Signed-off-by: Kent Russell <kent.russell@amd.com>
2025-01-07 13:57:36 -05:00
James Zhu b07a80e505 libhsakmt: add spm buffer header
to send data back to user.

Change-Id: If11fb4147e32c0eed319ccf76bcde9d76815ff67
Signed-off-by: James Zhu <James.Zhu@amd.com>
2025-01-06 14:40:05 -05:00
Xiaogang Chen eafa929520 kfdtest: fix a regession on KFDEvictTest test case
The kfdtest multi-gpu extension only allows using the first gpu(in topology
order) as default gpu for KFDEvictTest test case. We should allow user
to select any gpu in system as default gpu to run KFDEvictTest test case.

Signed-off-by: Xiaogang Chen<Xiaogang.Chen@amd.com>
Change-Id: I8848771d92ae2812fbb96e917454ab3b4a71a2fa
2024-12-18 10:13:54 -06:00
Xiaogang Chen ec457752dc kfdtest: update run_kfdtest.sh when HSA_TEST_GPUS_NUM is enable
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I68e4f4f8fd7397d3b39b3473638836e4531bef2b
2024-12-16 12:47:50 -05:00
Xiaogang Chen cbb38606e3 kfdtest: Convert KFDSVMRangeTest into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: Ia4d55c38576c39b3768a847c60d70bda88f65740
2024-12-16 12:47:44 -05:00
Xiaogang Chen 641f1f797d kfdtest: Convert KFDLocalMemoryTest into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: Iaf20ec15e85ed10998e9735881d3c029abedd3a4
2024-12-16 12:47:39 -05:00
Xiaogang Chen 10c9b98f6e kfdtest: Convert KFDMemoryTest into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I29d7fbb156a88b4df5be5f2fa0c20fbc47b108ed
2024-12-16 12:47:34 -05:00
Xiaogang Chen f229605b06 kfdtest: Convert KFDQMTest into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: Ia3582ab5b802ead4df267eeb280b8e7d37eb0ac2
2024-12-16 12:47:28 -05:00
Xiaogang Chen dbccf11ef8 kfdtest: Convert KFDExceptionTest into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I545ac485d13a3a56a3b352926ec71daa5b074862
2024-12-16 12:47:21 -05:00
Xiaogang Chen 0357e2e139 kfdtest: Convert KFDEventTest into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: Id1dc91f654686f159adb1bc70907e11558ee4be0
2024-12-16 12:47:14 -05:00
Xiaogang Chen fa31caddba kfdtest: Convert KFDCWSRTest into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I51646ebd95b2ef4820f7b503bd642deb05a86930
2024-12-16 12:47:08 -05:00
Xiaogang Chen 6c6daf66bf kfdtest: Convert KFDGWSTest into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I0901750b2ce55bd7f44425b01442d98f0faf12fd
2024-12-16 12:47:01 -05:00
Xiaogang Chen 759ca45f54 kfdtest: convert KFDGraphicsInterop into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I590be9ea063b0d115641aa5b40be4c376377c1dd
2024-12-16 12:46:55 -05:00
Xiaogang Chen dd1801df41 kfdtest: convert KFDPerfCountersTest into multi-GPU test framework
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I29124147394b69c7fb5533a0e54d375d06b1ec13
2024-12-16 12:46:49 -05:00
Xiaogang Chen c69e660e7a kfdtest: Update KFDMultiProcessTest class to support kfdtest run on multiple gpu
Update KFDMultiProcessTest class to fork process on gpu wise.

Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: Ibb12d64b4cbc5f082d737fd8d8a74233b75be13e
2024-12-16 12:46:42 -05:00
Xiaogang Chen b4943d718b kfdtest: Implement an infracture to support kfdtest run on multi gpu
Update class KFDBaseComponentTest to have kfdtest run on multi gpu under google test framework.

Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: If139c4fc6cf062fb800ff171c69cbf9604f98278
2024-12-16 12:46:32 -05:00
Xiaogang Chen 665e6f80bf kfdtest: Add an env variable to control kfdtest on multi gpu
Add HSA_TEST_GPUS_NUM env variable that controls gpu number kfdtest uses.

This env variable will be used by following patches.

Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I800042f93d4e0955040f450e9b5cf09927971323
2024-12-16 12:46:25 -05:00
Xiaogang Chen 36a82593ed kfdtest: Extend gtest log functions
Extend Google test log functions to extend kfdtest running on multiple gpu.

Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I6d8de92fec606309756423b3a6fa2af3558c0517
2024-12-16 12:46:16 -05:00
Xiaogang Chen e1fdd6fb5f kfdtest: Separate LLVM initialization and instantiation
Assembler function from LLVM is not multi-thread safe and is ASIC dependent.
To extend kfdtest to test on multiple GPU separate LLVM initialization and
assembler instantiation. Each test uses its own assembler.

Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I94c996e807b81d8b19361b450be985b12042477c
2024-12-16 12:46:07 -05:00
gaba 8c35523225 kfdtest: Modify system Buf testing size
When using total system memory to test on some motherboard,
the test take very long time, witch looks like system Hang.

Change-Id: Ic31fe60cfb1363fbc8a2d8f7e1cb2bae0e149ea8
Signed-off-by: gaba <gaba@amd.com>
2024-12-10 10:55:55 -05:00
Lang Yu 37135aadfa kfdtest: update PersistentIterateIsa for gfx12
1, Use s_wait_* instead of s_waitcnt
2, Remove a redundant s_waitcnt

Change-Id: Id0f31db0fc520adadd81eb574ad389f63859303a
Signed-off-by: Lang Yu <lang.yu@amd.com>
2024-12-02 19:59:57 -05:00
Apurv Mishra c066ec13dd hsakmt: modified to free all_gpu_id_array in fmm.c
Add free() for 'all_gpu_id_array' in
hsakmt_fmm_destroy_process_apertures() and
removed it from 'hsakmt_fmm_clear_all_mem()'

Change-Id: I32d2d22e7152f62a3f2e7da4f601f0db7cebd534
Signed-off-by: Apurv Mishra <apurv.mishra@amd.com>
2024-11-28 13:08:03 -05:00
Apurv Mishra 79f0ac2534 hsakmt: minor code cleanup and refactor topology.c
removed unused value assignment for HSAKMT_STATUS,
restructured 'topology_sysfs_check_node_supported'

Change-Id: I21cdccb3e3c5e42981f10597426de479d0f4ee6a
Signed-off-by: Apurv Mishra <apurv.mishra@amd.com>
2024-11-28 13:06:23 -05:00
Emily Deng 1f9c080932 kfdtest: fix event leaks issue
DisableCpQueueByUpdateWithZeroPercentage need to destroy event to avoid
event leak.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Change-Id: I4fb51b670fbff1edcd7fd61517f5c8a6674003c0
2024-11-27 19:33:10 -05:00
Emily Deng c8031f2a69 kfdtest: Fix the dead lock SignalHandling
The issue arises in the CatchSignal function, which attempts to write to
the standard error stream upon receiving a signal. However, the standard
error stream may already be locked at this point, as the parent process
also attempts to write to the standard error stream after mapping the GPU
memory. This leads to a deadlock, with the program waiting for the
release of the lock on the standard error stream.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Change-Id: Ie69354f4342b96ffe1f2a87f655687da1cbee4b9
2024-11-26 19:39:45 -05:00
Eric Huang 09b899b079 kfdtest: increase test timeout and optimize evict tests timeout
there are some timeout issues of evict tests on recent new boards,
it is to solve those issues and optimize evict timeout, as well
as to give user a chance to change timeout in command line.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I2f40c8ea809c55675b0d0b62296b663481e5fb16
2024-11-26 11:04:29 -05:00
Jonathan Kim 0f02ed6ffb kfdtest: exclude negative testing from gfx908
GFX 9.0.8 may not properly support pipe reset capabilities so disable
test for now.

Change-Id: I3061cdad87eb979ba884c194f4229c0cbb144ee2
2024-11-20 12:23:09 -05:00
Jonathan Kim 26d338df12 kfdtest: fix dispatch pointers and event leaks tests
KFDDBGTest and KFDNegative test can eat into memory and event resources
for subsequent test interations if unallocated.

Change-Id: Iea170c20df8d487703441181b6c152b61f02d3db
2024-11-19 11:25:24 -05:00
Emily Deng f047f96161 kfdtest: Fix InterruptRestore randomly hang
Queue 2's wave blocked the queue 1's wave save, which will cause unmap
queue preemption fail. Add nop per SQ suggested.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Change-Id: Iea7f280e35487059c4499ea999b9e0cdf841d1e1
2024-11-14 23:36:06 -05:00
Jonathan Kim 865e32baf4 kfdtest: add per-pipe reset negative test
Add basic KFD per-pipe reset support.

Change-Id: I0f68c4d33e6d043de0b5cbda1d494640ba8175f1
2024-11-13 13:34:44 -05:00
Jonathan Kim 1a4adaf7bc hsakmt: Update HSA capabilites with per-queue reset
Per-queue reset is now supported and flagged in HSA capabilities.

Change-Id: I21e2421da73b9fafae19c903dc3eeeab1f84968d
2024-11-13 13:34:35 -05:00
Philip Yang e6d4a32c42 kfdtest: Update KFDSVMEvictTest.QueueTest for CPX mode
Current test has 4 processes, each process allocate and access 512
buffers, this requires 2048 waves to access 2048 buffers at same time to
finish the test. For CPX compute partition mode, each compute node has
less waves and cause random test failure. Change test to 2 processes to
use 1024 waves to access 1024 buffers with the increased buffer size.

Add waves_num check to avoid the test failure on new ASICs or simulator,
skip test if the available waves is less than 1024.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Change-Id: I64b5f9172b62cf38f62fbb0b48a801b8a11401c0
2024-10-24 12:57:30 -04:00
David Yat Sin e1865f7b16 kfdtest: Inherit CXX flags
Change-Id: I2e902ec3e6fd582c53a6d95cd49fe2b18f56b8ca
2024-10-17 14:17:08 -04:00
David Yat Sin 80da7d5ee4 Revert "hsakmt: Only set exec flag when requested"
This reverts commit 75143555fa.

Reason for revert: 
This is currently breaking some tools. Will put it back as soon as tools update their code.

Change-Id: I05c82d443f3a274a618d05e6dc5a87943f5dc7a4
2024-10-16 20:31:27 -04:00
Kent Russell ccd80d19ba kfdtest: Fix in-tree scriptless build
If you build thunk following the instructions in the thunk's README,
there is no /lib folder in the build folder. Adjust the include path,
and clean up the docs to reflect that. The header include is already
defined in the CMake file as ../../include, so we don't use
LIBHSAKMT_PATH for that linking, just the lib location

Change-Id: I73435d59adb9d01f527a28b1935086260e9d3d70
Signed-off-by: Kent Russell <kent.russell@amd.com>
2024-10-08 14:42:33 -04:00
Shweta Khatri 8bc4efc8ca hsakmt: pmc_table.c: Fix Coverity reported warnings
Eliminate out-of-bounds access in get_block_properties

Change-Id: I3abee1e36fafdda053d4bc4a611698d676b01d5c
2024-10-07 14:15:26 -04:00
Shweta Khatri 52e7fd1480 hsakmt: debug.c: Fix Coverity reported warnings
Fix potential  memory leak reported by Coverity warnings

Change-Id: Iacbaa99be3f4fe7fae5fb6a10bd41dfc34b96059
2024-10-07 14:14:26 -04:00
Shweta Khatri c9454794b6 hsakmt: fmm.c: Fix Coverity reported warnings
Fixed multiple issues related to memory management, atomicity,
and error handling across various functions: handle null checks,
use-after-free, unchecked returns, and memory leaks.

Change-Id: Ia7c76320cc20e24001052fbba2dd0600bd412140
2024-10-07 13:54:03 -04:00
Jonathan Kim 03463ed2c0 hsakmt: Enable graphics handle registration with a virtual address
Currently registering graphics memory without specifying a target
node will return a memory handle that's not a virtual address.

As a result, ROCr is forced to register with a target node for
IPC usage.

Mapping memory without specifying a target node afterwards will
result in mapping to the target node that was imported because the
previous import call flags this node targeting action to future mapping.

For ROCr IPC usage, ROCr wants to map to all GPU nodes if the target node
is not specified.

Allow the caller to register graphics handles that returns a virtual
address without having to specify the target node so that the caller
can make a subsequent map call to all GPUs.

Change-Id: I5a935092b885cc3568e4f3a5dd951c7ec6c84fca
2024-10-03 14:06:31 -04:00
Shweta Khatri 9f43c9fd51 hsakmt: spm.c: Fix Coverity reported warnings
Fix unused ret value and initialize gpu_id

Change-Id: Ib3acc7db4bbab519318d0970786a5dc641dcc9eb
2024-09-30 19:46:51 -04:00