244 Commits

Author SHA1 Message Date
cfreeamd 5172701708 rocr: Correct gpu dumped core contents (#2851)
Includes several tests (rocrtst) for this capability.
2026-01-30 09:38:09 -08:00
pghoshamd bc20b51f40 SWDEV-561708 Counted queue size from env var (#2844)
* SWDEV-561708 Counted queue size from env var

* use counted_queue_size for test

* remove rocrtst changes; add a const for default queue size

* Remove env var from test; use queue->size

* Improve env var documentation

* Correct type
2026-01-29 10:00:37 -05:00
pghoshamd 793755532f SWDEV-561708 Initial shared queue pool apis (#1614)
* SWDEV-561708 Initial shared queue pool apis

* Validate params; some fixes in callback function (but still needs to be checked)

* Dtor cleanup

* minor

* Enable profiling; remove callback since aql_queue takes care of it

* setPriority and setCuMask APIs updated for counted queues

* Increasing step and minor version for rocprofiler

* Tests for CountedQueueManager

* tests

* Code refactored to make pool manager part of GpuAgent only (incomplete); unique handles issue pending

* Refactored code to support CQM inside GpuAgent and unique handles; multithreaded test added

* Changed to ASSERT_SUCCESS macros for all tests

* RIng buffer overflow test added

* tests fixed; cleanup added at hsa_shutdown

* priority conversion table changes

* Compiler warnings fixed

* Rewrite 1 test; add desc and improve SetUp() code

* Improvement

* Unififed getinfo for both counted and non-counted queues

* Address PR feedback

* Addressing feedback: memleak, data type mismatch, documentation

* improve comment

* format

* Missing HSA_API macros for roctracer

* Revert "Addressing feedback: memleak, data type mismatch, documentation"

This reverts commit 5e498a55fb3640e00d06cec63dcec79293fb23de.

* Improving acquire api doc

* release api doc improved

* error codes for release api doc
2026-01-21 15:30:04 -05:00
hongkzha-amd d94185c5b2 rocrtst: set HSA_ENABLE_INTERRUPT after TestExample creation (#2687)
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com>
Co-authored-by: cfreeamd <166262151+cfreeamd@users.noreply.github.com>
2026-01-21 10:39:50 +08:00
hongkzha-amd 9dc2488b6b rocrtst: Add test cases for interrupt disabled mode (#2385)
Add explicit test cases to verify ROCr functionality with interrupts
disabled (HSA_ENABLE_INTERRUPT=0). This ensures compatibility with
virtio, dtif, and WSL configurations which require interrupt-disabled
mode.

Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com>
2026-01-13 12:10:11 -06:00
shwetakhatri-amd 0835f2e75a rocrtst: Updated CMakeFiles to find_package instead of hardcoded (#2095)
* rocrtst: Updated CMakeFiles to find_package instead of hardcoded

This is to support TheROCK build environment

* rocrtst: Fix CMake to use find_package() instead of hardcoded ENV paths

Fixed CMake style issues from previos first commit's code review

* rocrtst: Fix rocrtst NUMA dependency detection to use find_package

Also added handling of missing headers

* rocrtst: Fix NUMA and hwloc detection for cross-platform builds

---------

Co-authored-by: Shweta Khatri <shweta.khatri@amd.com>
2025-12-10 16:16:25 -05:00
Alysa Liu e79af13068 rocrtst: add VMM memory accounting test (#1666)
Add VMM test for memory accounting.
2025-12-03 11:27:51 -05:00
Alysa Liu 81df45d896 rocrtst: Add test for filter ROCR_VISIBLE_DEVICES (#2016)
Improve test coverage for amd_filter_device.cpp.
2025-12-02 10:15:03 -05:00
Apurv Mishra eded1f3529 rocrtst: Add check for SVM support in Runtime (#1687)
Signed-off-by: Apurv Mishra <Apurv.Mishra@amd.com>
Approved-by: David Yat Sin <David.YatSin@amd.com>
2025-11-05 11:36:38 -05:00
Yiannis Papadopoulos 82d68fc772 rocrtst: Assume that AIE agent memory is system RAM (#1231) 2025-10-31 09:10:00 -05:00
pghoshamd 95f721f8a5 Check emulator mode at runtime (#1432)
* Check emulator mode at runtime

* Reduce emu mode function call to one time and use result

* Move function to main.cc

* Address feedback

* EmuMode check improvement; convert to AoS

* replace g_isEmuMode with func call

* Add mode check func for every sample
2025-10-24 10:11:19 -04:00
Sunday Clement b9b8b6110b rocrtst: Add SVM Prefetch test (#360)
this test will prefetch SVM memory, and then verify the memory is sourced
from the expected numa node.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>
2025-10-17 09:43:46 -04:00
Alysa Liu d5cbdc104d rocrtst: Add Memory_Async_Copy_On_Engine Test (#885)
Increase test coverage involving:
hsa_amd_memory_get_preferred_copy_engine()
hsa_amd_memory_copy_engine_status()
hsa_amd_memory_async_copy_on_engine()
2025-10-15 14:51:54 -04:00
Sunday Clement f3e1db176a rocrtst: Reduce host memory limit to 70% (#905)
* rocrtst: Reduce host memory limit to 70%

Reducing the upper bound for rocrtstFunc.Memory_Max_Mem to 70% from
90% to help reduce test execution time.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>

* rocrtst: Add ROCRTST_LIMIT_POOL_SIZE env var

Add environment variable to override the memory pool sizes when running
tests.

Co-authored-by: David Yat Sin <David.YatSin@amd.com>

---------

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>
Co-authored-by: David Yat Sin <David.YatSin@amd.com>
2025-09-22 09:39:00 -04:00
Alysa Liu 2b2b8329b5 rocr: Add copyright for new files (#886)
Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>
2025-09-11 10:56:31 -04:00
Sunday Clement e9bb77614e rocrtst: Test for shader access after async_copy (#645)
New test that does a memory_copy, and right after has the shader access
the data. This verifies that the memory is coherent and that all the
probes and flushes were done correctly by the memory_copy.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>
2025-09-09 15:03:56 -04:00
David Yat Sin 875fb40a03 Dayatsin/develop vmm pointer info (#305)
* rocr: hsa_amd_pointer_info to support VMEM pointers

Extend hsa_amd_pointer_info to support virtual memory addresses.

If hsa_amd_pointer_info is called on an address that is reserved but not
mapped to memory, then the pointer type will be reported as
HSA_EXT_POINTER_TYPE_RESERVED_ADDR.

If hsa_amd_pointer_info is called on an address that is mapped, then the
pointer type will be reported as HSA_EXT_POINTER_TYPE_HSA_VMEM

* rocrtst: VirtMemory_Basic_Test test for pointer info

Extend rocrtstFunc.VirtMemory_Basic_Test to test for
hsa_amd_pointer_info

* rocrtst: Add SVM Memory Test
2025-08-13 14:21:47 -04:00
Alysa Liu 7ebf230622 rocrtst: migrate from rsmi API to amdsmi API
Replace ROCm SMI (rsmi) API calls with AMDSMI (amdsmi) API calls
in rocrtst.

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: 4fab4d70e6]
2025-07-11 11:22:34 -04:00
Chris Freehill 0e860e73b0 rocr/rocrtst: Update to c++17
[ROCm/ROCR-Runtime commit: f1bd89bd0d]
2025-06-30 14:02:24 -05:00
Sunday Clement a9a8190453 rocrtst: Add new test for querying Clock Counters
added new subtest to Agent Properties test, to check functionality of
query.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: d2b35dfee6]
2025-06-23 18:45:09 -04:00
David Yat Sin b0e43cc426 rocrtst: Reduce host memory limit to 90%
Further reduce upper bound for rocrtstFunc.Memory_Max_Mem
as previous limit of 95% can still trigger OOM killer.


[ROCm/ROCR-Runtime commit: 649ec63a4f]
2025-06-16 21:02:20 -04:00
David Yat Sin 8982f2c2c6 rocr: Fix compile warning when using clang
[ROCm/ROCR-Runtime commit: 96d0f07b15]
2025-06-12 10:38:58 -04:00
David Yat Sin 1b1d4e017a rocr:Fix compile warnings
[ROCm/ROCR-Runtime commit: 11da1293de]
2025-05-28 16:12:02 -04:00
Flora Cui 4360679cb7 rocrtst: performance::memory_async_copy test fix on DXG
Signed-off-by: Flora Cui <flora.cui@amd.com>


[ROCm/ROCR-Runtime commit: e884650952]
2025-05-26 15:01:27 +08:00
Aaron Liu ba372ca4a8 rocrtst/dtif: performance::memory_async_copy test fix on DTIF
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Signed-off-by: Feifei Xu <feifxu@amd.com>
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com>
Reviewed-by: David Yat Sin <David.YatSin@amd.com>


[ROCm/ROCR-Runtime commit: 297ea78140]
2025-05-13 16:44:31 -04:00
Lang Yu cd239c7bcf rocrtst: fix rocrtst.Test_Example
VerifyResult always returns true. That's not expected.

Signed-off-by: Lang Yu <lang.yu@amd.com>


[ROCm/ROCR-Runtime commit: 89926f5b0b]
2025-03-20 12:57:52 +08:00
David Yat Sin 732c3cfa8f rocrtst: Disable RLIMIT for negative queue tests
The negative queue tests generate an exception which triggers a coredump
generation. Disable RLIMIT so that the coredumps are not generated for
these tests.


[ROCm/ROCR-Runtime commit: 4cb6a6d45d]
2025-03-04 10:29:34 -05:00
David Yat Sin 1474a6c774 rocr: Remove gfx940 and gfx941 support
[ROCm/ROCR-Runtime commit: 13c591d250]
2025-02-19 12:16:24 -05:00
David Yat Sin 99e040e730 rocrtst: extend IPC test to support async_handler
[ROCm/ROCR-Runtime commit: 806ddfc8eb]
2025-02-19 11:19:09 -05:00
David Yat Sin d0ae8b2eb5 rocr: Add support for gfx950
<squashed with patch for gfx950 generic targets>

Signed-off-by: Chris Freehill <Chris.Freehill@amd.com>

Change-Id: Ifec6d93cf46c7fbf736c6572882299e279260af6


[ROCm/ROCR-Runtime commit: dab8f2fc65]
2025-01-26 13:04:58 -05:00
Tim Huang 8a853c2539 rocrtst: add gfx1153 to the default targets
Change-Id: I6cce4f924c236ea83cbe0ab9402c0cabdb202356
Signed-off-by: Tim Huang <tim.huang@amd.com>


[ROCm/ROCR-Runtime commit: 0f507e7690]
2024-12-30 02:06:01 -05:00
Horatio Zhang 828859b784 rocrtst: fix build error for opencl-c.h
<built-in>:2:10: fatal error: '/opt/rocm/llvm/lib/clang/18/includeopencl-c.h' file not found
    2 | #include "/opt/rocm/llvm/lib/clang/18/includeopencl-c.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Change-Id: I56138aba15465b6dd47bb3aad810bdd10f2b2a74
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com>


[ROCm/ROCR-Runtime commit: b02b842368]
2024-12-16 21:28:09 -05:00
Shweta Khatri 7019761f4f rocrtst: Disable FreeQueueRingBufferTest temporarily
This test is disabled until kernel patches are added to handle invalid
user actions gracefully. These patches validate and block operations
like freeing active queue buffers, which can corrupt the driver's state
if unhandled.

Currently, such operations result in driver state corruption, leading
to segmentation faults and subsequent failures during runtime.

Change-Id: If4c321a14df950a639141fc96048889659c14477


[ROCm/ROCR-Runtime commit: 2cf3813f9f]
2024-11-26 09:18:47 -05:00
AravindanC 697d500cb7 Update static package dependency of rocrtst
Change-Id: Ic12a6f2ec3bd03d871815810cc79488e7d5c57ab


[ROCm/ROCR-Runtime commit: 1a0de862aa]
2024-11-06 07:06:37 -08:00
Chris Freehill dd33820b23 rocr: Fix several rocrtst memory errors
Change-Id: I9049a3905fb26cf9b8ad0839684a70771a49f616


[ROCm/ROCR-Runtime commit: 4256630fd0]
2024-10-30 20:36:25 -04:00
Chris Freehill dd037425ed rocr: Quiet some ROCr compile warnings
These are mostly AIE related, but there are a couple of others.

Change-Id: I549e004772160ca282d4c94dc9d94dd2ccae8b1c


[ROCm/ROCR-Runtime commit: 08699069d6]
2024-10-28 09:08:14 -04:00
David Yat Sin d0c5158374 rocrtst: Fix VirtMemory_Basic_Test permissions
Fix VirtMemory_Basic_Test permissions to adjust for previous change to
the hsa_amd_vmem_set_access behavior change that was done with this
patch:

rocr/vmm: Only modify permisions for specified agents

Change-Id: I97230600b9b9144459b08ca3da3a5bfbdbb98231


[ROCm/ROCR-Runtime commit: ead3aafcda]
2024-10-11 10:41:11 -04:00
Kent Russell 17d23cbd78 rocrtst: Various codeql fixes
Fix some potentially unreleased memory, null value checks, files not
closed, and other such issues reported by codeql

Change-Id: Ia679aff97a773a642d8c8cbadeae30955554a62e
Signed-off-by: Kent Russell <kent.russell@amd.com>


[ROCm/ROCR-Runtime commit: d64e33520f]
2024-09-27 09:56:18 -04:00
Longlong Yao 745d799f9b rocrtst: fix resource leak
Change-Id: Ib57dccad0b639539e1076daba31eef278f2cf638
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com>


[ROCm/ROCR-Runtime commit: 3b829d0e62]
2024-09-23 15:04:43 -04:00
David Yat Sin a0ccfce615 rocrtst: Limit pool sizes to 2GB on emulator
Individual simple tests such as CPUAccessToGPUMemoryTest are taking
several hours on emulators as the total amount of VRAM keeps increasing.
Limit the pool sizes to 2GB, only on emulator.

Change-Id: I4b33e8549f89413da255731e6748f606ca64a663


[ROCm/ROCR-Runtime commit: 588a5a2fd3]
2024-09-19 19:44:53 +00:00
David Yat Sin 97489aa2c2 rocrtst: Add negative test for invalid buffer free
Add a negative test to try to free the ring buffer of a queue and
confirm that a memory error is generated.

Change-Id: I4afd95c69c62f7c3e1138d5d6c4a5fd237631e43


[ROCm/ROCR-Runtime commit: 3cb25e5236]
2024-09-19 19:44:53 +00:00
Wang, Yanyao 564ca754d1 Remove hard-coded llvm-project folder for rocrtst
Signed-off-by: Wang, Yanyao <yanyao.wang@amd.com>
Change-Id: I9ba81c1182da812596d7d314f3a6dae7cbcd0c2d


[ROCm/ROCR-Runtime commit: c064218637]
2024-09-19 19:44:53 +00:00
David Yat Sin 1c2d70c796 rocrtst: Fix segfault on p2p copies
Fix segfault on p2p copies when 2 agents cannot access each other's
memory (usually because the PCI BAR's are out of range). The
AcquireAsyncCopyAccess function should return NULL in that case, so that
the test can be skipped.

Change-Id: If018f3609dd21a01c56eaec94de3bca52c385c4d


[ROCm/ROCR-Runtime commit: 4ba4867fa5]
2024-09-03 14:06:48 -04:00
David Yat Sin a7b0f541b7 rocrtst: Skip inaccessible agents when importing dmabuf
If some agents cannot access the memory buffer directly, this will cause
the hsa_amd_interop_map_buffer API call to fail

Change-Id: If2f0e1735c2926440d657831de50775d7f304c8e


[ROCm/ROCR-Runtime commit: 2360253b3b]
2024-08-28 15:58:02 -04:00
Chris Freehill cca5b9a960 rocrtst: change const arg to non-const
In rocrtst helper_funcs.h, a function argument that gets
written to was previously incorrectly marked as const.

Change-Id: If8cc6555ebfa974b9665d9d5b93de01bb45fde2c


[ROCm/ROCR-Runtime commit: 1c6a4a55f1]
2024-08-14 08:18:11 -05:00
Chris Freehill 3bdfe00bb7 Change "devel" to "dev" for runtime-rocr
Also, don't call rpm command if distro doesn't support it.

Change-Id: I7f39f9c1f39c5408967d66e2db1f471847c5e668


[ROCm/ROCR-Runtime commit: 6fda123836]
2024-07-19 22:58:07 -05:00
Lang Yu f2f5585a73 Fix Memory_Atomic_Add_Test issue
Since "libhsakmt: Prevent hsaKmtRegisterMemory* from registering non-userptr",
non-userptr is not allowed to be pinned any more.
Use hsa_amd_agents_allow_access to map host memory.

Change-Id: I898d2f83222907de58cafc1a2b18a636634d1b20
Signed-off-by: Lang Yu <lang.yu@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>


[ROCm/ROCR-Runtime commit: 7e6c3d1bfa]
2024-07-17 22:32:23 -05:00
AravindanC 2d6be55401 Static package generation for rocrtst
Change-Id: I465d542bc223db9c620fde72137012c61eff1ac3
Signed-off-by: David Yat Sin <David.YatSin@amd.com>
Signed-off-by: Aravindan Cheruvally <Aravindan.Cheruvally@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>


[ROCm/ROCR-Runtime commit: 81825df44d]
2024-06-25 12:50:03 -05:00
Yifan Zhang 491275f838 Add support for GC 11.5.2
Change-Id: Iad8604881dc66108933ac2155fef3b74bca9ac3f
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>


[ROCm/ROCR-Runtime commit: 71494a920b]
2024-06-25 12:50:03 -05:00
Shweta Khatri 5f30d083d0 Revert "Added new ROCr Trap Handler Test"
This reverts commit b156e906d9c192bd487d10a8900e3eb6090ef547.

Reason for revert: Memory violation test causing a timeout in subsequent test.

Change-Id: If3a217575af545a47d6d67bebba4a2c640a43b81
Signed-off-by: Chris Freehill <cfreehil@amd.com>


[ROCm/ROCR-Runtime commit: 2e1f363d2f]
2024-06-25 12:27:09 -05:00