Commit Graph

825 Commits

Author SHA1 Message Date
Shweta Khatri 4effeb8f9f Fix heap-buffer-overflow error in Memory access test. Also reverted most of first array element from 0 to 1 changes.
Change-Id: I62dee9bab379210a322848132e2846dc153724d9


[ROCm/ROCR-Runtime commit: 539ec6a87d]
2022-04-21 12:09:58 -04:00
Jeremy Newton 9e346a1c58 Drop some unnecessary definitions
__x86_64__ and __AMD64__ should be already defined by the compiler to
specify the compilation target and shouldn't be defined manually.

I fixed two x86_64 checks to include VS variables, as removing this
might cause it to fail to compile on that compiler.

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


[ROCm/ROCR-Runtime commit: 178a7a5cfa]
2022-04-19 12:22:42 -04:00
Jeremy Newton feba682013 Use CMAKE_INSTALL_*
Instead of installing to lib or include, use CMAKE_INSTALL_LIBDIR and
CMAKE_INSTALL_INCLUDEDIR to allow the builder to override if desired.

The default LIBDIR should be "lib" to avoid breaking ROCm packaging, but
using GNUInstallDirs would use lib64 on RHEL. By setting a default value
prior to including GNUInstallDirs, we can always use "lib" unless the
builder explicitly overrides it via "-DCMAKE_INSTALL_LIBDIR", which is
typical in most distro scripts.

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


[ROCm/ROCR-Runtime commit: ddf4edcafc]
2022-04-19 12:22:42 -04:00
Jeremy Newton 3d0b0fd774 Only default IMAGE_SUPPORT=ON for x86
Image support does not compile on other archectures, since it relies on
the x86 only header "x86intrin.h".

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


[ROCm/ROCR-Runtime commit: a0931f4a3c]
2022-04-12 09:24:45 -04:00
Konstantin Zhuravlyov 625b1c99b3 Add code object v5 support
Change-Id: I03522765056e99ed49e6c5e213ee3753852de27b


[ROCm/ROCR-Runtime commit: 9265409f08]
2022-04-12 08:53:27 -04:00
Sean Keely 6622fe0163 Revert "Release host buffers after segment freeze."
This reverts commit cf3f441625.

Change-Id: Idc7e568b2b54a226dbe4d189b25a78be3bd16eea


[ROCm/ROCR-Runtime commit: b3caf6782b]
2022-04-11 20:43:07 -05:00
Sean Keely 16efad0cdc Correct inf loop defect in fast clock init.
Each time delay is grown we need to reset elapsed.  We want to take
the most accurate sample from the set at fixed delay.

Without this we will hang if there is ever an insufficiently accurate,
high unit clock read.

Change-Id: Ic65f364067789ac85a6572d67af2d77528e265bb


[ROCm/ROCR-Runtime commit: 4e9849034d]
2022-04-01 16:15:37 -04:00
Sean Keely cf3f441625 Release host buffers after segment freeze.
Release staging buffers after loading has completed.  The debugger
no longer uses this copy.

Change-Id: I46f36b50033bebe5a9ebc648b291d46f1d09b21d


[ROCm/ROCR-Runtime commit: 03a52655a8]
2022-03-23 23:53:02 -05:00
Sean Keely b7afebc27f Correct loader memory interfaces.
The loader must use internal interfaces to access page allocation
flags.  Code pages should also ensure use of cached memory.

Also relocate i-cache flush after code page copy.

Change-Id: I86d36243b6eebb1d46b991b372a5236baaf941ab


[ROCm/ROCR-Runtime commit: 048700f2e7]
2022-03-23 23:52:56 -05:00
Sean Keely f875298836 Correct queue error reporting.
VM faults should not report via the queue error handler.
The system event contains much more useful information.

Change-Id: I744d9b97b23334d7ed2c0f450111c1b8032567e3


[ROCm/ROCR-Runtime commit: fbc48521dc]
2022-03-23 23:37:53 -05:00
Sean Keely 60191a659b Ignore hive id for CPUs when selecting copy paths.
Hive ID is used during copy path selection to locate an optimal
pool of SDMA engines.  However, for CPU-GPU connections we always
want to use the host port facing engines, known generally as the
PCIe optimzed engines.  We want this selection even when the
connection is XGMI hence dropping the hive id for CPUs.

Change-Id: Iffe44174afecfc0bb3272b806fce549c930a49d9


[ROCm/ROCR-Runtime commit: af0f90800d]
2022-03-18 18:48:44 -05:00
Sean Keely 2be7abd7e1 Revert "add gfx1036 support"
Compiler is not promoted to mainline yet.

This reverts commit 7dcccdf452.

Change-Id: I7256aeb3698ee3ae640a9f457a929abe24d5ef17


[ROCm/ROCR-Runtime commit: 7e73760cd0]
2022-03-18 02:35:01 -05:00
Sean Keely 8c1fad3f12 Disable warnings as errors for rocrtst.
Change-Id: Ibe76c4c7f20fc0273dd02038477e7f9fc7800a3d


[ROCm/ROCR-Runtime commit: 7ab0d786c2]
2022-03-11 17:55:55 -05:00
Yifan Zhang 7dcccdf452 add gfx1036 support
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: I075779b1369fde759c29572fa2027a3748d6ed4c


[ROCm/ROCR-Runtime commit: 2f97f17df9]
2022-03-05 13:16:19 +08:00
Sean Keely 47e1632188 Do not allow occupancy restriction on cooperative groups.
Excessive scratch allocations can normally trigger occupancy
reduction.  This breaks cooperative groups so if occupancy
reduction is required on a cooperative dispatch fail with OOM.

Change-Id: I64612a2e38bf1286f3b74c1c2a68ab0c85452771


[ROCm/ROCR-Runtime commit: 8a6954c63c]
2022-03-02 19:59:30 -06:00
Sean Keely c58913a8c8 Correct scratch allocation logic to account for asymmetric harvest.
With asym. harvest hw does not issue groups equally to each SE,
occasionally hw will skip an SE so that the distribution reflects
each SE's CU count.  Scratch resources must be allocated to reflect
this asymmetric distribution of groups.

Change-Id: I65e26206500483ea18e6e8796e65ecba5354b029


[ROCm/ROCR-Runtime commit: 552dcead93]
2022-03-02 19:59:30 -06:00
Sean Keely c196acd677 Do not bump up total scratch size for large cached allocations.
HW does not ignore low bits of the scratch wave count and will
stride beyond the end of the allocation if the wave count is
ever indivisible by SE count.  Rather than returning the allocation
size for cached large scratch allocations, use the requested
scratch size in scratch setup.  Scratch cache will retain the
cached allocation's size.

Change-Id: I0129ddc99a8940d01d8fbcd0b02d5061f31f456d


[ROCm/ROCR-Runtime commit: cedc3e80a8]
2022-03-02 20:48:19 -05:00
Saravanan Solaiyappan 66a81cc965 Consider apt/yum upgrade operation check in package scripts.
Include the upgrade operation check in the prerm and postun scripts
in package.

Signed-off-by: Saravanan Solaiyappan <saravanan.solaiyappan@amd.com>
Change-Id: Ic766d8d68b5168e5f1b065d846ca2604d281e5be


[ROCm/ROCR-Runtime commit: a496adafaa]
2022-02-24 10:26:04 -05:00
Sean Keely 523e6e883a Do not discard fragment allocator blocks multiple times.
discardBlock may be called multiple times on the same block.
We must not discard the block multiple times or we will corrupt
in-use memory accounting.

Change-Id: Ife9f3162785965a795dcf81887d4d447cc096e62


[ROCm/ROCR-Runtime commit: b9a0c1d313]
2022-02-10 18:39:46 -06:00
Sean Keely 305b7394b3 Add fallback case for cache line size.
KFD sometimes returns 0 for cache line sizes.

Change-Id: If82de0068318bbc138f0d1d4692ff908359174ad


[ROCm/ROCR-Runtime commit: 266cd68524]
2022-02-10 18:39:46 -06:00
Sean Keely ab97440eba Retrieve cache line size from KFD topology.
Change-Id: I16ddd9d9888bb973eccf3c562619894c88c7df15


[ROCm/ROCR-Runtime commit: 21291b48c6]
2022-01-16 08:44:44 -06:00
Sean Keely 0e96cb895f Correct queue minimum size enforcement.
Minimum queue size was not enforced at the Agent level.  Minimum
size should be one page to give unifority across all asics.

Change-Id: I26394f79458d09fbceb79fc8aaf495e2c26a8ff3


[ROCm/ROCR-Runtime commit: a6742209f7]
2022-01-16 08:28:34 -06:00
Sean Keely 92f675889c Improve scratch error detection in debug mode.
Adds asserts for invalid dispatch dims and scratch requests that
don't actually use scratch.

Change-Id: I6e6eef3f17dc38adaf96550fa55bd8625868efa3


[ROCm/ROCR-Runtime commit: a65f3f5b71]
2022-01-31 20:53:24 -05:00
Sean Keely e2e10173d2 Add HSA_AMD_AGENT_INFO_COOPERATIVE_COMPUTE_UNIT_COUNT.
On gfx90a only a reduced number of CUs must be used for cooperative
dispatches due to CWSR and launcher interactions with asymetric
harvest.  We must use one fewer CUs per SE than the lowest count of
CUs on any SE.

Also adds env var HSA_COOP_CU_COUNT which enables the cooperative
CU count computation.  Set to 1 to enable the new computation.
This is an opt-in feature that will become enabled by default (opt-out)
in a future release.

Change-Id: Ifbb75ced3bbc15876eef44922c6a4f6fde8c4c28


[ROCm/ROCR-Runtime commit: 37942c982a]
2022-01-31 15:22:07 -05:00
Chen Gong df788f1e49 Correct the gfx version of gfx90c to 90c
Corrections have been made in libhsakmt, and corresponding changes are required here as well.

Signed-off-by: Chen Gong <curry.gong@amd.com>
Change-Id: Ib697ce25278c2c5ac6ef0206930ec285f46c60d1


[ROCm/ROCR-Runtime commit: dec63b4f15]
2022-01-25 19:05:46 +08:00
Jeremy Newton f654b7d852 Install license file
See 

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


[ROCm/ROCR-Runtime commit: bd1a4adf35]
2022-01-17 10:54:54 -05:00
David Yat Sin 4fb019555b Fix for segfault after removing PrefetchRange from map
The start iterator becomes invalid after it is removed from
std::map prefetch_map_. This was causing a segfault when the iterator is
incremented afterwards.

Signed-off-by: David Yat Sin <david.yatsin@amd.com>
Change-Id: I4b0b763d2cb4ee99c0b8571c2c526b834e74077a


[ROCm/ROCR-Runtime commit: 86164fbfec]
2022-01-10 17:47:02 -05:00
Sean Keely ef1f4724c3 Correct documentation typo.
ROCM_VISIBLE_DEVICES was used where ROCR_VISIBLE_DEVICES was
intended.

Change-Id: I644a546f3c9dd0b50898ef8a21dbb8f5c3a36926


[ROCm/ROCR-Runtime commit: fce6ba052e]
2021-12-10 16:19:30 -06:00
Sean Keely 3227859ff2 Rework memory locks to allow device parallelism in alloc/free.
Prior solution used a single global lock to protect the memory tracking structures.
This change protects the memory tracking structure with a shared mutex (rw lock) in
shared (r) mode for memory allocations and frees so that long duration processes,
calling to kfd, can be done in parallel.  Operations which must modify the memory map
take the mutex in exclusive mode (w) and must not call to the thunk while holding
the mutex.

The fragment allocator now requires separate protection and is protected with a
mutex at the device level.  Protecting at the device level, rather than pool,
allows retention of the current recursive design and allows calling Trim from
withing Allocate.  This could be made finer (pool level locks) but would
require backing out of Allocate entirely to call Trim.  Trim and any retried
Allocation must be done in isolation (per device) or we may report OOM when
memory is actually available in some pool's fragment cache.  So some device
level serialization is required in at least some paths.

Change-Id: I7c1e94d6965ffcc602b12fefdd3a6e97b84b5e00


[ROCm/ROCR-Runtime commit: df55cb0450]
2021-11-24 19:22:05 -06:00
Sean Keely e462118b6e Add comments to GetPcieBlit.
Comments call out the specific operation being selected since the
ternary nest is a bit hard to read.

Change-Id: If033dbaa6cba132e96196ad3fc6d5572042041f4


[ROCm/ROCR-Runtime commit: fc75731034]
2021-11-15 19:34:03 -06:00
Sean Keely 01c7c9856c Fix leak in hsa_amd_interop_map_buffer.
Agent temp array could have leaked if one of the given agent
handles was invalid.

Change-Id: I9e638b3a4f6bb917a4e3209ad81a1253bb603365


[ROCm/ROCR-Runtime commit: b198016949]
2021-11-15 19:22:20 -06:00
Sean Keely 289cc7b6b4 Correct order of argument check and default assignment in lock APIs.
Argument must be checked for nullptr before being dereferenced and
filled with the default return value.

Change-Id: I9ff366f066a5e18c78129bf59cc3ba00fca3ef18


[ROCm/ROCR-Runtime commit: f48a786662]
2021-11-15 19:22:02 -06:00
Sean Keely a7dc6d7802 Add missing return in ScopeGuard::operator=.
This omission did not cause problems earlier due to having not been
instanced.

Change-Id: I7a54f82e06c299902f3bf6b4d3737cc5e30961ad


[ROCm/ROCR-Runtime commit: 322588a60e]
2021-11-15 18:50:46 -06:00
Sean Keely c8bb2905d3 Correct node id assertion in pointer info.
Size of the node map was used as the max node id previously.  This
is wrong when RVD is used.

Change-Id: Ic632ec96891b92186e5b68cd53f81414db34f59f


[ROCm/ROCR-Runtime commit: 19454fcf26]
2021-11-10 22:09:24 -06:00
Sean Keely 0ed7eac560 Correct size of SVM node array.
Was size of the map.  Needs to be size of the node id range.

Change-Id: I92501ea7adca5c30dbb0fdabd2c421dea58f8d6f


[ROCm/ROCR-Runtime commit: c9eb85e205]
2021-11-10 21:23:42 -06:00
Sean Keely 847df17afe Include event_id in SDMA interrupt payload.
The event id assists KFD in locating the proper event associated
with the interrupt.

Change-Id: I75d58b6be74dd5b1edb0c5fe2b9d01538a649ba1


[ROCm/ROCR-Runtime commit: d65e00bcc5]
2021-11-10 20:57:11 -06:00
Jeremy Newton a056bc52dd Set License field for RPM package
This really should be set to conform to distro standards.

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


[ROCm/ROCR-Runtime commit: 48e4e2c5ff]
2021-11-10 14:06:17 -05:00
Aaron Liu 8de1148504 Fix compiling error with gcc-10.3.0
On gcc-10.3.0 environment, hsa-runtime building is failed as below log:
compute/hsa/runtime/rocrtst/suites/negative/queue_validation.cc:470:18: error: conversion from ‘unsigned int’ to ‘uint16_t’ {aka ‘short unsigned int’} changes value from ‘4294967295’ to ‘65535’ [-Werror=overflow]
  470 |     aql().header |=  0xFFFFFFFF << HSA_PACKET_HEADER_TYPE;
      |     ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/rocrtst64.dir/build.make:339: CMakeFiles/rocrtst64.dir/home/aaliu/work/compute/hsa/runtime/rocrtst/suites/negative/queue_validation.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....

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


[ROCm/ROCR-Runtime commit: f2a50c34f9]
2021-11-04 10:55:11 +08:00
Sean Keely 3cfaebf4e8 Correct rocrtst cmake.
Generates symlinks exactly once.
Admits parallelism to code object compilation.
Adds proper dependency tracking.
Adds code object files to the packages.

Change-Id: If471961906f16a2ffdc6bf5f682a4e322fb38f3e


[ROCm/ROCR-Runtime commit: 402eae11b6]
2021-10-18 11:10:50 -04:00
Sean Keely eabb4ba4b4 Correct rocrtst pool iterator.
GetGlobalMemoryPool had improper return codes for an iterator callback
and did not properly order the APU pool selection path.

Change-Id: I01ab9d23e2352be98d9718bc25889ad4f779d3ca


[ROCm/ROCR-Runtime commit: 534dc3f60c]
2021-10-16 05:02:05 -04:00
Sean Keely f5fcc610b7 Silence Clang warning.
Clang warns about bitwise operators on bools.  Cast to int silences
the warning without introducing short circut logic.

Change-Id: I6e25138e1acf4a5562d3925ea5b2fcef3addb783


[ROCm/ROCR-Runtime commit: 4b0c94cfe8]
2021-10-14 23:56:58 -05:00
Sean Keely 2a0cdb73f3 Drop -Werror.
Would be nice to get warning count changes highlighted in CI though.

Clang's increasingly suspect diagnostics has caused multiple build
breaks without highlighting any actual issues.
Also: https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/

Change-Id: I7dc82da58cd86f7b4f1a9fb511c4c039419271d4


[ROCm/ROCR-Runtime commit: efeee734db]
2021-10-14 23:54:45 -05:00
Sean Keely 0116378a99 Skip inital CU mask setup unless HSA_CU_MASK is defined for the GPU.
Limits CU masking application to cases where it is explicitly requested.

Change-Id: Ib65ad0ac98f86d840c0328fa15ce40c05cd4bfae


[ROCm/ROCR-Runtime commit: 5e8d261352]
2021-10-12 20:31:56 -05:00
Freddy Paul 8d550d9cbe Cleanup symlink to header files and folders
Due to a CPACK bug the package needs to remove header file
symlinks.  Cleanup is required for uninstall and upgrade
since each release installs to a different folder.

Change-Id: I5ec378b21e69235404781c7bce3c0203eb38eed1


[ROCm/ROCR-Runtime commit: ca899ea429]
2021-10-12 14:56:02 -05:00
Sean Keely f19e8c43d2 Remove io_link workarounds.
KFD topology has been corrected and the defaults used by this
workaround are no longer true for all chips.

Change-Id: I0242d8077e9666ed1cf0dc3985244258ae5c0924


[ROCm/ROCR-Runtime commit: 19c1e92b4c]
2021-10-11 19:15:07 -05:00
Xiaomeng Hou d64a353ea0 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, plus the reserved region, ratio of max alloc size to
the pool size may below the expected value, so adjust it.

Change-Id: I798b44d9532aa6a381a1cc19faa5a46110bf0ad6


[ROCm/ROCR-Runtime commit: df59bfd57b]
2021-10-11 02:32:09 -04:00
Xiaomeng Hou a29a2e96e5 Add gfx1035 to rocrtst.
Change-Id: I276942b8badfd5ee2914e78c6c140d80d7cf4b2d


[ROCm/ROCR-Runtime commit: 9597fe3ae5]
2021-10-11 02:31:45 -04:00
Sean Keely 1d060cbb9e Correct GetSvmAttrib coherency query.
Early exit if the range is found to be fine grain.  Indeterminate
should only apply if the range is neither coarse nor fine.

Change-Id: I54133e14f4e8cfa53e2d612f6112cdcdb5a47dfa


[ROCm/ROCR-Runtime commit: a2fb1cbfbc]
2021-10-03 12:29:12 -04:00
Sean Keely 32af428b24 Fix queue leak in Enqueue Latency test.
Change-Id: I50d17fb23d772ae8b966207f4af038ca538dcbb8


[ROCm/ROCR-Runtime commit: c9440e7b11]
2021-10-03 12:27:49 -04:00
Sean Keely 94352f3e24 Close KFD when failing due to debugger state.
Change-Id: I6a6890fd9e86d27f87ae96de1c47c89d40a4e010


[ROCm/ROCR-Runtime commit: 234ef77e32]
2021-10-03 12:27:49 -04:00