Граф коммитов

2959 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kim 1ce548829b libhsakmt: add runtime enable and disable calls
Add hsaKmtRuntimeEnable and disable.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Change-Id: I083f9293948e975546a1b3c1334cb41499b9ab1f
2021-07-16 18:37:41 -04:00
Jonathan Kim 31ac82617c libhsakmt: update thunk api for exception handling
The debugger and debug agent no longer use the Thunk API.
Remove all deprecated functions and keep commented
references for future KFD tests.

Update and the keep the version checks for future use
and hsaKmtRuntimeEnable/Disable.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Signed-off-by: Laurent Morichetti <laurent.morichetti@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Change-Id: Ia2f10d82f5ac36d0bd1bda233810f26e8a154d55
2021-07-16 18:36:18 -04:00
Jonathan Kim 96c7a5c9dc libhsakmt: update create queue for exception handling
Update hsaKmtCreateQueue to initialize the new save area header with the
exception payload and event ID.

Signed-by-off: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Sean Keely <sean.keely@amd.com>
Change-Id: Icd38062dc982cb29b30644699014eeb0b3e26d00
2021-07-16 18:34:35 -04:00
Felix Kuehling 5fac7dcc3b libhsakmt: Fix deadlocks in __fmm_release
__fmm_release is sometimes called with the aperture lock, and sometimes
without. Consistently call it with the aperture lock held and remove the
lock/unlock calls from this function.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: I80dddc64cc0703e5eed8e9f1eb65b75a2c7ae2eb
2021-07-12 18:27:55 -04:00
Felix Kuehling 19536080a8 libhsakmt: Fix deadlock in map_mmio
Unlock mutex if MMIO mapping fails. This happens on all GFXv8 GPUs.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: I1dee1cbddefd9185c24ea79377f49f8ae2c5ff57
2021-07-09 17:07:42 -04:00
Kent Russell bdfe3a12a8 kfdtest: Ensure devices are peer-accessible for peer mapping
If the devices aren't peer-accessible, we shouldn't try to run a test
that requires that the devices be peer-accessible. Thus, add a check in
MapVramToGPUNodesTest to check for peer accessibility before executing
the peer mappings.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: Ib79b141f8c1ac6d85f5ab49d62af62ec10b988b7
2021-07-09 15:45:01 -04:00
Philip Yang 92076f6f1b kfdtest: add KFDMemoryTest MultiThreadRegisterUserptrTest
Test Thunk multiple threads register and deregister same userptr race
condition, to emulate application register same userptr to multiple
GPUs using multiple threads.

Use thread barrier to sync the threads, to start register userptr at
same time.



Change-Id: I6723dc39f75908026fa14a490e39e1fe49a13a1b
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-07-07 17:52:31 -04:00
Aaron Liu ef9c532187 kfdtest: add yellow_carp blacklist
Signed-off-by: Chen Gong <curry.gong@amd.com>
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: Ib3a3172b0ac40109acbe42b9dc92517b3fedc84c
2021-07-07 09:47:05 +08:00
Aaron Liu a55551309c libhsakmt: add yellow carp support
This patch is to add yellow carp support on thunk.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: Icfecc3fd1f472c9924f934c6a5352448356d83df
2021-07-06 21:46:28 -04:00
Aaron Liu fd131e875e kfdtest: MigrateLargeBufTest support APU
Limit test buffer size to 3/4 total VRAM size, and max 1GB.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: I937e10b0a6bd8215e3865b50f22ce75b3982a6f7
2021-07-06 21:44:23 -04:00
Kent Russell b2fb2a3470 kfdtest.exclude: Add NV12 blacklist
Add a blacklist for gfx1xxx12, using the same list as gfx1012

Change-Id: I7e620dba8a36f6f89152a48066234884150a15dd
2021-07-06 11:58:53 -04:00
Sean Keely 408fca0278 Add error message to assertion.
Warn that HSA_FORCE_ASIC_TYPE may be needed if the engine major id
assertion fails.

Change-Id: I67e01e99c3d1bdc84630ccfae489dce5e77961b5
2021-06-28 23:18:43 -04:00
changzhu 1a9604ad57 kfdtest: skip KFDSVMRangeTest.MigrateAccessInPlaceTest for gfx902 and gfx90c
Change-Id: I671440c212a07fdfdb1c4245b4551c6344eaedc6
Signed-off-by: changzhu <Changfeng.Zhu@amd.com>
2021-06-28 13:37:52 +08:00
Philip Yang c4d5ee28f0 libhsakmt: fix multiple threads register userptr race
Aperture locking is too fine-grained, it has race between find userptr
and allocate userptr object.

Change _fmm_allocate_device and fmm_allocate_memory_object to not take
the aperture lock, the callers take it, this implements an atomic find
userptr or allocate a new one.



Change-Id: I6773404e22c1f4382a211c5a9817df23c5534a2a
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-06-25 14:16:20 -04:00
Sean Keely 3d6a18b67c Always execute the first satisfied async signal handler.
Certain special signals do not carry their updates via their signal
value.  These signals are wrappers around special KFD events, of
which the only current instance informs about VM faults.  We either
need to check each signal for this special event type or rely on
the checking done in hsa_amd_signal_wait_any.  Since there will always
be a small number of these signals it doesn't make much since to
penalize the performance path with this check.  Additionally we know
that the signal indicated by hsa_amd_signal_wait_any is satisfied so
don't need to recheck it's conditions.

Change-Id: I9fc6298300ad543d823ecd28ca8fab4ad26c23ef
2021-06-24 02:45:31 -05:00
Sean Keely 26808295f8 Correct clang build error.
Clang now warns about set but unused variables.  It also now
recognizes -Wno-error=unused-but-set-variable so this patch moves
that option back to the general options list.

Change-Id: Id800e87eb688b9441b14380e2246ad586179f31a
2021-06-23 15:04:58 -05:00
Sean Keely 74bcd6ee90 Locate kernel directory from device name.
Search child directories when locating device code.

Change-Id: I51515f002ad60878a2be0b6e9ee6416c67a1d799
2021-06-17 22:57:21 -04:00
Kent Russell 5796225011 kfdtest: Remove EvictTest.BasicTest from gfx906
This is causing PSDB/OSDB failures so disable it until investigation is
done

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I666cd45fdf8ae585486adc7cf43eacd1700704bb
2021-06-17 17:07:22 -04:00
Sean Keely 9e53cab613 Add agent info query for HSA_AMD_AGENT_INFO_SVM_DIRECT_HOST_ACCESS.
Allows determining if the host can directly access HMM memory that
is physically resident in vram.

Change-Id: Ie452eedd0e27fe1b511afd416f5a1cd01b3d84e8
2021-06-17 03:45:26 -04:00
Philip Yang 351a41ac76 kfdtest: add KFDSVMRangeTest MigrateAccessInPlaceTest
To test ACCESS_IN_PLACE GPU mapping update to system memory.

Change-Id: I5b990215f39692e829128d848125e1ae0d571e03
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-06-14 11:03:09 -04:00
Alex Sierra f85b428265 libhsakmt: move CoherentHostAccess prop to HSA_CAPABILITY
CoherentHostAccess flag member moved from HSA_MEMORYPROPERTY
to HSA_CAPABILITY struct. Now this is reported to the
topology as a capability of the device instead of a device
memory property.

Change-Id: I48e43e4b4a0635b711b62933734587facdfbf88b
Signed-off-by: Alex Sierra <alex.sierra@amd.com>
2021-06-10 22:21:17 -05:00
Sean Keely 8adbda1c18 Allocate any size vram request through the fragment allocator.
Enables the fragment allocator to handle >2MB allocations, maintaining
good TLB alignment.  Prior code contained a bug that caused the effective
API granule for vram allocations >2MB to be bumped to 2MB.

Also adjusts the block cache's block retention heuristic to not
count discarded blocks as in use.  This will reduce block retention
when a significant amount of large blocks or IPC is in use.

Change-Id: I30bd85eb87951df822211f799d9cfe579ab109c6
2021-06-10 19:30:54 -05:00
Sean Keely 981c6bd8c3 Remove unused GpuAgent.local_region_ member.
Change-Id: I99526e6b1f64e810f7fed5d922c540d252a46d80
2021-06-07 19:59:58 -04:00
Sean Keely bd59789f0b Add debugging checks for packet type in the scratch handler.
Change-Id: I84a6f18548ac39349595e3a1c8a5a9ff27d4e178
2021-06-07 15:36:18 -04:00
Yifan Zhang c24ed10dfa libhsakmt: add colon after KFDQMTest.SdmaConcurrentCopies
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: Ief14e513e4b09db0607f5533a55f80d3b0be017e
2021-06-07 18:21:59 +08:00
Yifan Zhang e72be0e54d kfdtest: Temporarily blacklist some svm related test cases for gfx902.
move blacklisted test case from gfx902 iommuv2 to dgpu path.

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: I8b101226ca8dcd0c12c484f5f6ce12fe73a75bdc
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
(cherry picked from commit 9cf4377572321396225950b9a58beb549120c2a3)
2021-06-06 23:07:29 -04:00
Sean Keely 3323e18f3e Limit reporting of GPU_ONLY signal waits from host.
Such waits must spin but are functionally correct.

Change-Id: I4992852f04da788495c6f566c46a3dffaf38397c
2021-06-03 15:26:40 -05:00
Sean Keely ca8387768e Allow limiting debug warning messages.
Add macro debug_warning_n to stop printing a message after
N instances.

Change-Id: Id5f84b11eb63b3a20bd2bcb2ea8f10a066b457ef
2021-06-03 15:25:55 -05:00
Sean Keely 6b398eb72c Improve async handler performance.
Under high async handler load signal retention and event sorting
become bottlenecks.  This change processes more handlers in a
single pass to amortize wait_any overheads.

Change-Id: I8b276e102db647e3858e120547aa0c6fca85ab4c
2021-06-02 23:52:07 -05:00
Sean Keely f6c2aa1c78 Add Read Mostly attribute support.
Change-Id: Ia7c60edacb892cbf14bdb50350c0a0a627e53964
2021-06-01 23:39:12 -05:00
Alex Sierra 973b35bc06 libhsakmt: change memory allocation alignment
it is to optimize memory allocation latency, which
changes alignment from 2MB to 1GB.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I7818e9f13b17e2c0992e75b17f978dc03a018a57
2021-06-01 11:33:16 -04:00
Sean Keely 7361fc18ee Recognize gfx1034 in image device family id.
Change-Id: I2a529b5e91fae9f3697ddbccaaf0e97c87d59837
2021-05-25 16:43:20 -05:00
Chris Freehill 8cb686fdc5 Add gfx1034 support
Change-Id: I2d4bfcb9012704daf7de10739c966827bd2a09e2
2021-05-25 16:43:16 -05:00
Harish Kasiviswanathan e28b3fe8b3 libhsakmt: Handle unaccessible p2p_links
Device cgroup can limit accessible devices. Handle the cases where
p2p_links are not accessible



Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I513dc75ad14e4f2d426cf2fbd301bcba12b4ee54
2021-05-25 12:01:44 -04:00
Yifan Zhang 9e0fc7f3c6 kfdtest: Temporarily blacklist some svm related test cases.
blacklist some svm related test cases until they are solved.

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: I05e2d965d89bcbf3d43bed2873297e98ad0738ef
2021-05-24 22:06:53 -04:00
changzhu 55cb03dbae kfdtest: skip KFDLocalMemoryTest.AccessLocalMem if not on dgpu path
It needs to skip LocalMemoryTest because it doesn't support local memory
with no dgpu path.

Change-Id: Iedb6f6deba55e239b21747d933cf2d7005623106
Signed-off-by: changzhu <Changfeng.Zhu@amd.com>
2021-05-19 11:33:08 -04:00
Mike (Tianxin) Li 36c54c63f7 Revert "Get the size of VGPR and SGPR register file"
This reverts commit 344ed757e0.

Change-Id: I9988218ad1d2b6182d92aad09d18a95e77e46c01
2021-05-18 15:01:30 -04:00
Chengming Gui b8ef20e35c kfdtest: Temp disable all shader test related cases due to sp3 compiler update
The updated sp3 compiler does not support GFX10 temperaly.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: Idd9336663814b7925d9742eee0bd310d00945d3e
2021-05-18 02:04:55 -04:00
Chengming Gui f28dbdf7bf kfdtest: Add Beige_Goby support
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: I3c9d4f8af1dbb4fd7ce7ff238426a4af61fd771f
2021-05-18 02:04:25 -04:00
Chengming Gui ce995fe48d libhsakmt: Prepare Beige_goby support
PCI IDs have yet to be added later.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: Ia0cbda17469b13fca807ce4eb74deae6f0d1eeac
2021-05-18 02:04:06 -04:00
Philip Yang 86a68b2774 kfdtest: Remove KFDSVMEvictTest.QueueTest GFX9 assembler meta
Fixes assembler error. The SP3 backend if already set to FamilyId.

Change-Id: I7721a555b05688b16993a03242a765694594825a
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-05-14 10:44:30 -04:00
Mike Li 344ed757e0 Get the size of VGPR and SGPR register file
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: Ifa515ad7e1df1dd27f25f1e919b0053049531063
2021-05-13 11:54:41 -04:00
Kent Russell 9168dfe041 kfdtest: Increase timeout in EvictTest
Increasing the timeout will avoid some test failures. This shouldn't
mask any issues as any incomplete shaders should still hang and would
just time out at 180 sec instead of 120 sec.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: If4e893ab80d9d159bd0b8b112aa7574abc5e4f44
2021-05-12 14:06:03 -04:00
Sean Keely 5f0e39df63 Update README.md
Remove reference to finalizer and images libs.

Change-Id: Ic673da77bb13dea77b477d7bfe799fc2c028ab2a
2021-05-10 17:53:19 -05:00
Sean Keely 0439dc90cd Correct merge error.
Old memory properties info name used after removing branches.
This caused the CPU coarse grain pool to initialize with random
bits.

Change-Id: I397bc5ecf09fab69bdf1d7fafadcf54d71b64070
2021-05-06 18:40:56 -05:00
Sean Keely c9ce27a640 Add exception forwarding to tools API callbacks.
Prevents poorly written tools which throw in tools interface
callbacks from causing ROCr to catch and return a generic error
code.

Change-Id: I2f5bf7104dc7d4ee688eb48423c7ffdb06bd7702
2021-05-04 02:14:20 -05:00
Mike Li 47ccc6604d Add Size of VGPR and SGPR to HsaNodeProperties
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: I7e6c0c5b9fd90c0bb5f3b7d35362a073afdcf9b8
2021-05-03 15:16:15 -04:00
Felix Kuehling 8baf02e80b kfdtest: Allow some CS to fail in EvictTest
amdgpu_cs_submit can fail intermittently if another process has too much
memory reserved at the time. Allow a small percental of command
submissions to fail to make the test more robust.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: If9f62b2b6f67be71420016d4e38d4dd6b6bca9a5
2021-05-03 11:01:35 -04:00
Felix Kuehling bd68646772 kfdtest: Workaround delayed page faults
Delayed page faults from a terminated process can be attributed to the
next process with the same PASID. Work around that by adding a delay
after the Exception tests to allow the kernel to clean up any fault
storms before the next test.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: Id310c13ea9eb92b04d37b95d91a0dd60bd9954e5
2021-05-03 11:01:24 -04:00
Felix Kuehling 25288e07dc kfdtest: Handle EINTR in waitpid
If the signal arrives too late, it interrupts waitpid. Handle this
situation gracefully.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: If4925c352c81ba7fef8a940460b91f5e720b451e
2021-05-03 11:01:11 -04:00