Wykres commitów

949 Commity

Autor SHA1 Wiadomość Data
Alex Sierra 2dbee30232 kfdtest: free user ptr buffer at SetGetAttributesTest
Explicitly free the user buffer ptr before test's tear down. Otherwise
the svm_bo object will never be released, causing a BUG error. Due to
a late callback to svm_migrate_page_free when prange not longer exist.

Also did cosmetic adjustments.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Change-Id: I989c62de8a9634faa84e42def956cecb3f84e329
2021-12-09 18:22:20 -06:00
Joseph Greathouse a06d1a3884 Correct gfx90c gfx arch number in HSA topology
The AMD compiler team has confirmed that they expect gfx90c
to be gfx90c, with a major/minor/stepping of 9, 0, and 12
respectively. It appears that there is a typo in the libhsakmt
topology information that lists this part as gfx902. This patch
fixes the issue.

Signed-off-by: Joseph Greathouse <Joseph.Greathouse@amd.com>
Change-Id: I6f907a7aa6f190b12aba8bb4210c7b341b3c720b
2021-12-03 13:11:26 -05:00
Jeremy Newton 3f90750304 Just install license into /opt/rocm*/share/doc
This is causing issues with side by side, sorry for the noise.

This license location isn't ideal but it's good enough for now.

Change-Id: Iba2a84cedf22466fdaaf3c63b6ea49c9fc277967
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
2021-12-02 10:04:51 -05:00
Jeremy Newton 3b64517787 Add Makefile to gitignore
Calling cmake replaces this file, so no need to commit it.

Change-Id: Ic4747cc9eebd9cbfc61d524a31d2025c04eda12e
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
2021-11-30 17:29:37 -05:00
Jeremy Newton 348a3613d6 Fix side-by-side copyright file
The copyright file will conflict if multiple thunks are installed. This
should resolve the issue by adding the version to the install path.

Change-Id: Ieac5a3eba979b3e934fb9100f890b92fc7c35d71
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
2021-11-25 15:59:18 -05:00
Jeremy Newton 7649cd862e Fix packaging of license file
CPACK doesn't have proper logic for installing the license as described
by CPACK_RESOURCE_FILE_LICENSE.

For Debian packaging, the license is expected to be installed as:

/usr/share/doc/PACKAGENAME/copyright

To do this, I've added a bit of logic for CPACK to copy this into the
package using CPACK_INSTALL_COMMANDS to prep the directory, and
CPACK_INSTALLED_DIRECTORIES to add it to the package. This applies to
both RPM and DEB, so I've added some logic to the spec file to exclude
this file (note that CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION does
not work for files installed with CPACK_INSTALLED_DIRECTORIES).

For RPM install, I've just added a small bit of logic to the spec file
to handle it. The file needs to be copied into the spec working
directory, then a macro is used to handle the rest. Note the license
macro does not work on EL6, but I don't think we want to support this.

Change-Id: I06ce63d300419893cb8274bc504a15633e304d91
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
2021-11-18 16:41:48 -05:00
Jeremy Newton 529c96c08b Fix to previous commit
I used the binary directory instead of the source directory to specify
the spec.in path, which passed local testing since these directories
are in the same location. This is not guarenteed to be true.

Change-Id: I1b49ca8453b9c074a947104c26fb39667d728a8e
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
2021-11-17 17:47:53 -05:00
Jeremy Newton 3c0e4fee0f Implement RPM recommends for libdrm-amdgpu
CPack does not support recommends for RPM generation, so I've generated
a template RPM SPEC files in order to make modifications to allow for
support of recommends.

The spec.in file was generated using the cpack option
"CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE" and was modified very
sparingly to avoid any maintanance burden, e.g. can be easily
regenerated. The CPACK_RPM_USER_BINARY_SPECFILE is then used to specify
the customized template file, instead of using the cmake's template.

From what I understand, the point of these two options is to allow
developers to tailor the specfile to their desire, since rpm spec files
are much more advanced then the equilivent debian file.

Change-Id: I80c69be58a3c57729ed997fd2ce01f5d16b9e9b9
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
2021-11-17 11:57:55 -05:00
Jeremy Newton 86c27a7af8 Use recommends for libdrm-amdgpu-amdgpu1
For the use of libdrm-amdgpu-amdgpu1 and libdrm-amdgpu, we should use
recommends, as we want these packages installed with a strong dependency
but avoid a strict dependency, since this is enhancement feature.

Using the newer libdrm, which is build for amdgpu-dkms, is ideal since
it will produce more correct marketing names, but should not be mandated
due to two reasons:
- A user may not want to install both libdrms on their system
- The system might not have the newer libdrm available

This patch only fixes the Ubuntu/debian package since recommends is not
properly implemented for the RPM generator for CPACK. For now,
"suggests" will have to do, since it's the closest option we have. I
will investigate if we can get around this issue.

Change-Id: I33a90c3ead235bbbe265238c026933688ea63fe3
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
2021-11-16 11:08:40 -05:00
Kent Russell e842d7f480 Revert "CMakeLists: Fix libdrm-amdgpu dependencies"
This reverts commit 9529bf7063.

Reason for revert: Infra still not ready for it yet

Change-Id: I03e043c1ca7924264e3e70e3e82c73b4efc2ae75
2021-11-12 14:30:04 -05:00
Kent Russell 9529bf7063 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
2021-11-10 17:23:31 -05:00
Jeremy Newton fa2309fcdd 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>
2021-11-10 13:56:33 -05:00
Kent Russell 7e90eef254 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
2021-11-03 13:44:48 -04:00
Philip Cox 489db9fac6 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>
2021-10-22 13:49:34 -04:00
Kent Russell 2801342048 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
2021-10-19 08:08:15 -04:00
Kent Russell f7e90798a0 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
2021-10-14 13:20:29 -04:00
Kent Russell 5a8c9a54f1 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
2021-10-08 13:09:01 -04:00
Sean Keely 5e3983cb93 Check errno for error type in hsaKmtAllocQueueGWS.
Check errno rather than err and drop negation.

Change-Id: I1804d67292c3b054eab8fc077c8e9b22a8cdcc9f
2021-10-06 15:08:28 -04:00
Sean Keely b67bc6fcc9 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>
2021-10-06 15:07:22 -04:00
Philip Yang f82927ad65 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>
2021-10-01 15:56:38 -04:00
Philip Yang 5adb142dc7 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>
2021-10-01 15:56:38 -04:00
Kent Russell 392e0e2afc 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>
2021-09-29 13:57:17 -04:00
Kent Russell d5d8c022f1 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
2021-09-29 13:56:54 -04:00
Yifan Zhang 04b149b7fd 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
2021-09-24 21:57:54 -04:00
Aakash Sudhanwa 06b1f25172 Revert "CMakeLists: Make libdrm-amdgpu1 a suggestion"
This reverts commit 4144a0d2a4.

Reason for revert: Breaking on Centos7

Change-Id: Ibd5a7c5d4e8c07defec45821ae1faa525cfc916d
2021-09-24 16:35:53 -04:00
Kent Russell 4144a0d2a4 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>
2021-09-17 10:11:45 -04:00
Philip Yang 88e6921d45 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>
2021-09-16 10:51:56 -04:00
Kent Russell f2f86591b6 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
2021-09-15 11:34:05 -04:00
Yifan Zhang db1d6d92ab 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
2021-09-15 04:34:58 -04:00
Philip Yang 8f7443494a 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>
2021-09-14 12:36:36 -04:00
Philip Yang a809a5bf32 Revert "libhsakmt: fix multiple threads register userptr race"
This reverts commit c4d5ee28f0.

Change-Id: I954326d9a291280de7c9b7ef49a8cce0cd9dd9ad
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-09-14 12:36:36 -04:00
Philip Yang 91b0fce535 Revert "libhsakmt: Fix deadlock in map_mmio"
This reverts commit 19536080a8.

Change-Id: Ibd32ac36bcb9ee418957d25b240ef9dd9172fbd3
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-09-14 12:36:36 -04:00
Philip Yang 445fcd803b Revert "libhsakmt: Fix deadlocks in __fmm_release"
This reverts commit 5fac7dcc3b.

Change-Id: Idf636655ac01f569d8e92e9c0e100e5db7d1cb61
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-09-14 12:36:36 -04:00
Philip Yang f9648c5014 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>
2021-09-14 12:36:35 -04:00
Philip Yang d91f92669b 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>
2021-09-14 11:59:23 -04:00
Kent Russell 268bb1ae84 Revert "Revert "Get Marketing name from libdrm-amdgpu""
This reverts commit 89c9d6a3b9.

Reason for revert: aqlprofile has merged

Change-Id: Iee0fbe8ac1e475123273b328949f68f10490d3ca
2021-09-01 07:44:23 -04:00
changzhu 978028d3f6 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
2021-08-31 22:57:24 -04:00
Kent Russell 89c9d6a3b9 Revert "Get Marketing name from libdrm-amdgpu"
This reverts commit cb1c84d99b.

Reason for revert: aqlprofiler hasn't promoted yet

Change-Id: I9e6a4169f014a6181f43ee8ef4810be2667d98bd
2021-08-31 09:11:51 -04:00
Chengming Gui bcd49af8bb libhsakmt: Add new DIDs for gfx1030/gfx1031/gfx1032
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: Iddb27ce2bedda9a57944eca1e2bb93001e61f733
2021-08-30 23:17:45 -04:00
Jinzhou Su 294086096a libhsakmt: Add another gfx90c DID
Add pci device ID.

Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Change-Id: Idcf8e99583fc9991a0d71d1e0d7e741a132ed730
2021-08-30 22:49:02 -04:00
Kent Russell af31e9364a CMakeLists: Make sure package provides hsakmt-roct for RPM
RPMs were missed initially

Change-Id: Id9d3fdcb41a25db90c9de71e2035de61928e9a32
2021-08-27 07:47:20 -04:00
Mike Li cb1c84d99b Get Marketing name from libdrm-amdgpu
Use the database provided by libdrm-amdgpu,as this is maintained by AMD

Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: I319a46d833cb23173a77fdff1deae69ea58588b8
2021-08-26 16:43:31 -04:00
Kent Russell 79d00a35f9 CMakeLists: Combine binary and devel packages
Consolidate all thunk components into a single development package
Also declare build dependencies via find_package/library and report the
location of said dependencies during build time

Change-Id: I8524ad1a2d9a664accd93471abacc4bac82b9a7c
Signed-off-by: Kent Russell <kent.russell@amd.com>
2021-08-26 14:38:10 -04:00
Tony Tye d0ae4b1f3f Update HSA_RUNTIME_ENABLE_MIN_MAJOR to 10
The major version of the debug ioctl functions has been updated to 10.

Change-Id: Iddc8656ad07c92aa30c6a7a99add28ab3a3f5a80
2021-08-21 21:47:09 +00:00
Mukul Joshi acd5eda54f kfdtest: Update KFDCWSRTest for software scheduler and MES
Update KFDCWSRTest.BasicTest to run CWSR test with legacy HWS,
MES, and software scheduler.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Change-Id: I09af904507109c2bbbace6ff616a57fa2b1b8aa9
2021-08-20 16:37:50 -04:00
Kent Russell 52f5b666d6 kfdtest.exclude: Remove KFDEvictTest.BurstyTest on all ASICs
This is reported as failing on pretty much every ASIC, so move it to the
temporary exclude list for all ASICs until the test can be fixed.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I2973feb5705c178db32009e4603376d1f5e94a2f
2021-08-17 08:27:13 -04:00
Graham Sider 9745c58d40 libhsakmt: Hotfix for incorrect hex gfx versions
Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Ic67b7a3e1649288c8fdef85fef875327ffc50948
2021-08-11 16:59:44 -04:00
Chengming Gui cff8e4992c libhsakmt: Add DIDs for Beige_Goby
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: Iff82aa0ab70df49ffc6d8004e40b5cccd637da44
2021-08-09 11:32:11 +08:00
Graham Sider bb8deeae11 libhsakmt: Retrieve gfx version from sysfs
If lookup is successful, device info from find_hsa_gfxip_device() is
used to populate props->EngineId.ui32 gfx version fields and node CAL
name (props->AMDName).

If unsuccessful, uses gfx_target_version sysfs field if present
(otherwise results in error), and sets the node CAL name to
"GFX<GFX_VERSION>" (e.g. 9.0.8 -> GFX090008).

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Id39c521b769aebbe40c934f19e03150a66884cce
2021-08-05 15:19:57 -04:00
Graham Sider 29369753f5 libhsakmt: Remove redundant checks, small bug fixes
Some g_system and Node ID checks already performed by validate_nodeid().
Fixes bug where hsaKmtGetNodeProperties() would return on
validate_nodeid() error without releasing lock. Switches some
conditionals to return INVALID_NODE_UNIT instead of INVALID_PARAMETER if
NodeId >= NumNodes. Removes some g_system assertions to return error
code rather than trigger a hard fault.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Id1604b20c2cef8808b98cdad61bd47aa7ea3d229
2021-08-05 15:00:58 -04:00