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

1076 Коммитов

Автор SHA1 Сообщение Дата
Felix Kuehling 021ceccd80 libhsakmt: Fix use of uninitialized variable
When is hsaKmtCreateQueue called first time for node
doorbells[NodeId].size is initialized to zero in init_process_doorbells
but used to calculate the doorbell offset. It works just by accident
because doorbells[NodeId].size is uint32_t so -1 will be 0xFFFFFFFF which
is zero extended into 0x00000000FFFFFFFF and it will work as long as mmap
offset bits are not within lower 32 bits.

Bug: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/issues/78
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: Ia791adfc51363d4704cb50fa4f01137b7dd48a75


[ROCm/ROCR-Runtime commit: 8e69b9c70e]
2022-11-25 14:07:45 -05:00
Eric Huang 6d9fc60ea1 kfdtest: remove scc test in MapUnmapToNodes for gfx90a A+A
Modifier scc is disabled from gfx90a's asm, so remove the
shader for gfx90a A+A and keep it for newer asics with scc
support.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: Iec3c7ccd5156a855adb2b02feb3db0761876aa2f


[ROCm/ROCR-Runtime commit: 8e8aa024fd]
2022-11-25 13:55:28 -05:00
David Yat Sin 0e7a4d8ace libhsakmt: Initialize fd to -1
Fix compile error due to warning in some environments

Change-Id: Ie5fcfabb872c27c0de349eb215345b997fae7201


[ROCm/ROCR-Runtime commit: f46ddb7ead]
2022-11-25 15:01:53 +00:00
Ranjith Ramakrishnan ddaee6ccc6 Change pragma message to warning
File reorganization feature was implemented with backward compatibility
The backward compatibility support will be deprecated in future release.
Changed the #pragma message to #warning for a smooth transition

Change-Id: I21025f4cefb40721f095130263b4247877979d36


[ROCm/ROCR-Runtime commit: 01fd84db5e]
2022-11-23 13:06:34 -05:00
David Francis 0ebee88add libhsakmt: Don't close kfd_fd
When hsa is closed, it would close open fds for /dev/kfd but
not for /dev/dri/renderD*. This caused issues with CRIU
checkpoint, which expects that /dev/kfd will be open if
/dev/dri/renderD* is.

As a workaround for the CRIU behaviour, leave /dev/kfd open
when closing hsa.

Signed-off-by: David Francis <David.Francis@amd.com>
Change-Id: Ie1b2d5b1d8986750b0e560ae2934b7c73cff942e


[ROCm/ROCR-Runtime commit: 88934cec2c]
2022-11-17 10:04:24 -05:00
Nirmal Unnikrishnan 4c8eae2b76 : updating the kfdtest packaging version
Change-Id: I4132d1106bd997b64b1496ea268961172a545102


[ROCm/ROCR-Runtime commit: e0476629fe]
2022-11-14 11:40:45 -06:00
Graham Sider cb42ad18bf kfdtest: Rename IterateIsa to PersistentIterateIsa
To avoid confusion since this shader has changed to be persistent
(original IterateIsa may be re-used for debugger tests).

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I4643692765fc7665933257e89d5b922e779ad2e5


[ROCm/ROCR-Runtime commit: 6467664ec7]
2022-11-09 09:37:06 -05:00
Jeremy Newton 94abba3ff1 Fix libc/gcc hardpath issues
Don't use the full path to link against libc, but rather let
cmake find it.

Regarding gcc_s, it doesn't seem like this is still needed, so I've
removed it instead.

Change-Id: I1dc594f10c647b2abfdab7c5e0de90c331c6eeaf
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>


[ROCm/ROCR-Runtime commit: a63d53ad8b]
2022-11-08 10:51:29 -05:00
Jeremy Newton fc5d8d1076 Rework libdrm requires/recommends
To be more alligned with ROCr, libdrm dev package appears to be
required, but we don't care if it's ours or the distro's. So require
either but recommend our package to get the latest version.

Change-Id: I744ce4861644a83ba94c39e0bf4230eab58cc68a
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>


[ROCm/ROCR-Runtime commit: 4fa9404fe2]
2022-11-04 17:33:08 -04:00
Ramesh Errabolu b931a65960 Add support for CRIU testing
Change-Id: I8945a078ee8ae491245da6091e64b118584a48ab


[ROCm/ROCR-Runtime commit: 75428364a7]
2022-11-02 15:40:03 -04:00
Alex Sierra a89bcd0518 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: I8e9df3c1c6c3f42d7b9235d12406d80d31746443


[ROCm/ROCR-Runtime commit: 45fad29752]
2022-10-21 15:33:14 -04:00
Alex Sierra ea19fbb646 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: I20723cbeb340bf48b95e1115f0102c031397bc14


[ROCm/ROCR-Runtime commit: 178a619b80]
2022-10-21 15:32:02 -04:00
Yifan Zhang 2e7431c130 kfdtest: add blacklist for gfx1103
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: I9ffe4dd8add505d0a6cfd3ed974fab6cef05f039


[ROCm/ROCR-Runtime commit: 4b9461dd42]
2022-10-12 10:08:13 +08:00
Graham Sider d1bcd2d405 kfdtest: Make KFDCWSRTest.BasicTest buffer sizes dynamic
KFDCWSRTest.BasicTest is parameterized to allow an easy method of
tweaking the number of work-items (and save/restores). The input/output
buffers were previously hardcoded to a single page, which would cause a
segmentation fault if the number of work-items specified is greater than
1024 for wave32.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Ieefc819a5d81c77cee88081a287fd383e6378e74


[ROCm/ROCR-Runtime commit: 73adbdee2c]
2022-09-30 18:18:17 -04:00
Graham Sider dadefb3a80 kfdtest: Add missing break in FamilyIdFromNode
Add missing break after GFX11 FamilyId patch.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I8fd727054442d74a95f69724ab07c4095f8ae77e


[ROCm/ROCR-Runtime commit: af48352d9a]
2022-09-29 09:22:05 -04:00
Graham Sider 2c5b834f89 kfdtest: Update COMPUTE_PGM_RSRC1 for software trap
For software trap in GFX11, COMPUTE_PGM_RSRC1 must have PRIV = 1.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Id504889c3ca2588b6c8cefdebaec00dcfc217995


[ROCm/ROCR-Runtime commit: 6294ef564b]
2022-09-23 16:38:31 -04:00
Graham Sider 201f8a3de5 kfdtest: Add dedicated FamilyId for GFX11
Add FAMILY_GFX11 to KfdFamilyId enum.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Ib2aa3f8cf31041f7b4cdd9a2f3e36489dde5554c


[ROCm/ROCR-Runtime commit: e44952d8a6]
2022-09-23 16:29:09 -04:00
Philip Yang 5aa3e2513d kfdtest: Correct mmap return value checking
On error mmap returns value MAP_FAILED, which is (void *)-1, not NULL
pointer.

Change-Id: I81b187266c943fa0aa4fab21b529d4c2989b12ad
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 590fd531c0]
2022-09-21 15:38:11 -04:00
Graham Sider 766ea98425 libhsakmt: Skip hsa_gfxip_table search for GFX11+
Prior to launch some ASICs may re-use PCI DIDs from older generations.
This can cause issues during topology initialization as hsa_gfxip_table
lookups will override sysfs-provided gfx versions, causing incorrect
gfxip selection. Since no new entries will be added to hsa_gfxip_table,
limit its search only to pre-GFX11 ASICs.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I53eaefac5db2650a36a6ce9f21daf750f50cfd26


[ROCm/ROCR-Runtime commit: 79279e860f]
2022-09-21 14:09:35 -04:00
Daniel Phillips 54539f06c7 kfdtest: Add thunk test for KFD memory availability ioctl
Signed-off-by: Daniel Phillips <Daniel.Phillips@amd.com>
Change-Id: Ic4c1ffefdc3570718a1fce4e53ca5f1ebde8c479


[ROCm/ROCR-Runtime commit: 169673a435]
2022-09-21 13:26:38 -04:00
Graham Sider df1259df37 kfdtest: Update exclude for gfx1101
Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I78c1130c4a85a98a265a090e40390e56d3be2819


[ROCm/ROCR-Runtime commit: 14aa475905]
2022-09-09 09:40:23 -04:00
Graham Sider 77bdfc1389 kfdtest: Remove unnecessary v_ ops in IterateIsa
IterateIsa had some leftover instructions from when the shader was
getting updated for KFDCWSRTest.BasicTest.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I41ae7b7948cbe2aff8bf61b170b9a7d498b836a3


[ROCm/ROCR-Runtime commit: 82a41c7e4d]
2022-09-09 09:40:04 -04:00
Philip Yang 3d393daa5a libhsakmt: Set CWSR SVM range MADV_DONTFORK
fork process copy-on-write MMU nitifier on CWSR range will evict user
queues, and then update GPU mapping and resume queues, use MADV_DONTFORK
to avoid COW MMU notifier callback on CWSR SVM range.

Use mmap to alloc SVM range for CWSR because posix_memalign don't alloc
new range in child process, this fails to register svm range as range is
invalid address in forked child process.

Change-Id: Ibaea56a691dd6f577ed2e1f2d43f4a3500b8316f
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 093cf898fb]
2022-09-08 22:53:47 -04:00
Philip Yang 702bfd3798 libhsakmt: Use mmap aligned for scratch allocation
To remove duplicate mmap aligned allocation code.

Change-Id: Ibc05cc4aaf6d190bd2382e33bdeca1496960c5f2
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: b2691c359d]
2022-09-08 22:53:47 -04:00
Philip Yang 6a98ef78d9 libhsakmt: Add mmap alloc aligned helper function
mmap alloc larger address range with align padding page plus guard
pages, then unmap the padding and guard pages at beginning and end
of the range, return aligned address range.

Change-Id: Iaf3c711a079c744289efbafee9b5e63aaf724765
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: b7710a1dda]
2022-09-08 22:53:47 -04:00
Philip Yang a793a889af kfdtest: Add KFDSVMRangeTest.PrefaultPartialRangeTest
Change-Id: I00617dd5a2216fab90c2b0d116825ec274d14d13
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 2230d01c8a]
2022-09-08 22:53:47 -04:00
Philip Yang 33559d81e0 kfdtest: Add KFDSVMRangeTest.VramOvercommitGiantRangeTest
Change-Id: I5f6b3b6a910ff6646bf4b0c48ae3e94ad243cf88
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 115f1f8d1f]
2022-09-08 22:53:47 -04:00
Philip Yang b6d6b03f22 kfdtest: Add KFDSVMRangeTest.VramOvercommitTest
Change-Id: Id5b23d5efd4f6a9717d1ca196c8635846493f77d
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 3190f189b4]
2022-09-08 22:52:43 -04:00
Aaron Liu 8629b2a019 libhsakmt: expand control stack size limit for all gfx103x
GFX1036(ISA version) is not included in the previous range.
This patch can really include all gfx10 series ASICs.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: I0e28dbfc031c216166b306b9fb39f644f75a330f


[ROCm/ROCR-Runtime commit: 06a90612e9]
2022-09-08 22:37:50 -04:00
jie1zhan 28171f28f9 libhsakmt: Add check for the runntime debuuger
Avoiding the segfault, runtime debugger enable is not supported
if the firmware of gpu doesn't support debug exceptions.

Signed-off-by: jie1zhan <jesse.zhang@amd.com>
Change-Id: Ifad57a6e78cb1c92b1f8927355ece8c64e89c51b


[ROCm/ROCR-Runtime commit: d98c729ff9]
2022-09-08 20:52:01 -04:00
Mukul Joshi ef25ba07f1 libhsakmt: Remove potential double free in queue creation
Remove potential double free condition when free_queue() is called
after hsaKmtDestroyQueue() if mapping doorbell fails during queue
creation.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Change-Id: If2aa19c455b30d2940b232dbafb9cc1eaad721a5


[ROCm/ROCR-Runtime commit: 57a1c6f3ff]
2022-09-08 11:39:34 -04:00
Shikai Guo 8ab12e6433 libhsakmt: add filter node for new chip
When running kfdtest test case, because the filter node of the new chip is
missing in libhsakmt, the test case is not supported, so a new test node
is added in order to spporting kfdtest case.

Signed-off-by: shikaguo <shikai.guo@amd.com>
Change-Id: I0cd9ffd7d4387129cfb0f8de6b669f431949ab49


[ROCm/ROCR-Runtime commit: 4951495fca]
2022-09-07 15:18:18 +08:00
Philip Yang 8e77b792f8 libhsakmt: Fix queue leaking debug memory
Queue ctx_save_restore memory is allocated with size
ctx_save_restore_size + debug_memory_size, use the same size
in free_queue to free ctx_save_restore memory.

Change-Id: I4902ff15fb82ddea64b8342b89776a1bf5c38d13
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 3dbf5feffe]
2022-09-01 12:31:16 -04:00
David Yat Sin 95d4d31648 libhsakmt: Add check for invalid aperture
Avoiding segfault when an invalid SharedMemoryHandle is passed in
when calling fmm_register_shared_memory.

Change-Id: I0e0bbed01487fc10afcbb170eb9330e70b209d14
Signed-off-by: David Yat Sin <David.YatSin@amd.com>


[ROCm/ROCR-Runtime commit: 1c385fb257]
2022-08-31 15:14:16 -04:00
kent.russell@amd.com 4e9f4eca62 src/topology.c: Fix NULL check
Now that HsaNodeProperties is passed in to
topology_get_node_props_from_drm, check that pointer instead of the
pointer for MarketingName (which throws a compiler warning)

Signed-off-by: kent.russell@amd.com <kent.russell@amd.com>
Change-Id: If76b24e1bab5a62e514ab440b6316c7b7cd264c1


[ROCm/ROCR-Runtime commit: ea4d4917c1]
2022-08-29 08:56:41 -04:00
Lang Yu 9c16ddc3b2 libhsakmt: add FamilyID info into HsaNodeProperties
Query family id info from drm render node, then
ROCr can query this info directly from Thunk
instead of parsing the info by itself.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Change-Id: I030bd27ab2379fbf87f3d787302c3b8613456278


[ROCm/ROCR-Runtime commit: 66e9e97e0d]
2022-08-24 21:14:06 -04:00
Graham Sider 205692ab1a kfdtest: Bump C++ compiler to gnu++17
Required due to LLVM retirement of llvm::apply_tuple, instead using
std::apply which was introduced in C++17.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I6646ebcca7d71d3e1bcf340ccfa3db2c15a3110a


[ROCm/ROCR-Runtime commit: 4267c4b524]
2022-08-24 11:46:18 -04:00
Graham Sider 422f24bae0 kfdtest: Add KFDCWSRTest.BasicTest* to GFX10 blacklist
Failure with new CWSR tests reported for GFX10, for now add to blacklist.



Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I5b2bd9ec61c64ad66e1c34ba2c192bece808f56f


[ROCm/ROCR-Runtime commit: 0055ef46c4]
2022-08-23 16:03:24 -04:00
Graham Sider 9e997d0d0c kfdtest: Overhaul KFDCWSRTest.BasicTest
This patch restructures the CWSR basic test and allows for
creating parameterized CWSR tests. This patch introduces four
parameterizations. These tests behave as follows:

This test dispatches the IterateIsa shader, which continuously
increments a vgpr for (num_witems / WAVE_SIZE) waves. While this shader
is running, dequeue/requeue requests are sent in a loop to trigger
CWSRs.

This test defines a CWSR threshold. Once the number of CWSRs triggered
reaches the threshold, a known-value is filled into the inputBuf to
signal the shader to exit.

4 parameterized tests are defined:

KFDCWSRTest.BasicTest/0
KFDCWSRTest.BasicTest/1
KFDCWSRTest.BasicTest/2
KFDCWSRTest.BasicTest/3

0: 1 work-item, CWSR threshold of 10
1: 256 work-items, CWSR threshold of 50
2: 512 work-items, CWSR threshold of 100
3: 1024 work-items, CWSR threshold of 1000

Tuple Format: (num_witems, cwsr_thresh)

num_witems: Defines the number of work-items.
cwsr_thresh: Defines the number of CWSRs to trigger.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I639eb7bd75b14ee70e190b4bd19dcf34096fc7bf


[ROCm/ROCR-Runtime commit: 0dbac97b75]
2022-08-22 19:55:04 -04:00
Jonathan Kim 2682b41234 libhsakmt: bump debug major rev for snapshot and watchpoint changes
The debugger can now request snapshot copies with entry size and
set/clear watchpoints by device.

v3: drop min version check to v10.0

v2: check runtime allowance from v10.3 to 13.x

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


[ROCm/ROCR-Runtime commit: c1d8ac8437]
2022-08-22 12:11:04 -04:00
Kent Russell 558e6c34bd kfdtest: Add return statement for ReadSMIEventThread
This didn't return anything, so add a "return 0" at the end, since the
function expects to return an int value

Change-Id: I17c398e431b2ce4571e6ca4abe6d567f110ea2a7


[ROCm/ROCR-Runtime commit: 90ada94141]
2022-08-02 09:22:49 -04:00
jie1zhan 7e795278fc Fix allocate memory failed in VRAM
: The kernel driver will do align VRAM allocations to 2MB, instead of 4KB.
Change-Id: Iea9d8c0f02999b9ea5fd931da82240a33f7bcc69


[ROCm/ROCR-Runtime commit: 17fb40f1f6]
2022-07-30 01:18:50 -04:00
Felix Kuehling cd04105656 libhsakmt: Make CWSR area executable
The debugger depends on the CWSR area being executable. Set the right
flag when registering SVM memory.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Tested-by: Laurent Morichetti <Laurent.Morichetti@amd.com>
Change-Id: I7441e214d1a4da8324d775e777976fabd1c81a6f


[ROCm/ROCR-Runtime commit: deb7a20c92]
2022-07-25 17:43:52 -04:00
Felix Kuehling 4c2ad152a3 kfdtest: Disable host access for VRAM
KFDExceptionTest.SdmaQueueException allocates VRAM with host access. This
fails on small-BAR GPUs. This error was incorrectly ignored before
7ccda4ba26 ("kfdtest: Full TearDown and SetUp in child process").

The test doesn't really need host access to the memory. Therefore the fix
is to disable the HostAccess flag.


Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: Ifec279eeb6c1ecb1160db9b692e6dc8816d761a3


[ROCm/ROCR-Runtime commit: 9d33827a84]
2022-07-21 16:08:19 -04:00
Felix Kuehling c6a23a88ee libhsakmt: Remove CMA implementation
The CMA feature is deprecated and about to be removed from the DKMS
branch. It was never supported upstream. Leave dummy functions in
place for now.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: I9e51403d753cb91630553aff4f19e931af509740


[ROCm/ROCR-Runtime commit: 9b2b81e555]
2022-07-21 16:08:19 -04:00
Felix Kuehling c9a324d6f5 kfdtest: Remove CMA tests
The CMA feature is deprecated and about to be removed from the DKMS
branch. It was never supported upstream.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: I64b6213eb3adbdc550542e51181cd8ba6ca4cb45


[ROCm/ROCR-Runtime commit: cdaaf8236a]
2022-07-21 16:08:19 -04:00
Felix Kuehling c1a3ea8a30 libhsakmt: Map VRAM only on supported peer GPUs
hsaKmtMapMemoryToGPU should not try to map VRAM on peer GPUs that don't
have an IO-Link to the memory. The new P2P mapping code in KFD will
fail otherwise.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: I6d59b55651b98756865a0f69eafef3e386372cf3


[ROCm/ROCR-Runtime commit: 9ac2c75171]
2022-07-19 21:21:59 -04:00
Felix Kuehling e8ba7dc5c2 libhsakmt: Init apertures in AcquireSystemProperties
This allows init_process_apertures to use the whole consistent topoology
instead of taking its own partial snapshot.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: Ia13e7aa7fcd090ea8d6cacd4babb29a27c20207f


[ROCm/ROCR-Runtime commit: 87aca673e8]
2022-07-19 21:21:59 -04:00
Felix Kuehling 7ccda4ba26 kfdtest: Full TearDown and SetUp in child process
With the next patch, child processes need to fully reinitialize the
topology in order to recreate the process apertures. Just calling
hsaKmtOpenKFD is no longer sufficient. Tests based on
KFDMultiProcessTest already did this correctly (KFDHWSTest, eviction
tests). This patch fixes KFDExceptionTest and KFDIPCTest.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: Iaad24e88ddd29c1105bf791a77891cc55a6072ff


[ROCm/ROCR-Runtime commit: 412b24137e]
2022-07-19 21:21:59 -04:00
Graham Sider 93e7565163 kfdtest: Remove fixed tests from GFX11 blacklist
Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I2dc785ea88a1a9222c6b7886fb75b6c7d699036a


[ROCm/ROCR-Runtime commit: c6da7d1353]
2022-07-18 14:35:17 -04:00