Gráfico de commits

2959 Commits

Autor SHA1 Mensaje Fecha
Shweta Khatri 4eb6ed7799 Using new KFD HSA extended coherent memory flag
Using new ExtendedCoherent KFD HSA memory flag to achieve system
scope coherence on atomic instructions. Non-compliant systems may
have the need to perform explicit HDP flushes to achieve system
scope coherence using this flag.

Change-Id: Ic6b47c0e97285086fa1f52bbfa4597b81cadafeb
2023-09-25 10:36:04 -04:00
David Yat Sin 8e06dce573 Add extended coherence memory flag
Add support for new flag for memory allocation that will provide
system-scope coherent atomics

Change-Id: I426d66223e8d2b570f69b4c0e61145ce9b2290d2
2023-09-22 11:03:00 -04:00
David Yat Sin 06eefdeb1b Use scope guards to release ref counts
Some negative tests can trigger C++ exceptions to be thrown, which
causes code to leave the ref counts in inconsistent state.

Change-Id: Ifa6d8be986941efcdf20d7ac8b86eb15a8fe9932
2023-09-20 15:08:52 -04:00
David Yat Sin dd61f54171 Fix hsa_amd_vmem_get_access to accept offset pointers
Modify hsa_amd_vmem_get_access to handle pointers that are within VA
range of an existing memory mapping

Change-Id: I9f806ec39f6e9a33da8d86dd65d9a472438fa8ed
2023-09-20 14:03:37 -04:00
David Yat Sin 22becfb1e8 Add query for Xnack enabled
Add system query for whether Xnack is enabled on a system.

Change-Id: I2832110e4f33f6a951d13acd06636442debf27ae
2023-09-19 00:25:30 +00:00
Jonathan Kim 986e82d677 kfdtest: temporarily exclude address watch testing
The debug address watch test will hang when running with the
entire KFD test.

Disable it for now.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I1d0479fa2717d2f398cc32e0605ca6dcc17ebcd5
2023-09-14 09:07:20 -04:00
Jonathan Kim 6b4365ae4c Set correct overrides settings for GangLeader functions
Silence warnings on more stringent compile checks for lack of override
declaration.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: Iaa54dfc3dd74f5ee55763cafbbcf2db73493bb21
2023-09-12 15:56:34 -04:00
Jonathan Kim fcec22716a Use camel case for KFDDBGTest shaders
Debug test shaders should use camel case and suffix *Isa to match other
test shader naming convention.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I64e14183ba1c7c9664b13a742a0e5683866e8223
2023-09-12 15:38:12 -04:00
David Yat Sin 9a127193a8 Pre-allocate memory for 16K signals
On busy systems, the memory allocation can take long duration and
increase calls to hsa_signal_create/hsa_amd_signal_create. This
mitigates this issue.

Change-Id: Ib7640273262ebc3dbf1f07049ce5da10b1d6b158
2023-09-11 13:08:28 -04:00
Ori Messinger 5f117f7608 kfdtest: Fix String NULL Check
MCPU const char * always returns true, so check the value instead.

Before: if (!MCPU) {
After: if (!*MCPU) {

Signed-off-by: Ori Messinger <Ori.Messinger@amd.com>
Change-Id: I414e091ca764095937311648c534351d6abf30e6
2023-09-08 16:36:01 -04:00
Jonathan Kim 6ec529fe68 kfdtest: temporarily exclude debug suspend queues test
For some reason, non-Ubuntu builds have some sort of memory
corruption when running this test, which affect subsequent running
tests.  Disable it for now.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I5f54ee4c63286a33c6948bc818aa1501c4a6751e
2023-09-08 12:12:13 -04:00
David Yat Sin 6ce1586def Update blit shaders for gfx94x
Change-Id: Ic8def71aa0c6ab9a9a758877a65ca6b5625e8f1e
2023-09-08 09:43:31 -04:00
Shweta Khatri 4e675ce730 Use LLVM compiler to build blit shaders
Generates shader bytecode stream in amd_blit_shaders_v2.h at build time

Change-Id: I5228ec5442a78d074fd85ca9cd7f7a156dd84da3
2023-09-08 09:42:29 -04:00
David Yat Sin 3ee6c9b0e2 Fix clang compile warnings
Change-Id: Iea9afc3d998a6c5db28af6c7b54939960b11ae95
2023-09-07 12:00:02 -04:00
David Yat Sin 4770b210f6 Fix for always returning 64 for cacheline size
Change-Id: I0e31d306a2e051ecb9ac019c4e6f5efa25eabba0
2023-08-31 13:50:49 +00:00
David Yat Sin 1e7b078628 Update interface version for virtual memory APIs
Change-Id: Ifbf1af08ee7aa4d55387ff9786f6a61b89b56f88
2023-08-30 17:01:13 -04:00
David Yat Sin 03f2f69d16 Increment HSA API table stepping on new APIs
Add compile time asserts to force incrementing API table STEP versions
each time a new function is added to each table. This is required for
profiler team to be able to add preprocessor macros to determine which
versions contain the new APIs.

Also incrementing the major versions to 2 to indicate new numbering
scheme.

Change-Id: I148a436a5ceab6be3906f8263b40ea9b07841577
2023-08-29 21:59:36 +00:00
Jonathan Kim f9e20c8a93 kfdtest: replace 0 initialized dbg structs with memset
Use memset to avoid general 0 set padding issues and ASAN compile issues
for debug tests.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I0a5aca5b7b631083599573b47f1ae87d5d0d5d71
2023-08-29 11:25:56 -04:00
Lang Yu 65ca3317f2 kfdtest: add blacklist for gfx1150 and gfx1151
Change-Id: If78840e57c2523696c620d28f4c4ffb004128c0c
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
2023-08-24 17:27:04 +08:00
Jonathan Kim cdd0728d9b Submit a minimum of 64 DWORDs for SDMA submissions for some GFX9 devices
Some GFX9 devices will drop commands if ring buffer submission is less
than 64 DWORDs.  Pad submission with a NOP head an trailing null
DWORDs in this case.

Change-Id: I850af490fb699f7efe8aef96d97c600a8e76516b
2023-08-23 13:36:29 -04:00
David Yat Sin 4317f8dece Fix memory pool ALLOC_REC_GRANULE query
Also changed enum value to leave gap between enums that only exist in
hsa_region_info_t and enums that exist in both hsa_amd_memory_pool_info_t

Change-Id: I8f9f31200de66648e9328e4203ab283068c993f0
2023-08-22 17:46:48 -04:00
David Yat Sin 7be305b83c Fix flags passed to thunk for address reserve
Fix flags passed to thunk when reserving address only

Change-Id: Ic91d4c3393cc6a2b98e6bc5ed3575d40fa5e1424
2023-08-22 14:01:49 -04:00
Jonathan Kim 132815bcfb Clean up SDMA ganging
We don't need to keep track of specific blit engines in gang for
submission anymore as ganging early exits on pending bytes.
So tidy up the fluff.

Change-Id: I77e80bf1ad8f561a03fff77bce33aa09d02760c6
2023-08-22 05:57:04 -04:00
Ranjith Ramakrishnan 65911e8368 Use memset for initializing variable sized array
In ASAN builds, the compiler used is clang. The initialization of
variable sized array using assignment operator is causing compilation
failure in ASAN builds. Used memset to fix the same.

Change-Id: I02aef3b99a6cad0cce3a378210a48732e07a88fb
2023-08-21 12:01:58 -07:00
Jonathan Kim a3f8085025 kfdtest: add trap on wave start and end test
Add test to catch trap on wave start or end override event.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: Icb57af64475fbd2d8a6c0af9a2ee5db5d1a169c6
2023-08-18 12:15:08 -04:00
Jonathan Kim 8311ca5bfa kfdtest: add address watch test
Address watch test will test read and write operations.
Test will also check if operation is precise if precise
address watch is available.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I7ef835790e26bf6345682755d7dd26a35853bcd5
2023-08-18 12:15:07 -04:00
Jonathan Kim 431dc8d403 kfdtest: Add ops for address watch test
Add wave launch override, set/clear address watch and precise memops
test.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: Ib405d5570cd304e02c2e76eca3593cbd9a5937d9
2023-08-18 12:11:48 -04:00
Jonathan Kim d4029a9492 kfdtest: add memory violation test
Add memory violation detection test.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I1b56f684682836fc84fbec713bd81c53bdd6d413
2023-08-18 12:11:48 -04:00
Jonathan Kim 6c5121faff kfdtest: allow toggle of dispatch privilege
For GFX11 debugger testing, waves require to start in non-priv mode for
some test cases, so allow tester to set this.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: Iee93fda926bfd336d51c79c086f1f75bc35b70e5
2023-08-18 12:09:07 -04:00
Jonathan Kim 8f21793a3e Fix SDMA ganging circular deadlock in oversubscription
When oversubscribing SDMA gangs, a circular deadlock can occur since
gang enqueue is staggered with respect to SDMA engine leader based
on source to destination.
As a result, an enqueued leader may be waiting on a gang item that is
waiting on another enqueued leader or gang item and so on.

To prevent this, first lock the submission to ensure dma status query
and submissions are atomic.  Once this is in place, be more stringent
with ganging in that all SDMA engines must be available in order to gang.

Finally, re-enable SDMA ganging by default.

Change-Id: I4511e3487db9d26475b5aece4897f10168cc5322
2023-08-17 08:49:09 -04:00
Jonathan Kim 4c74e47e91 Update D2D SDMA ganging for non-SPX modes
xGMI for compute partitioning in non-SPX modes does not have
a reported bandwith.
Fix it to at most 2 since each partition is either bounded
by the number of xGMI links or the number of available
SDMA contexts.

Change-Id: I09094bd7548d9eee6f039b0efe849838e5de166e
2023-08-17 07:25:08 -04:00
Jonathan Kim 30982ff6aa Bump the number of SDMA engines for gfx940
GFX940 can support up to 16 SDMA engines so bump it.

Change-Id: I41a95e66383036735712e317a57b239d84fcb78d
2023-08-17 07:25:08 -04:00
Jonathan Kim f8664e88e0 Break when finding ganged agent
There's no need to keep looking in the list once we find a ganged agent.

Change-Id: Ia0b9b484c88221a7966a814456942c19b1741978
2023-08-17 07:25:08 -04:00
David Yat Sin a20a0a5bac Temporarily disable SDMA ganging by default
SDMA ganging is causing some regressions with some applications hanging.
Temporarily disabling SDMA ganging by default until issue is fixed.

Change-Id: I65e172923a53a967df27b30d969ad5d215c4fa09
2023-08-15 23:17:34 +00:00
David Yat Sin 93401e3c8c Revert "Adding documentation for SDMA environment var"
This reverts commit a7ffddb265.

Replaced by commit 3b3f14c06e8a2fab717f0b82aba3c72d74bb9574.

Environment variables documented in:docs/environment_variables.md

Change-Id: I8da0d971eb98554b4bd1b884617a439f1b20ed5b
2023-08-10 09:55:42 -04:00
Ranjith Ramakrishnan 96c8bb11b1 Disable file reorg backward compatibility support by default
Change-Id: I157e05e52a1a61b86fa2fc6f29d31361a688fa10
2023-08-09 12:31:27 -04:00
Jonathan Kim d20f0bbb90 kfdtest: add suspend resume test
Add queue suspend and resume test.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I2ade721026cbb458a3597b7858a164e70fe05f4f
2023-08-09 09:26:46 -04:00
Jonathan Kim b0e84183c1 kfdtest: add snapshot operations
Add queue and devices snapshot operations.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I836884c9f3b65dd9e5e444d554d3eb87938e1634
2023-08-09 09:26:29 -04:00
Jonathan Kim 5a675921ea kfdtest: add suspend and resume queues operation
Add base debug operations to suspend and resume queues.
Routine will return the number of queues successfully
suspended or resumed.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I8f18317f70464b04231c5cf822e11d545ebfa02a
2023-08-09 09:26:09 -04:00
Jonathan Kim b77189cf83 kfdtest: add hit trap event test
Check that a jump to trap event can be picked up by the debugger.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: Iad5f87092f2b82d5018013bba548979122a9bd02
2023-08-08 16:01:23 -04:00
Jonathan Kim 97fc25bb8d kfdtest: add set exceptions enable base debug operation
Add set exceptions enabled debug option

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I6ee1769bbbb90a74074d8100974c4bfeabaf7f2c
2023-08-08 16:01:03 -04:00
Jonathan Kim 097ee967d1 kfdtest: add runtime enable and attach test
Add debug attach and runtime enable test for attaching to a spawned and
running process.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I72302ff73494d9dae0c79a299508085d7ca0552b
2023-08-08 16:00:44 -04:00
Jonathan Kim bfb0d15ee8 kfdtest: add query operations
Add polling query debug event operation.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: Ic82ce4a393bfb28c9f32e7920f80c12da7f627d5
2023-08-08 16:00:25 -04:00
Jonathan Kim c7129edcb8 kfdtest: add send exception operation
Add send exception operation.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: Iecb43004a1a7ffc75e94badf203cd0927ffe0909
2023-08-08 16:00:04 -04:00
Jonathan Kim dd56b38c2f kfdtest: add base debug class and debug attach/detach operation
Add base debug class and attach/detach operations.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I60f3c166646f05838fec208ac2f59bba998c63f8
2023-08-08 15:59:35 -04:00
Ranjith Ramakrishnan bb4756d2e0 Disable file reorg backward compatibility support by default
Change-Id: Ib53a4d0476ec598025d4f1f98414e0e425bb0e49
2023-08-07 09:38:12 -07:00
David Yat Sin 66b66e42cd Keep libdrm device_handle on older libdrm
Even if the version of libdrm older and does not support the
amdgpu_device_get_fd function, the device_handle stored in
amdgpu_handle[] is still valid and can be returned via
hsaKmtGetAMDGPUDeviceHandle.

Change-Id: I024a3e82e6cfebac5577aefe359b067746c4023e
2023-08-01 10:52:26 -04:00
David Yat Sin 93aff0b439 Fix compile error when using clang
Fix compile error due to arithmetic on void*
Fix some compile warnings

Change-Id: I03ded438c5af77ba61c0a7017be5d4fe1e16c16c
2023-07-31 18:29:19 +00:00
Jonathan Kim 7df0167821 Enable D2D SDMA Ganging over xGMI
Use all available SDMA engines capped by xGMI bandwith for
all D2D copies within a hive.

By default, set the latency boundary copy size as 4KB and below.
Any copy size in within this boundary will not gang.

Avoid oversubscribing engines by not ganging on engines with
pending non-ganged work.

An enviroment variable HSA_ENABLE_SDMA_GANG has been provided
to override default ganging behaviour.

Change-Id: Iccde76aa1af1d47ea2a151789432c9db4f0ffa8d
2023-07-27 08:58:26 -04:00
Jonathan Kim c5dbb93e59 Silence parenthesis warnings in mem API
Fix KFD version checking parenthesis warnings on compile.

Change-Id: I89c46ea84a8d75b761d8c40ff62d008c7afbef2d
2023-07-26 16:14:40 -04:00