提交線圖

1131 次程式碼提交

作者 SHA1 備註 日期
Graham Sider 11a04fe1f5 kfdtest: Fix PersistentIterateShader for gfx target 9.4.x
Replace 'flat_load_dword <...> glc' with appropriate macro.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I9fdc7c916c685304457cd9698e741577f6c10c82
2023-04-14 12:05:08 -04:00
Graham Sider e2435d9e93 kfdtest: Add flat compatability macros for gfx target 9.4.x
For GC 9.4.0, modifications were made to various shaders since certain
flat_ instructions no longer support glc/slc modifiers (replaced with
nt/sc1/sc0). Instead of repeating conditionals inside various shader
bodies, we can make use of LLVM AMDGCN macros.

This patch modularizes the shader macros into seperated defines. Prior
to the core raw-string literal, each shader now starts with the
SHADER_START literal (".text\n") plus any number of SHADER_MACRO_*
literals. This allows us to seperate the macro definitions logically and
use the pre-processor to only include the required macro groups on a
per-shader basis.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I19eb3fd14252a0601bb7509249051b68e7fdb02a
2023-04-14 12:05:08 -04:00
David Francis 680c8ca5a9 kfdtest: Make queue evict tests use constant number of wavefronts.
Previously, KFDEvictTest.QueueTest and KFDSVMEvictTest.QueueTest
would create a variable number of wavefronts, one for each 64MB
of memory under test. This ran into limits on the buffers used
by the wavefronts, and may at some point have exceeded the
wavefront limit.

Restrict the number of wavefronts to 512, and adjust the shader
to accomodate a variable buffer size

Signed-off-by: David Francis <David.Francis@amd.com>
Change-Id: I2ec292e2900e2efa62a08313bca3d2f4bdabca8b
2023-04-14 12:05:08 -04:00
Graham Sider 831d1ad352 libhsakmt: Mask stepping version for GC 9.4.3 checks
GC 9.4.3 to set gfx target version to 9.4.x dependent on revision and
capabilities. Due to this, where applicable, mask off the gfx target
stepping version and only check major/minor version (9.4). There are no
collisions due to this change since GC 9.4.3 is the only ASIC that uses
gfx target version 9.4.x.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I72803e594c421f054d18ccfa7e92c507128fa5be
2023-04-14 12:03:23 -04:00
Philip Yang 598e3e8d86 kfdtest: KFDMemoryTest.DeviceHdpFlush requires large bar
KFDMemoryTest.DeviceHdpFlush requires device node 0 is large bar to
check VRAM content from CPU, run the test only if device 0 is large
bar GPU.

Change-Id: I874b153219550c50b724625e971e3ed3a84dc652
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2023-04-14 10:03:38 -04:00
David Francis e32278a612 kfdtest: Restrict DriverHDPFlush to systems with PCIe
Nodes with XGMI have no HDP, so DriverHDPFlush should skip.

Signed-off-by: David Francis <David.Francis@amd.com>
Change-Id: If5a87e660712e51d03e750d8e044786036b2e603
2023-04-14 10:03:38 -04:00
David Francis 16c6530330 kfdtest: Deprecate PollNCMemoryIsa
Even with the restriction to only compile on gfx90a, this
shader still fails CompileShaders test.

There don't seem to be any systems that actually use it.

Leave it in the shader store, but remove it otherwise

Signed-off-by: David Francis <David.Francis@amd.com>
Change-Id: I41bec6ba10363d42b163ac101c3a92edaad6d6df
2023-04-14 10:03:38 -04:00
David Francis 2a01e5c33b kfdtest: Use scalar path for PollMemoryIsa Shader on gfx940
A gfx940 code path was erroneously added to this shader.

It's unneccesary; without this path, the shader uses
the scalar store, which works just fine on gfx940 without changes.

Remove it.

Signed-off-by: David Francis <David.Francis@amd.com>
Change-Id: I825cbbebbdb25c4a7c2f16e228c2bea6a6bcc30c
2023-04-14 10:03:38 -04:00
Ori Messinger c234f84245 kfdtest: Update blacklist for Aqua Vanjanran
Signed-off-by: Ori Messinger <Ori.Messinger@amd.com>
Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: David Francis <David.Francis@amd.com>
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Change-Id: I8f822bb71e8e5dbee6bdb62f77cbe5ea83faabb5
2023-04-14 10:03:38 -04:00
David Francis 30da9a3cf9 kfdtest: Update shaders to compile on gfx940
gfx940 changed the semantics of the glc and slc coherency options
on vector stores and loads. This means that shaders that use
those bits no longer compile on gfx940.

Add precompilation if statements to those shaders to use the
new coherency bits.

Also add gfx940 to ASMTest so that compilation is tested.

Note: One of the tests enabled by this patch on gfx940,
KFDEvictTest.QueueTest, does not pass on gfx940 emulators.

Signed-off-by: David Francis <David.Francis@amd.com>
Change-Id: I942f9d2536e9eb5510c4d5af30df6ff1a95c8cf7
2023-04-14 10:03:38 -04:00
Graham Sider ae659e5427 libhsakmt: Fix queue destroy SVM path free size
Use q->total_mem_alloc_size for munmap in SVM codepath of free_queue.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I2fecaa1ddb337b1fe71f9cbba45a0c9467eff0c0
2023-04-14 10:03:38 -04:00
Mukul Joshi a713fb766e libhsakmt: Fix memory leak on queue destroy for GFX9.4.3
Currently, on queue destroy, context save restore memory is freed
only for a single XCC. Instead, we need to free the entire context
save restore memory, which was allocated for all XCCs.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Change-Id: I51ebb12fa8d5ebed41979d68e74f7c5392dca062
2023-04-14 10:03:38 -04:00
David Belanger 252a2cf959 libhsakmt: EOP Removal
Do not allocate the EOP buffer when not required.

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: I1664a3f0a882219a72278174006cdb8d46fd4f5e
2023-04-14 10:03:38 -04:00
Mukul Joshi 8994c3ba0e kfdtest: Program COMPUTE_PGM_RSRC3 for GFX 9.4.3
Program ACCUM_OFFSET to match the number of VGPRS used
by the shader as part of Dispatch setup.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Change-Id: Icfa1fbe4de2a62f00743de567f3ed382d3378b17
2023-04-14 10:03:38 -04:00
Graham Sider fd48f14ceb libhsakmt: Update FD creation logic
In multi-partition modes, e.g. CPX, we want to create new file
descriptor despite using the same render node. Update
open_drm_render_device to use a gpu_id to fd map partitioned by render
node. Different gpu_id's requesting the same render node will be added
to that render node's map list for fetching its fd. Different gpu_id's
requesting different render nodes as well as the same gpu_id's
requesting the same render node will behave as they did previously.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Ie153d42355d4d75b1c6ba6ff40fac3295bc87009
2023-04-13 15:25:09 -04:00
Mukul Joshi 97a669a979 libhsakmt: Update context save handling for multi XCC
Allocate debug area big enough for all XCCs in the partition. Also, fix
the cu_num calculations as driver now reports cu_num as the total number
of CUs in the partition.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Change-Id: I6e80d57196b770bb3c2506bc58cb366c0046084b
2023-04-13 15:25:09 -04:00
Graham Sider 6be4461a0d libhsakmt: Add Aqua Vanjaram support
Add gfx version for VGPR size per CU calc, add FAMILY_AV to KfdFamilyId,
add blacklist filter to kfdtest.exclude.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I9b8072e45f4d497e0a8fd3f8f97f1425238e8b42
2023-04-13 15:25:09 -04:00
Kent Russell d0c2770cde CMakeLists: Use pkgconfig more effectively with DRM_DIR
Instead of hard-coding lib64 and other include locations, just prepend
the DRM_DIR to the beginning of the CMake prefix path. Then let
pkgconfig find the package, the same way that it would if DRM_DIR wasn't
set. DRM_DIR takes precedence, but the default paths will be used if
DRM_DIR isn't set, or doesn't point to where libdrm is housed

Note that /lib and /lib/$ARCH aren't required for DRM_DIR, just the
path to the root folder for the package (e.g. /opt/amdgpu instead of
/opt/amdgpu/lib or /opt/amdgpu/lib64 or /opt/amdgpu/lib/x86_64-linux-gnu
etc)

Change-Id: I56767db28476d14e3fa77be1089c3904e2a32450
2023-04-06 10:39:40 -04:00
Kent Russell aab0e36538 README: Update README to point to current documentation
Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I3fed80e94edf5ff08a70b2e43450fe8168c5d355
2023-04-05 10:35:49 -04:00
Graham Sider 287cb29340 Revert "kfdtest: add MES judging API in test utility."
See description of previous revert.

This reverts commit 564913526a.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I969dc6469e62b50cd7ba0595918538602afa7516
2023-03-27 17:08:03 -04:00
Graham Sider 0750856d4a Revert "kfdtest: Using non-paged memory allocation only on devices that have MES scheduler"
This patch and the previous made it such that the queue ring buffer was
allocated as non-paged for GFX11+. The queue ring buffer should not be
mapped as non-paged; the non-paged requirement on GFX11 is only needed
for the queue wptr.

This patch was causing issues on various tests, such as intermittent
CP_INTSRC_BAD_OPCODE interrupts.

This reverts commit e40ae8481e.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I55b64aed73dc3b792f0756ae00daf6e10d93ce10
2023-03-27 17:07:59 -04:00
Graham Sider 5d80a4d214 kfdtest: Add KFDQMTest.BasicCuMaskingEven to GFX11 blacklist
Test is inconsistent across ASICs. Add to blacklist to unblock QA.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I31e5aa2450165227107536bef8402db2c0dc6d7f
2023-03-23 11:14:58 -04:00
Alex Sierra 2a1d6ee8b5 libhsakmt: query svm info from userptrs at fault events
Get more debug information about user pointers that were registered
through SVM API, and triggered by memory exception events.
A new kfdtest with this use case was also included inside
KFDExceptionTest.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Change-Id: I0ef4929afe0625b9b5cbbbebef11ede66dda60ab
2023-03-22 13:34:02 -05:00
Alex Sierra 63c8cf115a src: use SVM mechanism to register userptr memory
Register and map userptrs through Shared Virtual Memory(SVM) API at
the Kernel level when available. Using this approach, performance
will be improve as register/unregister memory will not trigger any
system call to KFD driver.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Change-Id: I3726b4b5e1c6a52a83786fbe0af6322eb29ae7c9
2023-03-22 13:33:35 -05:00
AravindanC 0f977fd1d8 ASAN Packaging for libhsakmt
Change-Id: I0a6232cdb61742aa81394bb49d2b5e890b6ada6f
2023-03-14 20:04:51 -07:00
Ranjith Ramakrishnan c911848242 Compile time flag to switch between #warning and #error message
Using backward compatibility paths will provide an #error message. Compile time option added to enable/disable the #error message.
Disabling the same will provide a #warning message

Change-Id: Ibb84241ba35aefb7a8450d68231e52242a634ed3
2023-03-10 13:09:13 -08:00
Daniel Phillips d3bb1ca4af kfdtests: Relax MemoryAllocAll failure criteria
The MemoryAllocAll test in kfdtests exercises the new KFD memory
availability API by trying to allocate a single buffer object that
exactly fills all of vram. Desired object size is determined using the
memory availility KFD ioctl via libhsakmt, then an object is allocated
slightly larger than that size. If the allocation attempt fails then
the test tries to allocate a slightly smaller object, and continues
trying with smaller sizes until the allocation succeeds. The test
succeeds if the successfully allocated object is within some specified
tolerance of the available memory reported.

There are a number of known issues that can cause the successfully
allocated object to be significantly smaller than reported availability.
Until these issues are addressed, we should not fail the test, but just
log the actual divergence between the size of the object we thought we
could allocate, and what was actually possible.

Signed-off-by: Daniel Phillips <daniel.phillips@amd.com>
Change-Id: I165a30865ffbb2353286dcc896ad8e24af124615
2023-03-03 15:24:39 -08:00
Eric Huang 3f55ba9fb8 kfdtest: add the check for svm usage limit
Since KFD counts svm allocation as system memory usage,
KFDSVMEvictTest will fail on the case of small system
memory, adding check is to skip test.

Signed-off-by: Eric Huang <jinhuieric.Huang@amd.com>
Change-Id: I040f16f2dd0d4092d069a632cfba9c28293f781b
2023-03-03 11:03:17 -05:00
Yifan Zhang 9f0f7741de gfx11 is able to perform atomic ops even PCI reports no atomic support.
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: Ie0d8af5a64ed717b140ac14db654c65ec7aa5ebb
2023-03-02 09:23:37 -05:00
Felix Kuehling e5ab87ede7 kfdtest: Add test for hsaKmtExportDMABufHandle
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: Ia87377c1d4201fecfa00c2e0ca53b507608df2b3
2023-02-27 14:44:11 -05:00
Felix Kuehling 332f59eb2a libhsakmt: Implement dmabuf export for RDMA
Implement hsaKmtExportDMABufHandle, which can be used for a new
upstreamable RDMA solution. It exports a DMABuf handle for an arbitrary
virtual address along with the offset of the address within the
allocation. It also checks that the size of the intended export does
not exceed the allocation.

This uses the new AMDKFD_IOC_EXPORT_DMABUF, which requires KFD ioctl
API version 1.12.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: Ie5fdb1f73ab3c7fa36c315ce326b1fb89eacc8b6
2023-02-27 14:44:11 -05:00
Yifan Zhang e40ae8481e kfdtest: Using non-paged memory allocation only on devices that have MES scheduler
Change-Id: I9181b353aac791f546aa7679ffd7cb8d9f8ef765
2023-02-27 10:32:15 +08:00
Yifan Zhang 564913526a kfdtest: add MES judging API in test utility.
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: I978fc85b7c81ea65b97953a50d2d0312bcba95bf
2023-02-26 21:22:39 -05:00
kent.russell@amd.com 64aa9009e1 Add check for available_memory API
If the KFD IOCTL version doesn't support available_memory, don't run the
test. Just skip the test

Change-Id: Iebf526d4563ab9f3c054bbfb38c214a1b893fcb5
2023-02-23 15:19:28 -05:00
Graham Sider 60831e86b2 kfdtest: Update GFX11 blacklists
Remove BLACKLIST_GFX10_NV2X from GFX11 blacklists, update
BLACKLIST_GFX11 as needed.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I84bd91ba20a5d3df27478fb4c97afa12f8a3e76a
2023-02-23 09:11:27 -05:00
David Yat Sin 53d53655d7 Fix for unitialized variables
Change-Id: Ie8a004db699248d0cde4213077520ea503754399
2023-02-14 14:19:31 +00:00
Ranjith Ramakrishnan 053b89414a File reorg backward compatibility message changed to #error
Change-Id: I70b6f06b5e82242b3f50e7d1f0dac8a1eb8add11
2023-02-10 13:09:10 -05:00
David Yat Sin fb8f42233d Fix unitialized variable warning in valgrind
Change-Id: I91e70d67671a8f7289b734407011380b6b97238a
2023-02-09 17:35:53 -05:00
Xiaogang Chen efcc9b275b libhsakmt: Correct reporting of Shader Engines number.
The Shader Engines number should be shadder array_count divided by simd_arrays_per_engine
not array_count.

Signed-off-by: Xiaogang Chen<Xiaogang.Chen@amd.com>
Change-Id: I808d1fedd6b9843500719e902ecf759f5668a7d1
2023-02-09 14:34:17 -05:00
Graham Sider 3fb1496fb3 kfdtest: Remove redundant SGPR/VGPR size checks in KFDTopologyTest
KFDTopologyTest.BasicTest duplicates Thunk logic to calculate VGPR size,
meaning it will always be the same, and SGPR size is a constant. Since
no benefit, remove comparisons.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I99e7ff6fb69ed07bc0716fdf43946b19c67b9268
2023-01-26 15:08:12 -05:00
David Belanger 0eb0bae38b Revert "libhsakmt: Disabled allocation of CWSR with SVM for GFX11."
This reverts commit b25867c4b8.

Change-Id: I05bf82266f563c63c0b794a24b0926e7652ce42d
Signed-off-by: David Belanger <david.belanger@amd.com>
2023-01-25 10:48:46 -05:00
David Belanger a847a7b80e libhsakmt: Fixed VGPR memory size for GFX11.0 and GFX11.1.
Fixed VGPR memory size, size was too small for some GPU, causing a memory overflow.
Refactored macro code into a function.
Thanks to Jay Cornwall for locating the problem and proposing the fix.

Change-Id: Iffedea1c4f341967f02c56d810ff048225b02c16
Signed-off-by: David Belanger <david.belanger@amd.com>
2023-01-25 10:45:44 -05:00
Ranjith Ramakrishnan bc40579f96 Added OS details to kfdtest rpm packge name
Change-Id: I600e094c364e1c7219ae3db12f0c4e1f7598c132
2023-01-23 12:13:32 -08:00
David Belanger b25867c4b8 libhsakmt: Disabled allocation of CWSR with SVM for GFX11.
This is a temporary work around for GPU hang issues observed on GFX11.

Change-Id: I98fbedbbd1c51fe402c2116b35ca548931a390c9
Signed-off-by: David Belanger <david.belanger@amd.com>
2023-01-11 17:28:31 -05:00
Eric Huang 505287412f Revert "libhsakmt: Remove unnecessary CPU unmap"
This reverts commit 7787a039bd.

It causes a regression in pytorch benchmark.

Change-Id: I96173dbd061cf38d6f451c02cb181ae51b7f625e
Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
2023-01-06 17:16:40 -05:00
Alex Sierra f2bda56d04 Revert "src: use SVM mechanism to register userptr memory"
This reverts commit 178a619b80.
There are some openMP issues that were introduced after SVM userptr
feature was added.

Signed-off-by: Alex Sierra <Alex.Sierra@amd.com>
Change-Id: I7ef87c5232a3bcbe594c743fa4b4958601845ba5
2022-12-08 17:33:51 -06:00
Alex Sierra d9f86ae02b Revert "libhsakmt: query svm info from userptrs at fault events"
This reverts commit 45fad29752.
There are some openMP issues that were introduced after SVM userptr
feature was added.

Signed-off-by: Alex Sierra <Alex.Sierra@amd.com>
Change-Id: I6566c9f0d39d05ecb92f38159880763f432939a5
2022-12-08 17:33:50 -06:00
Alex Sierra 21e95a4f2a Revert "libhsakmt: add env var to en/dis registration through SVM"
This reverts commit 8a746bdaed.
There are some openMP issues that were introduced after SVM userptr
feature was added.

Signed-off-by: Alex Sierra <Alex.Sierra@amd.com>
Change-Id: Ib01046571d2c84fa0fd228ecba0dee0eae3f994d
2022-12-08 17:33:48 -06:00
James Zhu 7db29c4797 kfdtest: track Test Status in syslog
Track Test Status in syslog, it will help understand
sys log assoicated with test cases.

Change-Id: I7c0749102db9bc73d6ae3a237ec347a8fefb12e9
Signed-off-by: James Zhu <James.Zhu@amd.com>
2022-11-29 17:46:40 -05:00
Felix Kuehling 7787a039bd libhsakmt: Remove unnecessary CPU unmap
This is handled by __fmm_release calling aperture_release_area.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: Ib8ed300e1734f03aeb9dfc8074897ece310b8af9
2022-11-28 17:18:13 -05:00