40 Коммитов

Автор SHA1 Сообщение Дата
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 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
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
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
David Yat Sin a4003bb849 rocrtst: Add test for GPU access to memory
Add test to verify whether GPU shaders can read memory created using VMM
APIs.
Split VMM rocrtst to two separate groups: Basic and Access tests

Change-Id: Iead8d46125580c71ccd582e967c8e2e891e75c5e


[ROCm/ROCR-Runtime commit: 99e31e43aa]
2024-02-22 14:12:05 +00:00
David Yat Sin 7a6c962b36 Fix compile error on certain gcc versions
Change-Id: I8a4fab76d1dcc576eb7706ab45fc786c0cab274a


[ROCm/ROCR-Runtime commit: 5b28a1bc17]
2024-02-13 15:25:34 -05:00
David Yat Sin 99ced0140e VMM: rocrtst for basic virtual memory APIs
This is part of patch series for Virtual Memory API.

Change-Id: Ic3b44435cb09ad17d833b4a4b2551bd211b494e9


[ROCm/ROCR-Runtime commit: a69c1e9f39]
2024-01-17 10:25:09 -05:00
David Yat Sin dbdb3af4fc rocrtst:Add tag for extended-scope fine grain
Change-Id: I2a64cf3fb476271b0a5d025fb6989feb40d676bb


[ROCm/ROCR-Runtime commit: d021055ada]
2023-10-03 15:36:20 -04:00
Sreekant Somasekharan bf22d10ceb rocrtst: Fix RoundToPowerOf2 function
Compiler behavior is undefined if the right operand is negative,
or greater than or equal to the width of the promoted left operand.
For release builds with address sanitizer enabled, this compiler
optimization behavior leads to unsupported queue size value since
current method shifts till 128 bits on a 64 bit value.

Change-Id: Iddcc15b43d2331bc8bf5fc3aa4725f76844655ec
Signed-off-by: Sreekant Somasekharan <sreekant.somasekharan@amd.com>


[ROCm/ROCR-Runtime commit: ea2f832a43]
2023-06-19 19:17:49 -04:00
Graham Sider f0eeb60222 rocrtst: Throw on LocateKernelFile open() failures
Throw runtime error instead of returning empty string when open() fails
in LocateKernelFile()

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Iafa360fbc2d3c9b01b9fe7ea4c11d70bd254ccce


[ROCm/ROCR-Runtime commit: 0772e8d618]
2023-05-24 14:31:26 -04:00
jie1zhan da0ca94219 Free the executable memory , when it don't used
Fix the issue of rocrtst test - The runtime failed to allocate the necessary resources

Change-Id: Ie4ffeb939fb322db068f3132a7973a359c204176


[ROCm/ROCR-Runtime commit: 8a0fe6a832]
2022-07-29 15:16:37 -04:00
Sean Keely 9969ed9f0d Add cu masking test.
Change-Id: I8b62ebd60f2edde3ea0b298f0353381855163fea


[ROCm/ROCR-Runtime commit: d27d4545e2]
2022-06-28 11:22:42 -04:00
Sean Keely eabb4ba4b4 Correct rocrtst pool iterator.
GetGlobalMemoryPool had improper return codes for an iterator callback
and did not properly order the APU pool selection path.

Change-Id: I01ab9d23e2352be98d9718bc25889ad4f779d3ca


[ROCm/ROCR-Runtime commit: 534dc3f60c]
2021-10-16 05:02:05 -04:00
Sean Keely d139055431 Locate kernel directory from device name.
Search child directories when locating device code.

Change-Id: I51515f002ad60878a2be0b6e9ee6416c67a1d799


[ROCm/ROCR-Runtime commit: 74bcd6ee90]
2021-06-17 22:57:21 -04:00
Yifan Zhang 12433d7a87 rocrtst: fix a test case setup issue in iommuv2 for APU
APU doesn't have non-KERNARG memory pool for cpu agent or
a global memory pool for gpu agent. Current setup check
fails as below. Change to a APU specific check method.

[==========] Running 45 tests from 5 test cases.
[----------] Global test environment set-up.
[----------] 1 test from rocrtst
[ RUN      ] rocrtst.Test_Example

    #### TEST NAME ####
Test Case Example

    #### TEST DESCRIPTION ####
Put a description of the test case here. Line breaks will be taken care of
on output, not here.

    #### TEST SETUP ####
The gpu device name is gfx902
Target HW Profile is HSA_PROFILE_FULL
Test can run on any profile. OK.
/home/jenkins/hsa/runtime/rocrtst/common/base_rocr_utils.cc:180: Failure
Value of: rocrtst::ProcessIterateError(err)
  Actual: 4096
Expected: HSA_STATUS_SUCCESS
Which is: 0
HSA_STATUS_ERROR: A generic error has occurred.
/home/jenkins/hsa/runtime/rocrtst/suites/test_common/test_case_template.cc:195: Failure
Value of: HSA_STATUS_SUCCESS
  Actual: 0
Expected: err
Which is: 4096
rocrtst64: /home/jenkins/hsa/runtime/rocrtst/common/base_rocr_utils.cc:416: hsa_kernel_dispatch_packet_t* rocrtst::WriteAQLToQueue(rocrtst::BaseRocR*, uint64_t*): Assertion `test->main_queue()' failed.
../shunit2: line 977:  1382 Aborted                 (core dumped) ./rocrtst$ROCRTST_BLD_BITS "$ROCRTST_ARGS" --gtest_output=xml:"$gtest_xml"
failed (failed to run rocrtst)

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: I03691bd4171b6e622231baf3dce4db2211eb47e7


[ROCm/ROCR-Runtime commit: 5977eb554f]
2021-02-23 20:14:40 -05:00
Sean Keely 62138712cf Add asserts and minimum values for kernarg alignment and utility functions.
Kernel argument size and alignment queries are not supported on
code object v3.

Change-Id: I1bdd34e2e62132f912ac39d80355efd3456df87c


[ROCm/ROCR-Runtime commit: 6182abf5e9]
2020-11-21 21:39:49 -06:00
Konstantin Zhuravlyov ba667661c5 Implement Target ID Proposal
Changes from Konstantin Zhuravlyov, Tony Tye

Change-Id: I532801193afa9d5b8ac2a877b5497eab661f0597


[ROCm/ROCR-Runtime commit: 3a08d0964e]
2020-11-10 13:42:35 -05:00
Sean Keely 358c091a13 Remove references to finalizer header.
Change-Id: I6608c95268ab4bc66053d889cf7d5a30cd8fccab


[ROCm/ROCR-Runtime commit: e25ae1263b]
2020-04-17 23:50:23 -04:00
Ramesh Errabolu 1798d1386b Fix Aql Header initialization
Change-Id: If23c12b28d22fb62b673038890f40bb0f3c3948b


[ROCm/ROCR-Runtime commit: 086b4b686c]
2019-11-06 16:13:58 -05:00
Ramesh Errabolu 61b9d4e8b2 Update memory allocation guide in using pool apis
This is to allow allocations in system memory that exceed sizes
reported by a CPU device

Change-Id: I3d10d192aafcefbe4107f69b7c5e30bf7f836619


[ROCm/ROCR-Runtime commit: 3201f68f72]
2019-08-23 14:55:40 -04:00
Ramesh Errabolu 568620e42e Handle thread creation error correctly
Change-Id: Iaa8811e245aa20ac107aef104847df3e455518f1


[ROCm/ROCR-Runtime commit: 4a0d50f415]
2019-08-05 15:39:54 -04:00
Chris Freehill 9d70b6a420 rocrtst fixes for hsa_signal cleanup and aql packet dispatch
In several places aql packets were written to queue all at once
instead of doing the header atomically. These cases have been
fixed.

There were a few hsa_signal leaked that have been addressed.

There was some duplication of code that has been addressed.

Addresses ROCMOPS-456

Change-Id: Ia1869bc370f92e49ac560301df47741d5f76978e


[ROCm/ROCR-Runtime commit: 081a2cc875]
2019-06-21 17:34:10 -05:00
Sean Keely 904723af7c Fix IPC related hangs/faults in rocrtst.
IPC was failing due to calling fork when HSA was open.  The fix
was correcting incomplete cleanup in several other tests.

TestBase::Close (via CommonCleanUp) now checks that HSA is properly
closed between tests.

rocrtstPerf.Memory_Async_Copy uses hwloc which uses OpenCL which
has no shutdown routine.  Consequently this test can not cleanup
properly.  I added a hack to force HSA refcount to the value
it should have if OpenCL were cleaning up but this leaks resources
and potentially puts hwloc & OpenCL in a bad state.

OpenCL loads LLVM which installs some exit handlers.  Those handlers
can't execute in a child process and can't be removed since OpenCL
doesn't cleanup.  IPC hacks around this by aborting rather than exiting
in the child process.

Change-Id: I92326a73d7b11632208717d99728e6dafdc7d3ca


[ROCm/ROCR-Runtime commit: bb980462e7]
2019-06-19 01:03:52 -04:00
rohit pathania 189bd446b5 Modified memory atomics on non Large bar system and pool info test memcmp issue fix
Change-Id: I951fdb6c91508f43b1c51f7eb92870543fc58e53


[ROCm/ROCR-Runtime commit: d8e47ba115]
2018-06-11 18:49:29 +05:30
rohit pathania 32ffaeb7d1 Memory Concurrent tests for pool Memory allocate, Memory free and get pool info
Change-Id: I6a1343348e400fe466e041d651adaa67be561a21


[ROCm/ROCR-Runtime commit: 47af1d673e]
2018-05-14 01:30:54 -04:00
rohit pathania 72073d5f4a Resubmitted added and modified common utilities functions for rocrtest with faile to open file fix
Change-Id: Ie45668df1a15c1be7e8bdb10b967b98fb3024252


[ROCm/ROCR-Runtime commit: 7310312291]
2017-12-18 05:06:22 -04:00
Kent Russell 061789c3fd Revert "added and modified common utilities functions for rocrtest"
This reverts commit 4c4869bf50.

Change-Id: I825b210ce4fc831f8a978faf1c7d83d54408efa4


[ROCm/ROCR-Runtime commit: c3a880db7d]
2017-12-15 06:04:50 -05:00
rohit pathania 4c4869bf50 added and modified common utilities functions for rocrtest
Change-Id: I80afa33a46b3d95058be306869e7ed54b2b7df64


[ROCm/ROCR-Runtime commit: 7e46704abb]
2017-12-14 12:01:16 -05:00
Chris Freehill 05e78f7910 Make rocrtst use new rocm_smi library
Change-Id: Id688d6d6d5ff106a23f5b55eaca4e723c39433a3


[ROCm/ROCR-Runtime commit: 75eb3316aa]
2017-10-06 09:41:10 -05:00
Chris Freehill 55a09b6818 Fix build error in release version
Change-Id: I5b8378e4e771369ff2b2cc64ddfb44dde38d8d44


[ROCm/ROCR-Runtime commit: 3fa0b7e5b4]
2017-09-28 23:47:51 -04:00
Chris Freehill af02d06972 Async mem. copy test with NUMA awareness
Change-Id: If655ac4c087be2d379e868aad83812f2437d78b9


[ROCm/ROCR-Runtime commit: 92e46584f8]
2017-08-30 21:35:37 -04:00
Chris Freehill 90b3fee7f5 Remove dependency on hsa-runtime-tools
Change-Id: Ic4ce2bcbf1176e7eb859db39f21e7185691837e1


[ROCm/ROCR-Runtime commit: c85322d93d]
2017-08-17 15:39:35 -04:00
Chris Freehill aca0282c61 Clearer/more concise variable names
Change-Id: Ib92211977066b728f19b2a7fe40639160a8262b3


[ROCm/ROCR-Runtime commit: ab2248132a]
2017-08-01 10:38:26 -05:00
Chris Freehill 9aae431f6d Added max. single mem. allocation test.
Change-Id: Ie81c6af0502fde56225b1e197801cf04b474feb2


[ROCm/ROCR-Runtime commit: cf24f7bb78]
2017-07-31 12:04:55 -05:00
Chris Freehill 9443b47a53 Update tests to use rocm-smi
Change-Id: Ia4692019460f4ba42a12ecba1f9e59576561c73e


[ROCm/ROCR-Runtime commit: a055531eb4]
2017-07-28 08:34:27 -04:00
Chris Freehill 3e458ed991 Add rocm-smi c++ utility classes
Change-Id: I4362151abf84f89942bf2895b45fca498a28dfc9


[ROCm/ROCR-Runtime commit: 8424fd6f23]
2017-07-25 00:42:34 -04:00
Chris Freehill bcd0bd4e38 Added dispatch time, async copy and test template rocrtst tests
Change-Id: I57a844ee65c36bd61616ee6d60d358303f51db56


[ROCm/ROCR-Runtime commit: a12c5628ea]
2017-07-17 10:30:26 -05:00
Chris Freehill 9f1065771a Refactored performance test code
Commented and flattened binary search sample.

Change-Id: Ib783292207c956d16003195924a3bcfbbde5039f


[ROCm/ROCR-Runtime commit: 8161ebb915]
2017-05-11 14:45:45 -04:00