Commit graph

2930 Commits

Autor SHA1 Nachricht Datum
Kent Russell af55f02fab CMakeLists: Fix libdrm-amdgpu dependencies
SUGGESTS doesn't get installed by default by dpkg, it requires
--install-suggests. While the libdrm-amdgpu-amdgpu1 lib might not be
critical to core thunk usage, it's necessary enough to increase the
dependency from weak to strong, thus we use RECOMMENDS instead

Since CPack doesn't support RECOMMENDS for RPMs, and SUGGESTS isn't
strong enough, we just set it as REQUIRED. This should handle any
standard installation situations instead of trying to be fancy to try to
make things exactly the way we want them to be.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I5a676fb4a3fbf5c7b35f503acc30cf01c056266d


[ROCm/ROCR-Runtime commit: 9529bf7063]
2021-11-10 17:23:31 -05: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
Jeremy Newton a24619cf14 Set License field for RPM package
This really should be set to conform to distro standards.

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


[ROCm/ROCR-Runtime commit: fa2309fcdd]
2021-11-10 13:56:33 -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
Kent Russell e4654b99e1 CMakeLists: Refer to libdrm-amdgpu1 for RPM distros
The infra is in place to make sure that we can get around the issue
where older versions of rpm don't know what "Suggests" is. Using the
HSAKMT_REQUIRES_LIBDRM variable will force the package to require
libdrm-amdgpu1 instead of just suggesting it in newer distros.

Change-Id: I5d595c4e4be5ad8e8c411dcec3a58365e1984f05


[ROCm/ROCR-Runtime commit: 7e90eef254]
2021-11-03 13:44:48 -04:00
Philip Cox eef3f372f2 libhsakmt: Add more debug information
We need to add some more information about the debug features supported
by the platform.  We are adding the following:
        - debug supported
        - dispatch info always valid
        - precise memop supported
        - watchpoints shared

Change-Id: I68deed98619396d17e28c6e18bad424b58297485
Signed-off-by: Philip Cox <Philip.Cox@amd.com>


[ROCm/ROCR-Runtime commit: 489db9fac6]
2021-10-22 13:49:34 -04:00
Kent Russell 77a4f81410 kfdtest.exclude: Remove KFDEvictTest.QueueTest on GFX10
Since it's shader-based, the GFX9 shader won't work for GFX10. Blacklist
it for now until we move to a more ASIC-agnostic shader

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I353e9a3fe8c7ba6f33556e39c7e4f6b36e010480


[ROCm/ROCR-Runtime commit: 2801342048]
2021-10-19 08:08:15 -04: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
Kent Russell b990a7671e CMakeLists: Refer to libdrm-amdgpu1 for DEB
This is required for Marketing Name, but Marketing Name isn't a hard
requirement for ROCT, so make it a Suggested package for DEBs.

Adding a commented-out possible solution for RPM-based distros, as
unfortunately SLE <10 and CentOS/RHEL <8 don't know what "SUGGESTS"
means. Potentially we will add a check that the build environment
that determines if we require the REQUIRES field to be used.
Hopefully we can work out the RPM side quickly, but for now enable
SUGGESTS on DEB as a start

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: Icea689a14c185964e7f47fb23ee432f9b35ccb03


[ROCm/ROCR-Runtime commit: f7e90798a0]
2021-10-14 13:20:29 -04: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
Kent Russell 11cc6f4f79 kfdtest.exclude: Add KFDEvictTest.Queuetest back to gfx1030's blacklist
The shader is incompatible with gfx1030, so blacklist it there until we get
to some more ASIC-agnostic shader generation

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I71f362a80e6e8f87ecece6afa6b34a5f02bc56bf


[ROCm/ROCR-Runtime commit: 5a8c9a54f1]
2021-10-08 13:09:01 -04:00
Sean Keely d72b8ef7d3 Check errno for error type in hsaKmtAllocQueueGWS.
Check errno rather than err and drop negation.

Change-Id: I1804d67292c3b054eab8fc077c8e9b22a8cdcc9f


[ROCm/ROCR-Runtime commit: 5e3983cb93]
2021-10-06 15:08:28 -04:00
Sean Keely fe5fee87f3 Check errno rather than return from kmtIoctl in hsaKmtRuntimeEnable.
The return code is just -1 if any error occurs.  To detect debugger
unavailable we need to check the actual ioctl error code.

Change-Id: I8a294c754196aec916809497ec8e810da2f072b8
Signed-off-by: Sean Keely <Sean.Keely@amd.com>


[ROCm/ROCR-Runtime commit: b67bc6fcc9]
2021-10-06 15:07:22 -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
Philip Yang 098ce2acb4 libhsakmt: register and deregister userptr in parallel
For userptr, after taking aperture lock, decrease registration_count and
ensure object registration_count equal to 0 to release KFD and thunk
object.

Move decrementing of registration count from fmm_deregister_memory into
__fmm_release to avoid a race condition when dropping the aperture lock
in fmm_deregister_memory.

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


[ROCm/ROCR-Runtime commit: f82927ad65]
2021-10-01 15:56:38 -04:00
Philip Yang f2d3dbb28e kfdtest.exclude: KFDSVMRangeTest.ReadOnlyRangeTest to blacklist
This test requires KFD patch "drm/amdkfd: SVM map to gpus check vma
boundary" to pass, the patch is on staging-dkms branch, not land on
mainline branch. Temporary blacklist this to unblock QA, as QA reports
kfdtest failure.

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


[ROCm/ROCR-Runtime commit: 5adb142dc7]
2021-10-01 15:56:38 -04:00
Sean Keely e0ebcb9cc3 Workaround gfx90a SDMA0 quirk.
Because of sharing ports with other engines, the
hardware design team has advised that SDMA0 on gfx90a
should only be used for host-to-device data transfers.
The recommendation is to use SDMA1 for any device-to-device
or device-to-host data transfers.

A driver change will ensure that, for each gfx90a
device, only the first PCIe SDMA queue a process
requests will possibly be from SDMA0. This patch ensures
that the first PCIe queue requested (which may be from
SDMA0) is always set up for host-to-device.

Change-Id: I6793ca95596dedaed9d5be1dbd9469ceef2a5c33


[ROCm/ROCR-Runtime commit: 280a458d0c]
2021-09-30 05:53:49 -04:00
Kent Russell 8cfbef3cd7 kfdtest.exclude: Re-enable KFDEvictTests that were blacklisted
After adjusting the memory usage, re-enable KFDEvictTest.BasicTest on
gfx906 and KFDEvictTest.QueueTest on GFX10

Change-Id: I401e679e447f3150241078154635f0b30692513d
Signed-off-by: Kent Russell <kent.russell@amd.com>


[ROCm/ROCR-Runtime commit: 392e0e2afc]
2021-09-29 13:57:17 -04:00
Kent Russell 29a10ec919 kfdtest: Adjust KFDEvictTest memory size
We were hitting memory map errors and segfaults when trying to use 7/8
VRAM on certain cards (dmesg showing "Failed to map to gpu 0/1"), as the
original check didn't see if this would exceed the GTT size.
Allocate the smaller of 1/3 of SRAM or 7/16 of VRAM (7/8 / 2) for the
tests

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: Ic11a5cee058535418eef903a28846e00e1839969


[ROCm/ROCR-Runtime commit: d5d8c022f1]
2021-09-29 13:56:54 -04:00
Yifan Zhang 66e9054dce kfdtest.exclude: blacklist several tests case for gfx902
SDMA firmware of gfx902 has a regression which causes cp hang
in kfdtest, blacklist related test cases.

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


[ROCm/ROCR-Runtime commit: 04b149b7fd]
2021-09-24 21:57:54 -04:00
Aakash Sudhanwa 2948c1f2cc Revert "CMakeLists: Make libdrm-amdgpu1 a suggestion"
This reverts commit 919cd43da5.

Reason for revert: Breaking on Centos7

Change-Id: Ibd5a7c5d4e8c07defec45821ae1faa525cfc916d


[ROCm/ROCR-Runtime commit: 06b1f25172]
2021-09-24 16:35:53 -04:00
Sean Keely 3e062a0424 Correct typo in package dependencies.
Change-Id: I3c378479ceb822e55168517e041a48fa8a2d3d98


[ROCm/ROCR-Runtime commit: e0224ad89f]
2021-09-20 21:00:15 -05:00
Sean Keely 7226c26b43 Correct Clang version detection and support for multiple prefix paths.
Bumps cmake minimum version to 3.7 for version comparison operator.

Previously the Clang cmake project version strings were used.  These
are not defined if the clang cmake project has not been loaded.
We should use CMAKE_CXX_COMPILER_VERSION to check the version when
only the compiler binary is redirected and the project files are
not available.

Also adjust device libs lookup logic to handle multiple paths in
CMAKE_PREFIX_PATH.

Change-Id: I67b6958d8241685cd6c3a0af68507c9fdc6331ef


[ROCm/ROCR-Runtime commit: 2e9a9f7c7a]
2021-09-20 19:23:04 -05:00
Kent Russell 919cd43da5 CMakeLists: Make libdrm-amdgpu1 a suggestion
This is required for Marketing Name, but Marketing Name isn't a hard
requirement for ROCT, so make it a Suggested package

Change-Id: Ibafcce2c59dc8bdba90c171e766122bebf548a48
Signed-off-by: Kent Russell <kent.russell@amd.com>


[ROCm/ROCR-Runtime commit: 4144a0d2a4]
2021-09-17 10:11:45 -04:00
Sean Keely 10a8c8b556 Add debug option to skip setting the initial cu mask.
Adds debug variable HSA_CU_MASK_SKIP_INIT.

Change-Id: I5c742d1184a36fdef818bc50c3b780b859b68560


[ROCm/ROCR-Runtime commit: a8c3ea82a4]
2021-09-16 23:43:49 -05:00
Sean Keely a02b318a7e Correct fast f16 capability reporting.
Was hard coded to false.  Updated to reflect f16 availablity since
gfx8.

Change-Id: I7d5b9792c8e0163199c421a61b5d49b25cd98645


[ROCm/ROCR-Runtime commit: 5535b1f86f]
2021-09-16 21:15:52 -05:00
Philip Yang c90f3f2648 kfdtest: MigrateFileBackedRangeTest address sanitizer builds failing
Use alloca to replace variable size array.



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


[ROCm/ROCR-Runtime commit: 88e6921d45]
2021-09-16 10:51:56 -04:00
Kent Russell e9a71840e8 kfdtest.exclude: Remove KFDSVMEvict from GFX10
This was never validated on GFX10, so remove it for now until it's
either validated and confirmed, or move the check to the test itself

Change-Id: Ie4d8b31885fbe6e5ed84b7b174c0bfed60879741


[ROCm/ROCR-Runtime commit: f2f86591b6]
2021-09-15 11:34:05 -04:00
Yifan Zhang cb379004ea libhsakmt: dump errno the queue destroy fails.
to faciliate debugging, print errno when queue destroy fail
current log give very little information when fail:

[ RUN      ] KFDQMTest.AllSdmaQueues
 [          ] Regular SDMA engines number: 1 SDMA queues per engine: 2
 [       OK ] KFDQMTest.AllSdmaQueues (11 ms)
 [ RUN      ] KFDQMTest.AllXgmiSdmaQueues
 [          ] XGMI SDMA engines number: 0 SDMA queues per engine: 2
 [       OK ] KFDQMTest.AllXgmiSdmaQueues (6 ms)
 [ RUN      ] KFDQMTest.AllQueues
 /home/foreman/build/hsakmt-roct-amdgpu-1.0.9.40500/sources/libhsakmt/tests/kfdtest/src/KFDQMTest.cpp:381: Failure
 Value of: (cpQueues[i].Destroy())
   Actual: 1
 Expected: HSAKMT_STATUS_SUCCESS
 Which is: 0

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


[ROCm/ROCR-Runtime commit: db1d6d92ab]
2021-09-15 04:34:58 -04:00
Oak Zeng f590465aa3 Add gfx1013 support
Change-Id: I7122caea3ef2254b50bde25ec545116685452116
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>


[ROCm/ROCR-Runtime commit: 80206af91e]
2021-09-15 01:10:20 -04:00
Sean Keely b1fb887b40 Add gfx1013 to rocrtst.
Change-Id: I49c4aafc661d7c2ba6fd6baa006bf698b0af5274


[ROCm/ROCR-Runtime commit: 8d789461bf]
2021-09-14 22:55:43 -04:00
Sean Keely 2537a8b1c2 Place GPU local resources in nearest NUMA node.
For minimal latency we should place command queues and blit code
in the nearest numa node to each GPU.  Add an allocator matching
the current runtime default allocator interface to each GpuAgent
that allocates on the closest numa node as represented by kfd
topology.  Use this allocator for queue ring buffers and blit
objects.

Change-Id: I181127f9c27bafe68976312963146616e3f58369


[ROCm/ROCR-Runtime commit: 5af558f739]
2021-09-14 17:49:24 -04:00
Philip Yang a6335e1ae2 libhsakmt: fix multiple threads register userptr race v2
After calling ioctl to create userptr obj, take aperture lock, check if
there is same userptr obj created after finding object, to catch the
race that multiple threads register same userptr to multiple GPUs.

If same userptr obj exist, then increase userptr registeration_count,
and free the newly create obj.

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


[ROCm/ROCR-Runtime commit: 8f7443494a]
2021-09-14 12:36:36 -04:00
Philip Yang 35f00d04ff Revert "libhsakmt: fix multiple threads register userptr race"
This reverts commit f94be2078c.

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


[ROCm/ROCR-Runtime commit: a809a5bf32]
2021-09-14 12:36:36 -04:00
Philip Yang 84c5489f39 Revert "libhsakmt: Fix deadlock in map_mmio"
This reverts commit 559bb50c6a.

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


[ROCm/ROCR-Runtime commit: 91b0fce535]
2021-09-14 12:36:36 -04:00
Philip Yang 7f7a7dfd3d Revert "libhsakmt: Fix deadlocks in __fmm_release"
This reverts commit 14d821391e.

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


[ROCm/ROCR-Runtime commit: 445fcd803b]
2021-09-14 12:36:36 -04:00
Philip Yang 6e0aa72a89 kfdtest: add KFDSVMRangeTest ReadOnlyRangeTest
Map readonly range to GPU, test GPU can read range but write to
range trigger GPU vm fault.

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


[ROCm/ROCR-Runtime commit: f9648c5014]
2021-09-14 12:36:35 -04:00
Philip Yang 2d80a00201 kfdtest: add KFDSVMRangeTest MigrateFileBackedRangeTest
To test if SVM support address mmap on file backed memory.

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


[ROCm/ROCR-Runtime commit: d91f92669b]
2021-09-14 11:59:23 -04:00
Kent Russell fa6f6e94b4 Revert "Revert "Get Marketing name from libdrm-amdgpu""
This reverts commit 8f735fb9d5.

Reason for revert: aqlprofile has merged

Change-Id: Iee0fbe8ac1e475123273b328949f68f10490d3ca


[ROCm/ROCR-Runtime commit: 268bb1ae84]
2021-09-01 07:44:23 -04:00
changzhu 13c2ad6508 libhsakmt: fix KFDOpenCloseKFDTest.OpenAlreadyOpenedKFD Segmentation fault on gfx902
g_props is intialized in topology_take_snapshot which needs to call
hsaKmtAcquireSystemProperties. In hsaKmtOpenKFD, it doesn't call hsaKmtAcquireSystemProperties.
So it needs to change parameter of topology_is_svm_needed from node_id
to EngineId to avoid Segmentation fault on gfx902.

Signed-off-by: changzhu <Changfeng.Zhu@amd.com>
Change-Id: Iba8d20a9142510c70927454d26bdcaf579ad5574


[ROCm/ROCR-Runtime commit: 978028d3f6]
2021-08-31 22:57:24 -04:00
Kent Russell 8f735fb9d5 Revert "Get Marketing name from libdrm-amdgpu"
This reverts commit d919321fd4.

Reason for revert: aqlprofiler hasn't promoted yet

Change-Id: I9e6a4169f014a6181f43ee8ef4810be2667d98bd


[ROCm/ROCR-Runtime commit: 89c9d6a3b9]
2021-08-31 09:11:51 -04:00