Graphe des révisions

2930 Révisions

Auteur SHA1 Message Date
Ranjith Ramakrishnan 3268fe2a56 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: Ibaedc1873bc764d25f74d9ca9416077d084e332d


[ROCm/ROCR-Runtime commit: a34804ed3e]
2022-11-17 09:38:24 -08: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
David Yat Sin 406115eaac Revert "Correct limit query return type to match spec ABI."
This reverts commit 689e9ce6a4.

Changing the parameter sizes breaks backward ABI.

Change-Id: Iff14b7c11294f0931f36fcfd42fff11a492d4205


[ROCm/ROCR-Runtime commit: b9d1ad8604]
2022-11-14 19:13:58 -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
David Yat Sin 3e6721df9f Allow page-aligned len for ipc_memory_create
Previous versions of HIP will call hsa_amd_ipc_memory_create with then
len aligned to granularity. Temporarily allow this so that we go not
break backward compability. Will remove this after 2 releaes

Change-Id: I6b5ac2cad5d32d62c803637cf1a2c6deebc03169


[ROCm/ROCR-Runtime commit: cb71e2d715]
2022-11-09 15:01:47 +00: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
David Yat Sin f5e7534574 Use paged memory for queues on MEC devices
MES devices need GART mappings and therefore need non-paged memory. But
using non-paged memory introduces performance regression where it can
take over 80 ms to see the signal changes if the memory is in the wrong
NUMA node. Currently, we cannot control NUMA affinity when allocating
non-paged memory. Using non-paged memory allocation only on devices that
have MES scheduler

Change-Id: Ib27fb01d75247aa4f2bb2aa4503c6af5a98afda0


[ROCm/ROCR-Runtime commit: c1e836b6ab]
2022-11-04 13:23:21 +00:00
David Yat Sin d08d9a4a7b Use os::createThread to launch SVM profiler thread
Using previous method of std::thread for SVM profiler task was causing
segfaults on thread launch on RHEL 8 if libhsa-runtime library is loaded
using dlopen.

Change-Id: Ic010cd6ae9bc6e6ed0605de02b93f6aae8ed3e97


[ROCm/ROCR-Runtime commit: 0e4c7336ff]
2022-11-03 10:52:11 -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
Jonathan Kim b553bf1c24 Fix doorbell offset fetch for GFX11
Transient exec usage is not required for GFX11 and will result in a NULL
return of s_sendmsg_rtn if directly returned to exec_lo.

Directly fetch and mask the doorbell ID to ttmp3 for GFX11 instead.

Change-Id: Ie17ed69d68d84ab18869b1c7871a0ed0482cd661


[ROCm/ROCR-Runtime commit: f9edf73cd7]
2022-11-02 11:55:37 -04:00
Nirmal Unnikrishnan a0977f8108 Updating the Rocrtst packaging
Update rocrtst packaging to add dependency on rocm-core so that rocrtst
gets uninstalled when rocm-core package is removed

Depends-On : I1e7ed52d7eed2c190d0b5651e7ded7192d7634b5

Change-Id: I7243dd29950b93a2665720a0062816c574f0f640


[ROCm/ROCR-Runtime commit: 8225271e18]
2022-11-02 09:38:48 -04:00
Ranjith Ramakrishnan 161abc3316 Add libelf-dev to package depends list
In ubuntu, the package depends list was not showing libelf. Added the same

Change-Id: I713951bd7181f44d667561aaf437f85c6cd783b0


[ROCm/ROCR-Runtime commit: 76cf5d2edc]
2022-10-31 13:07:55 -07:00
David Yat Sin e80b937d93 No-Op for allow access on imported IPC
If hsa_amd_agents_allow_access is called for an imported IPC handle,
ignore the request as this pointer will already have these pointers
mapped to other GPUs during IPCAttach()

Change-Id: I4bf33ed57e93b5a3ead749d4f87ab6f2750bed58


[ROCm/ROCR-Runtime commit: b4f26534eb]
2022-10-25 22:38:47 +00: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
David Yat Sin 8b9275bb36 Early return for invalid pointer queries
If a user queries the pointer info on an invalid pointer,
hsaKmtQueryPointerInfo will return error or unknown pointer. The other
fields in HsaPointerInfo are invalid, so we do not return them to the
user.
Also removing the assert and returning unknown pointer instead. As the
assert will not trigger in release builds.
hsaKmtQueryPointerInfo may also return unknown pointer for userptrs as
they are not always tracked by thunk. Adjusting code to still treat
these pointers as valid in this case.

Change-Id: Idf5cd8b61cd532d31b072f449839d223369bb138


[ROCm/ROCR-Runtime commit: 18547173e9]
2022-10-21 15:28:48 -04:00
Freddy Paul 993b1dee7e Remove RPATH/RUNPATH from ROCm libraries
:Since all public interface libraries are present in
same folder RUNPATH/RPATH is not required in the library itself.
Application shall provide the required RPATH/RUNPATH to load all
libraries.

Change-Id: I1d1ba920bf291eb89bd1f4c0fd0cfd80c7d739bd


[ROCm/ROCR-Runtime commit: ac66865385]
2022-10-21 11:05:06 -04:00
David Belanger 9f2c88c46a Initial changes for gfx1101, based on gfx1100/gfx1102 implementation.
Change-Id: I949c1027ccabf38b4f924590e42e7327dc550f73
Signed-off-by: David Belanger <david.belanger@amd.com>
Reviewed-by: Jonathan Kim <jonathan.kim@amd.com>


[ROCm/ROCR-Runtime commit: a0d3db6e8d]
2022-10-13 09:28:39 -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
David Yat Sin f5dc99bf9e Use user requested size for memory fragments
Amount of memory requested by user may be aligned-up internally to
the memory pool granularity. The extra padded memory should not be
considered when validating pointers from the user. Also return the
user requested size when user queries pointer information.

Change-Id: I28b25448ea03c836b44fafdb34b7330cf6887424


[ROCm/ROCR-Runtime commit: 39632a713e]
2022-10-07 21:32:49 +00:00
David Yat Sin 2affd1a1f6 Fix compile warnings and remove unused variables
Change-Id: I7acaee5e9cf218b358ffaf0e3af6067faf6f3d2a


[ROCm/ROCR-Runtime commit: 9cb10a3dd8]
2022-10-06 10:11:17 -04:00
Yifan Zhang 519d3be5ea Adjust the passing value for GPU agent when do max single allocation test
For APU asics, the default configuration size of video memory is
relatively small, while the reserved region becomes larger in recent
generation asics, ratio of max alloc size to the pool size may below
the expected value, so adjust it.

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: I0e847c4c13e957cf6e811d3f379842619cf53370


[ROCm/ROCR-Runtime commit: f05770610c]
2022-10-05 22:16:58 -04:00
Sean Keely 689e9ce6a4 Correct limit query return type to match spec ABI.
Change-Id: I2eeed1f4b79d10c7d9ab0fd36c0146063053c76a


[ROCm/ROCR-Runtime commit: 7826d4ca2d]
2022-10-04 01:48:26 +00:00
Jeremy Newton b22add5052 Implement RPM Recommends for libdrm
What we want for libdrm-amdgpu is for it to be a recommended package.
Either libdrm or libdrm-amdgpu can be used, but we recommend the latter.

Using "SUGGESTS" does not seem like a strong enough requirement, but
CPACK does not support RPM recommends. Although, it does allow
customizing the RPM SPEC file template. By generating a template, which
is done by setting:

-DCPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1

This template file can be trivially modified to allow adding a line to
implement CPACK_RPM_PACKAGE_RECOMMENDS.

Fixes 

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


[ROCm/ROCR-Runtime commit: 1621936e32]
2022-10-03 12:42:51 -04: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
David Yat Sin 434b412a72 Add .kd to symbol kernel name for Binary Search sample
Fix Binary Search sample code as kernel symbol name has a .kd
extension.

Change-Id: Id21d2e432faa40bcd5cf343345502e823678fd0f


[ROCm/ROCR-Runtime commit: d9935e6fba]
2022-09-12 16:17:04 -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
David Yat Sin d15ac8fbca Fix uninitialized variable warning
Fix warning when using valgrind

Change-Id: Ie59eaa990b9b5d339a178a2c6f9f4fac0e34e925


[ROCm/ROCR-Runtime commit: dd255d31b8]
2022-09-08 09:10:00 -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
David Yat Sin 0e5b9c22b1 Disable automatic dependency for rocrtst RPM
Disable automatic dependency detection when generating rocrtst RPMs.
This was adding unnecessary dependency on libhwloc, which is now
provided with the rocrtst package.
This matches behavior for DEB packages where there is no dependency
list for rocrtst.

Change-Id: If4a93f5b4c039b2f45e9445f60f65eefe84e32eb


[ROCm/ROCR-Runtime commit: e2388f242a]
2022-09-06 15:05:40 -04: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