Wykres commitów

725 Commity

Autor SHA1 Wiadomość Data
Huang Rui 8fc816affe libhsakmt: fix to update the param number after remove to dgpu input
This patch is the hot fix to fix the param number checking after remove
dgpu input.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Change-Id: Ic980588f78616f99076de742af580afb4273fb2f
2020-09-11 10:25:37 -04:00
Huang Rui 8ea0d49337 libhsakmt: update gfx90c isa version
gfx90c should use GFX902 which is the same with gfx902.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Change-Id: Id24dc2c85c9f49f36b00889c3b8b1b19cce34e09
2020-09-09 22:10:58 -04:00
Kent Russell 654ee83ac8 Remove -dev make instructions
These are removed now that we've consolidated the dev package
information into CMakeLists.txt from hsakmt-dev.txt.

Change-Id: I49496ec5def85b0af7fa6b15110910528a8e0be0
2020-09-09 11:28:18 -04:00
Kent Russell 0a4b23d625 Fix lintian errors in deb packages
Add extended descriptions and e-mail address to CMakeLists
A lintian error will remain regarding stripping the .so, as we
will not be doing this for Release versions of the hsakmt .so

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I41c768dee28c0564d92b9c103a6e2d97590e4589
2020-09-09 11:28:18 -04:00
Kent Russell ae4e980ea8 README: Update README info and installation instructions
Added caveat regarding Ubuntu 20.04 /dev/kfd permissions
Edit copyright date, remove outdated HW support list

Change-Id: I3138058a01db6c46cf624bcfb8cfb04c164d9133
Signed-off-by: Kent Russell <kent.russell@amd.com>
2020-09-09 11:28:18 -04:00
Huang Rui ad87f38dad libhsakmt: remove is_dgpu flag in the hsa_gfxip_table
Whether use dgpu path will check the props which exposed from kernel.
We won't need hard code in the ASIC table.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Change-Id: I0c018a26b219914a41197ff36dbec7a75945d452
2020-09-09 20:56:50 +08:00
Huang Rui 12813691a2 libhsakmt: implement the method that using flag which exposed by kfd to configure is_dgpu
KFD already implemented the fallback path for APU. Thunk will use flag
which exposed by kfd to configure is_dgpu instead of hardcode before.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Change-Id: I445f6cf668f9484dd06cd9ae1bb3cfe7428ec7eb
2020-09-09 20:56:39 +08:00
Oak Zeng 3d3b28b670 CWSR control stack size calculation for gfx10
Gfx10 need 12bytes/wave control stack

Change-Id: I6c6f2819572e6b43aa3140d4dbe79d930e4c1c9c
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Signed-off-by: Jay Cornwall <Jay.Cornwall@amd.com>
2020-09-01 21:34:00 -07:00
Philip Cox f7a3427c99 libhsakmt: call madvise() from fmm_allocate_device
This is needed to avoid additional references to mapped BOs in child
processes that can prevent freeing memory in the parent process and lead
to out-of-memory conditions.

Change-Id: I25c90510a14dde515cc23ea5dc1f68e8d7e37a66
Signed-off-by: Philip Cox <Philip.Cox@amd.com>
2020-08-19 13:33:47 -04:00
Jinzhou.Su a69830917f kfdtest: remove test cases on gfx90c which block IQE test
SDMA_BLACKLIST, KFDMemoryTest.LargestSysBufferTest,
KFDQMTest.BasicCuMaskingEven

Change-Id: Ic603452ede5ef14f5fcb49925d57d3a656d48a08
Signed-off-by: Jinzhou.Su <Jinzhou.Su@amd.com>
2020-08-19 10:20:24 +08:00
Kent Russell 04f6b9e16b Fix GCC warning regarding strncpy in CPU info
strlen(src) should not be used as the length in strncpy. Use memcpy
since we know the length of the string, and ensure that we
NULL-terminate regardless of length

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I21cc6d106510c69464e7ac9d3fc7da3a1e6d1a68
2020-08-14 07:10:19 -04:00
Kent Russell 6085baa2dc Fix typo lager->larger
Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I188d629b6441e5ebb14f104869e871d003c78c9d
2020-08-13 06:34:42 -04:00
Philip Yang 9e9771a7d9 libhsakmt: always use render fd to create CPU mapping
The option to use kfd_fd for cpu mapping is for very old broken KFD
version, it is not used in upstreaming process. This causes issue when
multiple process uses shared system memory because the GTT address is
over 40 bits.

Change to always use render node fd to create CPU mapping.

Change-Id: Id7e7b2a2e2f13c6e62c5de170589abfff4d456b0
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2020-08-04 12:54:57 -04:00
Chengming Gui 72294266c2 kfdtest: Add gfx1031 support
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: I3806ec33eefd84ff1dd690dd142889e076b7ef43
2020-07-28 18:02:51 -04:00
Chengming Gui bf1a7acea3 libhsakmt: Add gfx1031 support
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: Ic1e78e5c3a453eb01f725612cf9ecc702ce2e132
2020-07-28 15:01:00 -05:00
Ramesh Errabolu b0b0a1b479 Fix typo in the field name Mem_EDCSupport of HSA_CAPABILITY entity
Change-Id: Ic1aba0b2c6e7bc8324fe756df84998f32a8c09da
2020-07-09 12:42:30 -04:00
Yong Zhao 76a6781c2d kfdtest: Add gfx1030 support
Change-Id: I5fd0d9af09cbefc0acbe24397a7e2f3aa14a7c97
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-07-07 18:09:56 -04:00
Yong Zhao 7c74069d6a libhsakmt: Prepare for gfx1030 support
PCI IDs have yet to be added later.

Change-Id: Iac303fc1346f4ed5c4da5300b1e311c1c6938ee2
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-07-07 11:07:14 -04:00
Cole Nelson 141246eeeb libhsakmt: set packaging arch, field separators, vendor info
Change-Id: Ia1392285f5ee0beeaae136ad7d68e1723bc590ba
Signed-off-by: Cole Nelson <cole.nelson@amd.com>
2020-06-30 07:38:14 -04:00
Gang Ba fec3780c1a Revert "libhsakmt: add Streaming Performance Monitors APIs"
This reverts commit d675d1cce1.

Reason for revert: Change was submitted by accident

Change-Id: If05c705e22296fd3ca789f269737d379a933361d
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-06-29 10:54:54 -04:00
Vlad Sytchenko 5fb771a195 Correctly set CMAKE_MODULE_PATH
Since CMAKE_MODULE_PATH can already be set by another project,
we should just append the libhsamkt cmake module directory to it.

Change-Id: I999dc52a2862e4bbff02e0a8e8b39530f4dae2cd
Signed-off-by: Vlad Sytchenko <vladislav.sytchenko@amd.com>
2020-06-24 15:47:06 -04:00
Sean Keely f101875de8 Add warning about incorrect package names when using CMake 3.5
Signed-off-by: Sean Keely <Sean.Keely@amd.com>
Change-Id: Ie35b287224ec6b963bc317baf60853fbe223fc17
2020-06-19 20:12:16 -05:00
Eric Huang 0003b6d147 kfdtest: change shader command to avoid compile error for gfx90a
Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I531ebac162403cc957802bbcdb34cdc022be3a50
2020-06-17 10:15:12 -04:00
Yong Zhao 6a762ec717 libhsakmt: Improve the comment regarding queue doorbells
The comment failed to convey the fact.

Change-Id: Ia9b1d1c2583e288a6308d2bc81d42055064a5f4f
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-06-16 15:16:03 -04:00
Sean Keely f0b0555996 Add optional support for the cmake per user package registry.
Default is OFF to conform to latest cmake standard (3.15) and
because this feature can cause some confusion for unaware developers.

Change-Id: I6fdbd5ab76c90b73ac6451a383334a83cabef438
Signed-off-by: Sean Keely <Sean.Keely@amd.com>
2020-06-11 14:25:57 -05:00
Sean Keely 06add334b9 Update to conform with modern cmake best practices.
Immediate benefit is that this enables cmake native find_package
support including transitive passthrough of link dependencies,
options, and include paths.

It does require a bump to cmake 3.6 to enable proper package file
names.

Change-Id: I3f4e2f2db745c04a7f686111b080098a0d92fbf5
Signed-off-by: Sean Keely <Sean.Keely@amd.com>
2020-06-11 14:25:41 -05:00
Gang Ba d675d1cce1 libhsakmt: add Streaming Performance Monitors APIs
Signed-off-by: Gang Ba <gaba@amd.com>
Change-Id: I5c23a8dacf9bc50c740908aabe391432f2c7112e
Signed-off-by: Gang Ba <gaba@amd.com>
2020-05-29 09:34:31 -04:00
Joseph Greathouse 5ddd8fb68b Pull out ASIC revision from HSA capability
KFD now passes the ASIC revision to user level through some bits
in the HSA topology's capability field. Some user-level software
wants this because different ASIC revisions may require user-level
software to do different things (e.g. patch code for things that
are changed in later hardware revisions).

Change-Id: I16f2a15ae0875edd01ebdb1f1685ec7865f7049e
2020-05-22 10:39:13 -05:00
Philip.Cox@amd.com 0a55f31463 Initial kfd debugger address watch support
Code for new kfd debugger address watch code.
           -- Adding support for:
              -- add address watch
              -- clear address watch

Change-Id: I9b014e7cee03897157b997b9e5b39b6ed403b8e1
Signed-off-by: Philip.Cox@amd.com <Philip.Cox@amd.com>
2020-05-21 13:41:55 -04:00
Felix Kuehling df16950a0c libhsakmt: use _Static_assert instead of static_assert
Using static_assert breaks in "Many Linux" build environment. It is not
supported by that libc version. _Static_assert is a compiler built-in
and does not depend on the libc version.

Change-Id: I37cf0ad10de94d8f6fc8cefc4fdda55c9520d599
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-05-15 01:34:10 -04:00
Ranieri Althoff aa185380f9 Avoid calculating strlen multiple times
Change-Id: Iec66c7d35e5d6cd2deb02c94ee070d0fa1335147
Signed-off-by: Ranieri Althoff <ranisalt@gmail.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-05-13 00:38:26 -04:00
Amber Lin a37a88ddcb libhsakmt: Sync up the ioctl number
Update the non-upstream ioctl numbers to align with the change in the
kernel.

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Change-Id: Ie0ddccb343a023b55eb18477c59341acaa666e99
2020-05-12 15:06:07 -04:00
Ori Messinger 46f5e83066 Create KFDTest for SDMA Fault
The purpose of this KFDTest is to investigate the behaviour of an
SDMA queue when an invalid memory address is used.

v2: Don't wait for SDMA queue to finish - it won't finish because of
the gpuvm fault.

v3: Create kfd event before SDMA queue submission. This fix the issue
that gpuvm fault happens earlier than kfd event is created then KFD
exception handler can't find the kfd event (to wake up kfd test)

v4: Instead of using 0x12345678 as the invalid VA, map one page of
FB to gpu and unmap it. Use the mapped GPUVA as the
invalid address

Change-Id: I58af1511f75d869adddede302b238c2725f3fe5a
Signed-off-by: Ori Messinger <Ori.Messinger@amd.com>
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2020-05-11 18:52:35 -04:00
Kent Russell dc784ba482 Fix HostAccess flags for XGMI configs in P2PTest
We need HostAccess for large-bar XGMI configs for this test,
but we can't use it on small-bar XGMI configs, so deal with it
appropriately

Change-Id: Ic16b810de03adfc63de21a00c55e5f3ea1ce66d1
2020-05-11 11:12:33 -04:00
Jonathan Kim 93c333711a libhsakmt: queue suspend/resume can return non-zero positive values
New queue suspend/resume update can now return the number of successful
queue requests so return success if IOCTL return is non-negative.

This should be backwards compatible since old queue suspend/resume returns
0 on success.

Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
Change-Id: I06b70d95d203b2bfc19a0cc1b88c5719c695159a
2020-05-08 22:10:41 -04:00
Felix Kuehling e5062c4383 libhsakmt: Add PROT_NONE CPU mapping for scratch mappings
This is needed to allow gdb to access the memory.

Change-Id: I96c084b714e952d7b7000f0dd41e1c530fdd092f
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-05-02 15:52:30 -04:00
Kent Russell ddd38deab7 Make thunk lib type be defined by cmake
Make the hsakmt library take the value from CMake regarding
static/shared
KFDTest automatically grabs the right one due to it checking the normal
shared folders. Tested locally (and via automation by the time that this
is merged)
Also set the default to building SOs if BUILD_SHARED_LIBS is not defined

Change-Id: I7f8b76a7e60f3b41e5981f472b388301ae09e2c6
Signed-off-by: Kent Russell <kent.russell@amd.com>
2020-04-27 13:52:42 -04:00
Kent Russell b72bbeac3e Fix naming conventions again for -dev package
Using the building OS isn't guaranteed, as we can theoretically build
RPMs in Ubuntu or DEBs in CentOS. Use CPack's DEB/RPM-specific variables
to get around this issue

Change-Id: I404246c070eac2c74b45ae4b763c612891d66de1
Signed-off-by: Kent Russell <kent.russell@amd.com>
2020-04-24 08:06:38 -04:00
Jonathan Kim af249159ee kfdtest: do not request host accessible memory for P2P tests
Do not request host accessible memory otherwise small-bar XGMI fails.

Change-Id: I6b1e750839ae66a34c85405fa8d0a4aa455399ef
Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
2020-04-17 23:42:10 -04:00
Felix Kuehling 8ee763d94a kfdtest: Fix problems finding kfdtest.exclude
When running run_kfdtest.sh through a wrapper script that sources
run_kfdtest.sh, kfdtest.exclude isn't found because $0 points to the
location of the wrapper script. User $BASH_SOURCE instead of $0 to
find the location of the correct run_kfdtest.sh script.

Change-Id: I0ae7899e527e6d98bb8651197484e5ee03a5fd7b
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-04-16 18:23:33 -04:00
Kent Russell 7ee9e01587 KFDTest: Use SMI for HIGH clocks, if possible
Some systems don't support coarse-grained DPM, so performance level will
fail. Remove the compute_utils.sh references, and just use the SMI if we
request clocks be high, without throwing errors if it fails.

Change-Id: Ic5beda9921128be36ac2d58cae3f0608618a8e21
2020-04-16 07:59:33 -04:00
Srinivasan Subramanian 5e35364838 libhsakmt: check ret and errno for EBADF
Change-Id: I9fcbf955d8b7b01ff1025534a8c2eaa8e6790565
Signed-off-by: Srinivasan Subramanian <srinivasan.subramanian@amd.com>
2020-04-15 20:55:40 -04:00
Sean Keely 884fed4f04 Correct initial kfd_open_count increment.
Don't set kfd_open_count=1 unless hsaKmtOpenKFD actually succeeds.
This prevents returning HSAKMT_STATUS_KERNEL_ALREADY_OPENED in
subsequent calls when KFD is actually closed.

Signed-off-by: Sean Keely <Sean.Keely@amd.com>
Change-Id: Ia870b5faa8626826a6c8795aa10784d376cf2e80
2020-04-03 21:05:07 -04:00
Jon Chesterfield 0a1718b753 Replace libpci with new parser.
libpci was only used to find a marketing string for a device.
This patch looks for a pci.ids on disk and parses it to extract the
same string, using 'Device xxxx' as the fallback on file i/o error
or missing data from the text file. Tested by checking every vendor/
device pair against the values returned from libpci.

Change-Id: I21af3157472c1824d57fcee31393c6ee8ce07330
Signed-off-by: Jon Chesterfield <Jonathan.Chesterfield@amd.com>
2020-03-20 17:50:47 +00:00
Jeffrey Poznanovic 5dcd49f726 Added CentOS-6 mods to support manylinux2010
Change-Id: I8c303ccfdc7d314d1b4609ed6181d46795ada621
2020-03-20 08:47:25 -04:00
Divya Shikre 96259b5830 kfdtest: Provide Unique ID information.
Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: I9a837a3d1ab38f5ad05673406874d862c9e97541
2020-03-18 15:55:59 -04:00
Sean Keely 9efefe6d52 Handle EBADF when KFD file handle is still open.
Signed-off-by: Sean Keely <Sean.Keely@amd.com>
Change-Id: I23d6c87d5729f57c261030c6baeff4c977eef934
2020-03-11 18:52:19 -05:00
Divya Shikre ebe7de1f99 libhsakmt: Expose device Unique Id
Read device unique id from sysfs and expose it in HsaNodeProperties.
For devices not supported the value will be 0

Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: I97b8689dfa090971c6876de6feaa97652e28c03d
2020-03-10 10:06:11 -05:00
Yong Zhao 4e7b2f2e27 kfdtest: Print a message when there is no GPU
This helps the user to troubleshoot the problem.

Change-Id: If6cf42c488097011285252a6c722d3d74c0f7ce7
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-03-04 15:00:47 -05:00
Yong Zhao 0e5c4d83e6 kfdtest: Delete MULTI_GPU usage in run_kfdtest.sh
It is obsolete.

Change-Id: Ifd137ce1ce8d9133cfa5c8bfd46aaeea461b5aa7
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-03-04 15:00:47 -05:00