Commit Graph

217 Commits

Author SHA1 Message Date
Kent Russell 323bab0734 kfdtest: Quote all CXX flags
Otherwise it doesn't play nicely with -O2
Change-Id: I2e5b60c73ee1ec668b186088a4e2e3a03af65033
2020-12-24 10:32:01 -08:00
Kent Russell 92ad039915 kfdtest: Add sanitizer flags after C flags are set
Otherwise they get overwritten

Change-Id: I9042422d4515e7ac812ed34779906b0b2c44545c
2020-12-24 10:32:01 -08:00
Kent Russell f6f47aa43d Remove address-sanitizer debug messages
Change-Id: I08509aaed36459329f0a65264e42f287c27f4a18
2020-12-24 10:32:01 -08:00
Kent Russell 9cca1216e9 kfdtest: Support address sanitizer in KFDTest
Change-Id: Iee1182608ddc9896c82feb5004b3fe078d3d3223
2020-12-24 10:32:01 -08:00
Yifan Zhang 742f718722 kfdtest: Take vram size into account when calculate buffer number.
Vram size is relatively smaller in APU, e.g. 512MB.
Current MMBench doesn't support small vram system.
Running MMBench may have below errors:

[ RUN      ] KFDMemoryTest.MMBench
[          ] Found VRAM of 512MB.
[          ] Test (avg. ns)        alloc   mapOne  umapOne   mapAll  umapAll     free
[          ] --------------------------------------------------------------------------
[          ]   4K-SysMem-noSDMA         4569    20098     1292    18835      926     2218
[          ]  64K-SysMem-noSDMA        12738    20469     1030    19201     1293     4560
[          ]   2M-SysMem-noSDMA       256384    21020     1022    20568     1196    36294
[          ]  32M-SysMem-noSDMA      4031812    83750     5406    61156     4312   535656
[          ]   1G-SysMem-noSDMA    129260000   427000    34000   390000    30000 18548000
[          ] --------------------------------------------------------------------------
[          ]   4K-VRAM-noSDMA         3594    19637      979    19624     1357     2829
[          ]  64K-VRAM-noSDMA         3540    21062     1407    19614     1654     3024
/home/foreman/build/hsakmt-roct-amdgpu-1.0.9/sources/libhsakmt/tests/kfdtest/src/KFDMemoryTest.cpp:1119: Failure
Value of: (hsaKmtAllocMemory(allocNode, bufSize, memFlags, &bufs[i]))
  Actual: 6
Expected: HSAKMT_STATUS_SUCCESS
Which is: 0
[  FAILED  ] KFDMemoryTest.MMBench (723 ms)

Fix this issue by changing buffer number calculation in MMBench.

Change-Id: I5cce95707a048248f1e825c807586818619eddaf
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
2020-12-17 07:41:24 -05:00
Chengming Gui 3ed8b96bf0 kfdtest: remove unsupported modifier 'offset'
fix 
v2: fix VGPR conflict
v3: use s_addc_u32 to replace s_add_u32

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: I8fe6bf1f5bf99544038ad16128c2bebd559d3da9
2020-12-14 17:29:13 +08:00
changzhu 39386c03bf Add distinguish for iommuv2/dgpu_fallback when getting gpuName
The memory tests between iommuv2 and dgpu_fallback are different.So it
needs to ditinguish them.

Change-Id: Icc64e9ae0fc1638c3d148795a5f247d9e5e8e503
Signed-off-by: changzhu <Changfeng.Zhu@amd.com>
2020-12-04 02:24:49 -05:00
Philip Cox 4bbfbe7789 kfdtest: increase default timeout to 10,000
The default kfdtest timeout is not enough for certain platforms, and
tests are failing.

Change-Id: I2027eadcbeb12a2fbbc9c55f92f31869fa13dbcb
Signed-off-by: Philip Cox <Philip.Cox@amd.com>
2020-11-27 15:06:41 -05:00
Gang Ba 8e94dde685 kfdtest: check peer accessible with new function
check GPU peer accessible with p2p_links in system

Signed-off-by: Gang Ba <gaba@amd.com>
Change-Id: I026f16564303b687811d6648f0b7f84be6819979
2020-11-26 10:34:06 -05:00
Kent Russell 2651ce37d8 Look in /opt/rocm* for SMI for setting clocks to high
Now that symlinks aren't necessarily guaranteed, use "find" to try to
find the rocm-smi, and clarify the error message if it is not found

Also tie in a fix for parsing the output now that the output has changed

Change-Id: I2081442a71731c186c3ad00585a2ba6e8a8e5a28
2020-11-23 14:05:10 -05:00
Chengming Gui f283fe2854 kfdtest: update shader code for gfx10.3 kfdtest
s_store_* instruction set was retired from gfx10.3

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: Ibe41a3fe7e053fb345b1af6ad4abc22a0885bc81
2020-11-03 22:25:39 -05:00
Jeremy Newton 8026ba250c kfdtest: Use ldflags for drm
This fixes a build issue with kfdtest and the amdgpu pro driver build.

This was requested as kfdtest is needed for regular testing due to the
inclusion of the ROCr/KFD stack in the amdgpu pro driver (OSGSUP-199)

Change-Id: I224d2e9ee3f02065596890b4d8226484f4fac04f
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
2020-11-02 16:46:45 -05:00
Kent Russell e34dfa8ebd kfdtest: Fix bit compare logic by using | instead of ||
We want to compare bits, not check if a defined value is true

Change-Id: Ie51ede96d18eae01aff6677d852a056ee12bd9c6
2020-11-02 06:03:59 -05:00
Kent Russell 761d9d84d2 kfdtest: Add missing default switch label in GetQueue function
There is no default case, and we were missing a few types defined from
hsakmttypes.h. This was found via clang

Change-Id: I26193cb111a9d8220b1eff21c7313fe060288f36
2020-11-02 06:03:59 -05:00
Chengming Gui 4a9d55c414 kfdtest: Add gfx1032 support
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: I04cd412a5e243dfe7aa7596287341e1671c1521a
2020-10-12 11:30:39 +08:00
Chengming Gui befc7edaea kfdtest: fix MTYPE error when init sdma fence packet
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: I14a1ef204dbd5ab1e9f1840b9555f88b0df361c0
2020-09-21 03:57:12 -04:00
Jinzhou.Su 7efa823ec8 kfdtest: fix gfx90c blacklist issue
This patch is the hot fix to update gfx90c blacklist 

Change-Id: I41f48154ad5ec3035fcb7891a224fc940dca991f
2020-09-16 09:42:01 +08:00
Jinzhou.Su 36249ddc0e kfdtest:Update gfx90c blacklist
1. Add KFDEvictTest.* for gfx90c based on CI test results

2. Remove SDMA blacklist based on SDMA issue fixed:

Change-Id: I86910fc98a5141f29959b35248a900f0c098a6e8
2020-09-14 22:49:53 -04:00
Jinzhou.Su a69830917f kfdtest: remove test cases on gfx90c which block IQE test
SDMA_BLACKLIST, KFDMemoryTest.LargestSysBufferTest,
KFDQMTest.BasicCuMaskingEven

Change-Id: Ic603452ede5ef14f5fcb49925d57d3a656d48a08
Signed-off-by: Jinzhou.Su <Jinzhou.Su@amd.com>
2020-08-19 10:20:24 +08:00
Chengming Gui 72294266c2 kfdtest: Add gfx1031 support
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: I3806ec33eefd84ff1dd690dd142889e076b7ef43
2020-07-28 18:02:51 -04:00
Yong Zhao 76a6781c2d kfdtest: Add gfx1030 support
Change-Id: I5fd0d9af09cbefc0acbe24397a7e2f3aa14a7c97
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-07-07 18:09:56 -04:00
Eric Huang 0003b6d147 kfdtest: change shader command to avoid compile error for gfx90a
Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I531ebac162403cc957802bbcdb34cdc022be3a50
2020-06-17 10:15:12 -04:00
Ori Messinger 46f5e83066 Create KFDTest for SDMA Fault
The purpose of this KFDTest is to investigate the behaviour of an
SDMA queue when an invalid memory address is used.

v2: Don't wait for SDMA queue to finish - it won't finish because of
the gpuvm fault.

v3: Create kfd event before SDMA queue submission. This fix the issue
that gpuvm fault happens earlier than kfd event is created then KFD
exception handler can't find the kfd event (to wake up kfd test)

v4: Instead of using 0x12345678 as the invalid VA, map one page of
FB to gpu and unmap it. Use the mapped GPUVA as the
invalid address

Change-Id: I58af1511f75d869adddede302b238c2725f3fe5a
Signed-off-by: Ori Messinger <Ori.Messinger@amd.com>
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2020-05-11 18:52:35 -04:00
Kent Russell dc784ba482 Fix HostAccess flags for XGMI configs in P2PTest
We need HostAccess for large-bar XGMI configs for this test,
but we can't use it on small-bar XGMI configs, so deal with it
appropriately

Change-Id: Ic16b810de03adfc63de21a00c55e5f3ea1ce66d1
2020-05-11 11:12:33 -04:00
Jonathan Kim af249159ee kfdtest: do not request host accessible memory for P2P tests
Do not request host accessible memory otherwise small-bar XGMI fails.

Change-Id: I6b1e750839ae66a34c85405fa8d0a4aa455399ef
Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
2020-04-17 23:42:10 -04:00
Felix Kuehling 8ee763d94a kfdtest: Fix problems finding kfdtest.exclude
When running run_kfdtest.sh through a wrapper script that sources
run_kfdtest.sh, kfdtest.exclude isn't found because $0 points to the
location of the wrapper script. User $BASH_SOURCE instead of $0 to
find the location of the correct run_kfdtest.sh script.

Change-Id: I0ae7899e527e6d98bb8651197484e5ee03a5fd7b
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-04-16 18:23:33 -04:00
Kent Russell 7ee9e01587 KFDTest: Use SMI for HIGH clocks, if possible
Some systems don't support coarse-grained DPM, so performance level will
fail. Remove the compute_utils.sh references, and just use the SMI if we
request clocks be high, without throwing errors if it fails.

Change-Id: Ic5beda9921128be36ac2d58cae3f0608618a8e21
2020-04-16 07:59:33 -04:00
Divya Shikre 96259b5830 kfdtest: Provide Unique ID information.
Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: I9a837a3d1ab38f5ad05673406874d862c9e97541
2020-03-18 15:55:59 -04:00
Yong Zhao 4e7b2f2e27 kfdtest: Print a message when there is no GPU
This helps the user to troubleshoot the problem.

Change-Id: If6cf42c488097011285252a6c722d3d74c0f7ce7
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-03-04 15:00:47 -05:00
Yong Zhao 0e5c4d83e6 kfdtest: Delete MULTI_GPU usage in run_kfdtest.sh
It is obsolete.

Change-Id: Ifd137ce1ce8d9133cfa5c8bfd46aaeea461b5aa7
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-03-04 15:00:47 -05:00
Yong Zhao 7a852be42e kfdtest: Clean up KFDEvictTest
Move the shader code before the test case code so that all test case
code is consecutive.

Rectify the print messages and avoid calling GetSysMemSize() repeatedly.

Change-Id: I1c4aa5552de4d74163717fe66ad9759fb09e1316
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-02-13 15:42:04 -05:00
Yong Zhao 21cda69ba9 kfdtest: Adapt the CWSR test for emulators
The original test takes forever to run on emulators because emulators
are much slower than Asic. So intelligently detect the emulator scenarios
and reduce the run time by slashing the iteration times.

Change-Id: I087f43c04c2b23b5ab2ecaad07533b767c337e94
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-02-13 11:35:37 -05:00
Kent Russell 0d4c209552 Remove RegisterForeignDeviceMem test code
Use an "if 0" to remove the code, as it is not working as expected. The
test is supposed to test mapping from a foreign device (like a NIC), so
it uses a separate GPU to map, but this mapping can be evicted and thus
the test can fail unexpectedly. Remove the code until the test can be
reworked

Change-Id: Ie4a15c2a018bbd8e931b06b6700d10b3be86e410
2020-02-13 10:04:01 -05:00
Kent Russell a360c68b0c Add DEB/RPM packaging for KFDTest
This will allow it to be installed with the ROCm suite,
and centralize things a little bit more
Also update run_kfdtest.sh to reflect the changes
Lastly, remove "die" reference as compute_utils.sh
may not be packaged with KFDTest

Change-Id: I4c30cd29979192496419e71e3685937d7417f739
2020-02-11 13:53:09 -05:00
Felix Kuehling 6b8095184f kfdtest: List source files explicitly
Tests run in the order in which they are linked. Currently that order
is non-deterministic. Listing source files in the Makefile explicitly
makes the order deterministic.

The order chosen runs basic tests before more advanced tests before
stress tests.

Change-Id: I5bc032bcd589f92a51db36acb518bb4d8ef778d3
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-02-05 14:34:53 -05:00
Yong Zhao 4f2ff25a3d kfdtest: Enable some tests on gfx1xxx series
Those tests are currently all passing.

Change-Id: I233afe33e8275d482bab5b5590b856fce49af76d
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-01-29 21:23:05 -05:00
Eric Huang 634b30119a kfdtest: fix infinite loop in sdma multicopy
when variable interval become zero, the loop of while (timeConsumption >= interval)
will be a infinite loop. The fix is to avoid that case.

Change-Id: I8fd07296925300bace5ab7d3da86482b6d8b0d03
Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>
2020-01-23 14:54:23 -05:00
Felix Kuehling 87e10cd0b4 libhsakmt: Improve error handling in child process
Check for errno == EBADF in kmtIoctl to detect misuse of the kfd_fd
in a forked child process.

Detect being in a forked child process pro-actively by implementing
a pthread_atfork callback.

Make sure all mutexes get reinitialized in the child process to avoid
deadlocks.

Check for being in a forked child process in CHECK_KFD_OPENED so that
all hsaKmt functions will return the appropriate status
HSAKMT_STATUS_KERNEL_IO_CHANNEL_NOT_OPENED.

Update InvalidKFDHandleTest to expect that error code.

Change-Id: I0238e5fba344dcaa454e97a35db2e2dcc8d1f607
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-01-20 18:01:21 -05:00
Yong Zhao fe97612800 kfdtest: Add basic tests for XGMI SDMA queues
After XGMI SDMA queues were separated from regular SDMA queues, they
were not covered in the current tests. Add tests for them now.

Change-Id: I036e3ca5d583ab7f022a9dc6cda3ef867f4773a0
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-01-10 15:32:12 -05:00
Srinivasan Subramanian 5c2fc61d95 Use runpath instead of rpath for libraries
enable-new-dtags option is added

Change-Id: I1f406b3f30ddc6491aad3ef7a84dfd415917b1aa
Signed-off-by: Freddy Paul <Freddy.paul@amd.com>
2020-01-09 18:05:57 -05:00
Pruthvi Madugundu 3f8a07e460 support installtion of multiple ROCM version
Changes to resolve
1) Multiple rocm release installation support
2) Multiple rocm shared lib conflicts

Change-Id: I792feb36cdf4516d108f1ef71abe0c87522f018a
Signed-off-by: Pruthvi Madugundu <pruthvi.madugundu@amd.com>
Signed-off-by: Freddy Paul <Freddy.paul@amd.com>
2020-01-09 18:05:24 -05:00
Yong Zhao 2b70d73f68 kfdtest: Improve the stablility of SignalHandling test
On gfx1012, allocating 1/4 of the system memory on a 32G RAM machine
could fail, resulting in this test to fail. Limit the maximum buffer
to allocate to be smaller than 3G to accommodate this situation.

Change-Id: I38b0a0f7da1f0b9ca851e04d2d0a51767858c801
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-01-07 17:28:57 -05:00
Oak Zeng 38b429fd52 Fix GWS test function call parameter issue
Change-Id: I3f4fde9ec8268362cffecb2d95177913b583486f
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2020-01-06 08:11:49 -05:00
Huang Rui 06464b917d libhsakmt: add NumCpQueues and NumSdmaQueuesPerEngine data field (v3)
NumCpQueues and NumSdmaQueuesPerEngine should be got by kfd driver not hardcode.
So add two data fields in HsaNodeProperties then thunk is able to get it from sysfs
that exposed by kfd.

v2: change NumCpQueues/NumSdmaQueuesPerEngine to one byte.
v3: merge two commits as one to avoid ABI update two times.

Change-Id: Ie386e4685f13493e22db6e207a399db6a4c5b9dc
Signed-off-by: Huang Rui <ray.huang@amd.com>
2020-01-03 23:27:42 -05:00
Oak Zeng af7feb93db Add KFD GWS test
Change-Id: Ie90d9119da6cee41ddab10deb427d4ae9fd9a16b
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2020-01-03 15:19:56 -05:00
Yong Zhao facb6c056d kfdtest: Rework the shader used for CWSR test
The shader supports multiple work items. It also eliminates one input buffer.

Change-Id: If0596b306065980b74fb92613e95610defc00164
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-01-02 16:05:01 -05:00
Yong Zhao 44db5cb011 kfdtest: Enable KFDExceptionTest on gfx906 and gfx1xxx series
KFDExceptionTest on those platform is passing.

Change-Id: I328ee4fd4ff5b339e560f2f79e754fd34459210a
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2019-12-18 17:48:16 -05:00
Kent Russell 8b14ea2e83 kfdtest.exclude: Remove BasicCuMaskingEven from gfx908
The initial baseline measurements are proving inconsistent, which
results in the test failing more often with different variant rates

Change-Id: I1f4e04bf7d615cf39de9605bd5141a997b22cdfc
2019-12-18 14:24:53 -05:00
Yong Zhao f7c0172385 kfdtest: Rename two exception test cases
The old names are not accurate enough and we rename them according to
their corresponding fault types.

Change-Id: Icf4d52ba0ab9d49af5d912a0feb82665b1e8d344
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2019-12-17 19:46:33 -05:00
Yong Zhao 1c2c5a7b9a kfdtest: Delete two useless exception tests
The InvalidPPR* tests are only useful for gfx801 right now, on which
they won't trigger exceptions. So they are not relevent in the
KFDExceptionTest category. In addition, given AccessPPRMem already tests
the PPR memory functionality, we can just delete those two tests.

Change-Id: Id5c6e23c4c0ce47a4f04e9e1f0fa9083e0a9d0e0
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2019-12-17 19:37:14 -05:00