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

2959 Коммитов

Автор SHA1 Сообщение Дата
Your Name 88dabfcc04 rdmatest: Update amdp2ptest driver
Update Makefile for newer kernel version, and support build with dkms
amdgpu driver. Use symbol_request to get KFD peerdirect interface.

Sync up with KFD peerdirect interface changes, remove the free callback
which is not used any more.

Change-Id: I01d8906d9ffa427a058a26e88e36f6b80e9e22c2
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
Lang Yu a7a712fb36 libhsakmt: Fix improper usage of hsaKmtRegisterMemoryToNodes
It's unnecessary to register non-userptr.

Change-Id: Iefd329578365e036e2fe7e4d5c9c0c3d0976f67c
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
Lang Yu 5eb2a2660c kfdtest: Skip KFDEvictTest, KDFSVMEvictTest, HMMProfilingEvent on small APU
Small APUs use same memory allocation approach with APP APU now,
skip these tests as well.

Change-Id: I13c953cc53da071f6f36af0d4a0153a48ea066fe
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
Lang Yu ae3ede062f libhsakmt: add Integrated property
To differentiate discrete and integrated GPU more flexibly in runtime,
this will aid in querying HSA_AMD_MEMORY_PROPERTY_AGENT_IS_APU
and hipDeviceAttributeIntegrated.

Change-Id: Ic8a6c9aea3b4bd19c4d5f6729af7e64c328fc61d
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
Yiyang Wu 9316b6e4e4 kfdtest: hsaKmtCheckRuntimeDebugSupport should be visible
Change-Id: I03a379ede1c990bd275a4d2a8cb379f228381d03
Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
Signed-off-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
David Belanger 24578e10c1 kfdtest: Add exclude list for GFX12
Add test cases excluded from GFX11 to GFX12 list if they are also not
stable on GFX12.

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: Ifeab24f8ea94085250ea86128a3e401479bdb53d
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
David Belanger 8854555ed7 kfdtest: Update PollMemoryIsa shader for GFX12
Minor instructions changes.

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: I40d6aaffd78cf27f7c3b436cea5403d39b5b88ec
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
David Belanger bde8e7a212 Update shader for GFX12
Minor changes to instructions for GFX12.

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: Iac5be900e3755099d83010fb1a2066b4dbb52dda
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
David Belanger e086c383fe kfdtest: Updated KFDCWSRTest for GFX12
Updated ShaderStore shader (used by CWSR test) for GFX12.
Workgroup ID now pass in a different register.
Minor changes for new scope syntax.

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: I6fdabc8b62cba201d7777a736d3d43cfae28ca4c
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
Jonathan Kim 3b842c39f1 kfdtest: fix address watch test for GFX12
New watchpoint exception status bits have to been assign to the first 4 least
significant bits so change test verification mask to check against the
first watch point ID accordingly.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: If83950207ea9f66cd230c23e7386a97b3893c2eb
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
Jonathan Kim a2e9226784 kfdtest: fixup test traphandler for gfx12
Fix traphandler for KFD debugger testing.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>

Change-Id: Ib8f5aac3d1b99e4463ac56b5f6d5dee2c367c447
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
David Belanger 259a724e21 libhsakmt: Fix VGPR size for GFX12/GFX12.1
Set max size needed for VGPR when doing a CWSR for GFX12 and GFX12.1.

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: Iddefc62f1ad419c6f5ab6a872048457a1dc24037
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
David Belanger 197a6c2e6c kfdtest: Added gfx1201 filter
Initial template for GFX12.0.1.

Change-Id: I5d2be1f594bf057c04f6feee75a80c61a9d7e4a8
Signed-off-by: David Belanger <david.belanger@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
David Belanger 7d2c78a37d kfdtest: Add support for GFX12
Added FAMILY_GFX12 code.

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: I26f01055b3c8732b4b6e1195d34533d9f89032d2
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
David Belanger 09744e4959 kfdtest: Added gfx1200 filter.
Initial template for GFX12.

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: I552374bfcc0dd6272d170df85d36d0dbca0196d5
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
James Zhu 5786dbbb76 libhsakmt: update KFD ioctl minor version
Since PC Sampling not upstream yet, so use 1.16 for
contiguous VRAM allocation, and 1,17 for pc sampling.

Change-Id: Ib5d22e8f386ce7fe3f7111485b9632b61227e539
Signed-off-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
James Zhu 1087dea925 kfdtest: skip test when PC Sampling is not supported by ASIC
Skip test when PC Sampling is not supported by ASIC.

Change-Id: I6f9be0bdaed66e51052723b6df6908079470cefb
Signed-off-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
Jonathan Kim 206db80a56 libhsakmt: fix pc sampling return of functions
C Error returns are positive in user space and should check against errno
instead.
Fix declaration of return to type HSAKMT_STATUS.
KFD IOCTL should handle size return when querying capabilities so return
size to caller unconditionally.
Clean up error translations per function so that it's stylistically
clear.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: Ic37390425f370c7ad88f9ed014444decf19383a3
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
Kent Russell 371d078226 kfdtest.exclude: Fix blacklist
We need : to end each subtest, except for the last entry.

Change-Id: I9515d90703c9679e06a4acd124883540c1d5b832
Signed-off-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>
2024-06-24 14:26:21 -05:00
Chris Freehill 79e4eda0b6 Merge 'thunk/integrate-into-rocr' into integrate-libhsakmt 2024-05-02 21:52:49 -05:00
David Yat Sin d2d95a8948 rocrtst: add test for contiguous mem allocations
This test may fail when run on non-upstream versions of KFD as this
feature will not be upstreamed.

Change-Id: I7131e1f50984739c0df12e4c9afe790bd7e4cdfa
2024-04-30 17:42:15 -04:00
David Yat Sin ac5fb8be9e Temporary: Do not early release mutex when not ganging
It seesm the Release() function is not reliable and can cause segfaults.
This is a temporary work-around until the Release() function is fixed.

Change-Id: I95470a800c6153673e4b8f4fe46a646903325074
2024-04-30 17:07:39 -04:00
Chris Freehill 11fd5c2562 Prepare for integration into rocr
Change-Id: I6102b9910dbb9d09e09bb262a03c5c0ad4ce66f4
2024-04-30 09:01:09 -05:00
David Yat Sin 57b93e02a4 Use pthread_attr_setaffinity_np when available
If pthread_attr_setaffinity_np function exists use it instead of
pthread_setaffinity_np as pthread_setaffinity_np seems to fail to set
the affinity settings on some systems.

Change-Id: Icd8b17039699ac10d9cd5c4dbb6ac44630673949
2024-04-29 15:02:54 +00:00
David Yat Sin b6829f7a72 Bump HSA_AMD_INTERFACE_VERSION_MINOR
Bumping HSA_AMD_INTERFACE_VERSION_MINOR version to 5 to account for
previously added GPU agent query: HSA_AMD_AGENT_INFO_MEMORY_PROPERTIES

Change-Id: Ic8cfdcfb7bad6f3d1e0b3d68f505a62074fc26b9
2024-04-29 12:55:18 +00:00
Kent Russell 5e1f24f305 .github: Add CODEOWNERS file
Change-Id: Ia763b91177f1ae09d16e5968bed17b0dba62cbe5
Signed-off-by: Kent Russell <kent.russell@amd.com>
2024-04-26 09:21:39 -04:00
amd-jmacaran 587e4287f4 Change token name to match IT-created token
Change-Id: Ic9189c012024c59cf5bad9daf25f6c2575a100fd
2024-04-25 12:23:28 -04:00
David Yat Sin 3d999a1adf Perform HDP flush for SDMA copies gfx10/gfx11
Perform HDP flush on gfx10/gfx11 PCIe devices.

Exclude gfx101x devices

Change-Id: Ief76c34634b09b0a7942cb71519d4082ca8b4fad
2024-04-24 18:07:34 -04:00
David Yat Sin 9af225e1b1 Add support for contiguous memory allocations
Support contiguous physical memory allocation flag. Allocations with
this flag will have contiguous physical memory. This is dependent on KFD
support for this flag and the AllocateKfdMemory(..) function call will
fail when it is not supported.

Change-Id: I6c51c8b061f7b026fdcc2aa2c37c74ecc13d95b6
2024-04-24 14:02:07 -04:00
David Yat Sin e539c8dce2 Remove assert for physical vs virtual memory size
On systems with more than 1 TB of memory per NUMA region, this triggers
unnecessary errors.

Change-Id: I1bc7f209b9c1739b516c9f6b0acf434488ac7b8d
2024-04-24 08:43:23 -04:00
amd-jmacaran 8a893ea0b8 Add support for external CI builds using Azure Pipelines
Change-Id: I8f4de331f00317a959b86f7e5b7a1025ba03564b
2024-04-23 21:10:49 -04:00
David Galiffi a8bd453243 Fixed MD linting issue regarding code blocks.
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Change-Id: Id0467b332bf033642a2d403090ffe598e41689f5
2024-04-23 16:48:15 -04:00
David Galiffi 975c5dd24a Fixed broken link to ROCm documentation
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Change-Id: I9a6bc0ad08a060d83fdc3a0589dfc81c68ce2b0e
2024-04-23 16:47:50 -04:00
David Galiffi f94c1794bb Fixed MD linting issue regarding headers
They should start at H1

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Change-Id: Id11a2599c4609255a1a9916f70b58adc41cdddb4
2024-04-23 16:47:19 -04:00
David Galiffi c9103a00ef Update GitHub links to point to the new organization.
ie., RadeonOpenCompute --> ROCm

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Change-Id: I6724cbcbbb525f767af297e3986cd61fa69cd49f
2024-04-23 16:46:42 -04:00
Philip Yang 97497c7efc libhsakmt: Support contiguous VRAM allocation flag
Add HsaMemFlags Contiguous bit for hsaKmtAllocMemory to allocate
contiguous VRAM, to support RDMA device with limited scatter-gather
ability.

Check KFD ioctl minor version >= 17.

Change-Id: I0db00dad125b2b7be523f343082641f59b850423
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2024-04-23 14:27:12 -04:00
Your Name e2d742ac6f libhsakmt: Remove HsaMemFlag reserved bit init
HsaMemFlag new flags added and the number of the reserved bits is
reduced, and generate value overflow compilanation error.

The reserved bits is not used, remove the init.

Change-Id: I603596977dfd558ce31ead03711d7c5ce5ee5b71
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2024-04-23 14:27:12 -04:00
David Yat Sin f2751b7030 Fix queue creation for PC Sampling
Fix lazy pointer initialization for dedicated PC Sampling queue.
Previous implementation would always create a queue on GPU agent
creation instead of creating the queue on first use.

Change-Id: Icf300f2b162e59143ba61ba182d9bee6e1308fc1
2024-04-22 19:00:48 +00:00
Shweta.Khatri bc9cac97fe Fixing compilation errors related to MUSL libc
Fix Musl libc NULL errors and unsupported pthread funcs for compatibility.
Also ensures cleanup and error handling irrespective of CPU affinity override.

Fix submitted by github dev - AngryLoki
https://github.com/ROCm/ROCR-Runtime/issues/181

Change-Id: Ia487315e504112be5d3370756f23f6e23b9ae4be
2024-04-17 07:14:15 -04:00
David Yat Sin d6d5786051 Adding queue information queries
New hsa_amd_queue_get_info API to support:

- HSA_AMD_QUEUE_INFO_AGENT: Agent that owns the underlying HW queue

- HSA_AMD_QUEUE_INFO_DOORBELL_ID: KFD doorbell ID of the queue
completion signal.

Change-Id: I98842131bcbdd08552649791a5d43e578a615808
2024-04-11 12:53:48 -04:00
David Yat Sin 3443fdf665 PC Sampling: Disable coredump when sessions active
When doing a coredump, we try to park the wave and save its PC in
ttmp7/ttmp11, but these registers will be overwritten by PC Sampling
requests.

Change-Id: I60fb734eb3bed4ee3cc8d8bba9ec4a527fff9671
2024-04-11 12:53:43 -04:00
David Yat Sin 49e56ce782 PC Sampling: Convert timestamps to system time
Convert timestamps inside samples to system time

Change-Id: I5fad9a6887fa27c0ded9aa9b5f251cba2868f88f
2024-04-11 12:53:37 -04:00
David Yat Sin 547c9cb143 PC Sampling: Implement lost sample count
Change-Id: Idfdfbac71c1813dd7a97c301619cf8ce83713c53
2024-04-11 12:53:31 -04:00
David Yat Sin 8abbf9475b PC Sampling: Implement flush
Flush is used by the client to retrieve data that are currently stored
in the buffers. This is used by the client to retrieve current data when
the buffers are not full.

Change-Id: Ib8304dcdfb2797cb060ec72df4970d95cf6be348
2024-04-11 12:53:24 -04:00
David Yat Sin 5177d17f5d PC Sampling: Push data to PC Sampling client
Each time there is enough data to fill the client session buffer,
callback the client data ready function to transfer the buffer contents
to the client.

Change-Id: Id79775426fa6d22e00dc2ef6f55c439eacb9b2af
2024-04-11 12:53:17 -04:00
David Yat Sin 855e454671 PC Sampling: Retrieve data from trap handler
Retrieve data from the buffers previously set in the 2nd level trap
handler TMA. We use a double buffering mechanism to allow the 2nd level
trap handler to write to one buffer while we are copying data from the
other.

Co-authored by: Joseph Greathouse <Joseph.Greathouse@amd.com>
Co-authored by: James Zhu <James.Zhu@amd.com>

Change-Id: I252c381ea06b8cf927c4f9af6ea59dedc3717fbb
2024-04-11 12:53:12 -04:00
David Yat Sin efdb72fd71 PC Sampling: Update 2nd level trap handler
Update 2nd level trap handler when PC Sampling is enabled

Change-Id: I95bf2bca8057d2f8313923c7f012f033e12ccc3a
2024-04-11 12:53:06 -04:00
David Yat Sin 8d666dea01 PC Sampling: Allocate resources to retrieve data from trap handler
Allocate required device and host buffers to be able to interact with
the 2nd level trap handler.

Change-Id: If99de5aacf956ca57ecafc7b04b797be9c9decaa
2024-04-11 12:53:00 -04:00
Joseph Greathouse 431a70471e PC Sampling: Add gfx9 2nd trap handler for PC Sampling
Code is valid for gfx9 GPUs excluding gfx94x.

1st level trap handler will use TTMP13[22] to indicate host trap and
TTMP13[21] to indicate stochastic trap.

For each PC sampling method (hosttrap and stochastic), we use a double
buffering mechanism to transfer data between GPU and host.
The GPU will dump data into one buffer while CPU may be reading data
from the other buffer. There are 2 separate signals, one for each
buffer.
When signal != 0, the buffer belongs to the GPU and the GPU can write
to it. Once the buffer has reached the high watermark, the GPU will
set the signal to 0 to wake up the host and so that the host can try
to switch the buffers and read the data.

Co-authored-by: David Yat Sin <David.YatSin@amd.com>
Change-Id: If3eb0913e52fb4788059a71e5feca334612f3d5d
2024-04-11 12:52:54 -04:00
David Yat Sin a83f872a23 PC Sampling: Create dedicated CP queue
Create dedicated CP queue with highest priority for PC Sampling. Reduce
the highest priority that LRT's can set for existing API so that PC
Sampling queue will always have highest priority over any other CP
queues

Change-Id: Ia70d74415edc83b4862a3e18dbdbd7cebe73ab47
2024-04-11 12:52:48 -04:00