Graphe des révisions

2959 Révisions

Auteur SHA1 Message Date
Graham Sider 8f883d0830 libhsakmt: Replace asic_family with gfx version
All conditional logic previously dependent on asic_family now dependent
on gfx version. As such, HSA_FORCE_ASIC_TYPE is now deprecated and
HSA_OVERRIDE_GFX_VERSION should be used instead.

device_info structs containing asic_family, eop_buffer_size, and
doorbell_size removed (alongside dev_lookup_table[]). eop_buffer_size
and doorbell_size now determined via macro, with eop_buffer_size and
full gfx version field being added to queue struct.

Certain funcs previously dependent on DID or GPU ID now dependent on
Node ID (due to use of get_gfxv_by_node_id()).

Fixes sleeper bug where ctl_stack_size and debug_memory_size were being
incorrectly programmed on gfx90a.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Iaabdc5c73920ad83b4b379cd6086992357b8ff10
2021-08-05 15:00:26 -04:00
Graham Sider 0b46d418c3 libhsakmt: Use gfx version conditions in pmc_table.c
get_block_properties() switch statement now based on major GFX version
instead of asic_family. Addition for NPI bringup only needed on major
GFX revisions unless differing perf_counter_block assignment necessary.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Ia02676d2a3a8f968b67feeafbab534ef4c01c0dd
2021-08-05 14:54:58 -04:00
Graham Sider bc4aca039c libhsakmt: Use node_id in topology_is_svm_needed()
Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I7773ccb959e60e43b816477c5659f1fe835ecbbd
2021-08-05 14:52:09 -04:00
Graham Sider 2f261a8dab libhsakmt: Deprecate is_gfx700()
Condition generalized by
(get_gfxv_by_node_id(NodeId) == GFX_VERSION_KAVERI)

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Iff4f77043e3ce8e48a9e84fbf257ebf59abf5bbb
2021-08-05 14:50:07 -04:00
Graham Sider 8880610265 libhsakmt: Add gfx version defines, helpers
Add defines for converting between full gfx version (in decimal) to
major/minor/stepping values, and major/minor/stepping values to full gfx
version (in hex). The first is to be used when grabbing the gfx version
from sysfs, the second when returning the gfx version in
get_gfxv_by_node_id() for comparisions in Thunk.

Add enum for defines of full gfx versions for various cards. These are
to be used in conditionals to replace CHIP_*/asic_family comparisons. On
NPI bringup, addition to this enum will not be required for
functionality unless explicitly needed for a conditional. Most ASICs in
this enum simply for completeness.

Add get_gfxv_by_node_id(): returns full gfx version in hex.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I9d1dba7fdd4a587a000eea2f4141a1d301bf4776
2021-08-05 14:48:07 -04:00
Sean Keely 270d042ef8 Minor interface improvement to pointer info.
Take in const void* rather than void*.  This does not break the
abi or existing code.  Existing code would need to cast away any
const which is unnecessary and annoying.

Change-Id: I28787e8fab1b600bf6871ea82835e10a4f475c5b
2021-08-04 16:43:23 -04:00
Kent Russell 6778da4460 CMakeLists: Re-enable pkgconfig, require libdrm
This was an implicit requirement, but the change to needing libdrm/drm.h
means we should be explicitly looking for this package during the build

Change-Id: I75064bf6f5477cb1ca99318681afca76c0060f72
2021-07-30 18:20:12 -04:00
Sean Keely ed7eec14e1 Update README and increment minor version number.
APIs have been added and minimum cmake version number has been
changed.

Change-Id: Ic75849e6937c04faed2d206344df2cf9e9a78016
2021-07-30 17:13:17 -05:00
Sean Keely 4907d4577b Add optional dependency on rocm-core.
Part of uninstall sanity changes.

Change-Id: I29f16470deb87e67050339f10bfb7cc1b5f9c1b2
2021-07-30 16:39:37 -04:00
Sean Keely 471c1859ab Simplify RPM package building.
The need to run rpm outside of cpack seems to have passed.

Change-Id: I8d7d992e289a0a88fa11b57bf0401bc6740c266b
2021-07-30 16:39:32 -04:00
Sean Keely e8439cca08 Remove unused branches from DEB packaging scripts.
Branches are unused and emit noise to the console when running
commands for which we have no actions.

Change-Id: I1f8c49a20bd7f529172721f35d29665cfc8dc6a4
2021-07-30 16:39:25 -04:00
Sean Keely 081ab00f8e Correct hsa_status_string strings.
Some strings were missing the human readable form of the error code.
Also unifying source formatting via clang-format.

Change-Id: I0bcc2ab77dda476904c684cc2c584a5c7e8230d4
2021-07-30 16:30:31 -04:00
Sean Keely 62b7c0ed3b Add missing HSA_STATUS_ERROR_INVALID_MEMORY_POOL string.
HSA_STATUS_ERROR_INVALID_MEMORY_POOL was missing from
hsa_status_string.

Change-Id: I9a9121d54a61f966d87081a55638397473bddbe4
2021-07-30 16:30:25 -04:00
Sean Keely a0069904c8 Minor correction to debug messages.
Added missing \n.

Change-Id: I6e17459390c2c18819fc1decd8a6c91b7d7409cf
2021-07-30 16:30:18 -04:00
Sean Keely 0778969e89 Correct single character transcription errors in license text.
Somehow "and/or" was rendered as "and#or".

Change-Id: Ia8219e0241cd1c788e26a92b491523852e9a2f40
2021-07-30 16:28:53 -04:00
Sean Keely bb4dfbba1e Correct data race in GpuAgent::GetXgmiBlit.
Threads may race against xgmi_peer_list_ when dynamically assigning
peers to sdma engines.

Change-Id: I300c10f0cfa0ff7d6a5515364070a0895e2f4644
2021-07-30 16:10:59 -04:00
Aaron Liu fc216a3668 libhsakmt: expand control stack size limit for all gfx103x
Expand check control stack size for Beige Goby, Van Gogh and Yellow Carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: I6c8345bbb751eb9179fc740fe1674504b4295a5f
2021-07-30 10:24:25 -04:00
Aaron Liu 80e4cb6261 libhsakmt: reorder the list of GPUs in enum asic_family_type
Put CHIP_gfx90a next to CHIP_gfx908 to keep all the GFXv9
chips together.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: I32b4b7f7746ae4bdaff7e178f13307c1bcfa93e1
2021-07-30 10:23:56 -04:00
Philip Yang 991cde0656 libhsakmt: update query pointer info document
Query pointer info return HsaPointerInfo with MemFlags for all pointer
type now.



Change-Id: I3c02b7b71ba0af953035e3ed9cd6bb6435bb9b65
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-07-29 21:10:38 -04:00
Philip Yang 413979c319 kfdtest: fix KFDIPCTest on gfx1xxx
hsaKmtAllocMemory with mflags.HostAccess=1 will fail on desktop gfx1xxx GPU
because it's small bar PCIe. Remove this flag.

Child process exit status should use current_test_info, not unit test
info.



Change-Id: I060f23aa98a42251921d003878e70a409c92a4de
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-07-29 21:10:17 -04:00
chen gong 860931557c libhsakmt: add cyan skillfish support
Signed-off-by: chen gong <curry.gong@amd.com>
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Change-Id: Ie26c2e156c9c4e68a6b36fe699adccf3f808b5e7
2021-07-29 16:44:16 -04:00
Sean Keely e3a01690a5 Add global_flags reporting to pointer info.
global_flags reporting allows discovery of an allocation's memory
model (coarse, fine, kernarg).  This is critical on gfx90a and
also allows discovery of the memory model of IPC imports.

Change-Id: Icbc3c243ca20e264af5e1931becd2419f762c7ad
2021-07-29 15:37:47 -05:00
Sean Keely e6e66e8a05 Report SVM range queries with both coarse and fine grain as indeterminate.
Previously ranges were reported as fine if and only if they were
entirely fine.  Coarse and mixed ranges were reported as coarse.
For gfx90a it is critical to know if a range is coarse or fine as
fp atomics targeting fine do not function.  Range queried reporting
coarse must be able to be trusted so must only report coarse if the
entire region is coarse.

Change-Id: I29c654a2afcd6943961eb2455e3654dfdb1283b5
2021-07-29 15:34:58 -05:00
Sean Keely 4455250be1 Add HSA_CU_MASK
New environment variable HSA_CU_MASK allows users to
specify a cu mask to every queue allocated from any
GPU.  hsa_amd_queue_cu_set_mask is restricted from
escaping this mask.

A new API hsa_amd_queue_cu_get_mask is added to query
the current cu mask.

Change-Id: I846c03a5faaca9b95067c31db84b59cc9fce2f03
2021-07-29 02:23:34 -05:00
changzhu 3600cdfa01 kfdtest: blacklist some SVM test cases for gfx902 iommu path
Change-Id: I77f734df7ca65f2aa176548fd02ddac6036fe138
Signed-off-by: changzhu <Changfeng.Zhu@amd.com>
2021-07-29 00:02:57 -04:00
changzhu 1fe2225f52 kfdtest: take back SVM test cases for gfx90c
Change-Id: I28627f6eeaf9d213d7740849c6fadcccd91733c0
Signed-off-by: changzhu <Changfeng.Zhu@amd.com>
2021-07-28 15:44:02 +08:00
Sean Keely 2c35469617 Provide hwloc dependency.
Some distros do not provide the proper hwloc version for rocrtst.
This packages the required version.

Change-Id: Iebc68250c33f309d6b50e850a0553685bac50563
2021-07-26 23:56:14 -04:00
Sean Keely 770a42cb42 Revert "Revert "Split packaging into binary and dev packages.""
Correct deb and rpm package conflict declarations.
hsa-ext-rocr-dev was to be replaced.  Now that two packages
replace this package remove conflicts so that they do not block
eachother.

Change-Id: If25ea6cfd3d6d00398fd0a8d179860d3a92dc907
2021-07-26 20:42:25 -05:00
Sean Keely d2ccf44085 Revert "Split packaging into binary and dev packages."
This reverts commit 2c32cbea00.

Change-Id: I33cbcffe5695c4e45ebce37ce56177006a5e0f62
2021-07-26 19:23:46 -05:00
Sean Keely 2c32cbea00 Split packaging into binary and dev packages.
Conform with normal packaging behavior where a binary
and its development headers are in separate packages.

Change-Id: I91c58ea271a8e1c710c213060bca6d58d69287e6
2021-07-26 17:01:36 -05:00
Sean Keely bea17130f7 Add package splitting names to PROVIDES.
Preparation for splitting the package.  rocm-dev meta package
should be updated after this is merged and before splitting the
packages to avoid build breaks.

Change-Id: Iaad54ee72207285eaaa99e88cf1949bea7f29001
2021-07-23 18:33:09 -05:00
Philip Yang 426b94015c kfdtest: KFDIPCTest BasicTest query shared memory
Parent process alloc memory with specific HsaMemFlags, child process
import the memory handle exported by parent process, query shared memory
pointer info, verify it has same HsaMemFlags.

If child process test failed, exit with error code to notify parent
process.

Change-Id: I5c9534e931b4565186d27124868799b893504c81
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-07-23 10:08:28 -04:00
Philip Yang c3c1618db7 kfdtest: query userptr pointer alloc flags
Test if query userptr pointer info return correct alloc flags,
CoarseGrain by default.

Test if query hsaKmtAllocMemory pointer info return correct alloc
CoarseGrain flags.



Change-Id: If3a1175645717e5d7c475d6ff35b02d6876a1f7c
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-07-22 21:14:46 -04:00
Philip Yang db288df695 kfdtest: RegisterGraphicsHandle check CoarseGrain set
Register graphics memory should always coarse grain.



Change-Id: I9d056b41287fa63247a042e5530ba29d535173ea
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-07-22 21:14:46 -04:00
Philip Yang fa7b4a6268 libhsakmt: Qyery pointer info flags for registered memory
hsaKmtQueryPointerInfo return vm_obj flags for all below registered
memory types other than hsaKmtAllocMemory, and set the CoarseGrain flag
correctly for:

Graphics: always coarse grain.

Shared: hsaKmtShareMemory pass mflags with export handle to KFD to store
in KFD objs, hsaKmtRegisterSharedHandle get mflags from KFD with import
handle.

Userptr: it is already coarse-grain by default, or based on mflags
provided in hsaKmtRegisterMemoryWithFlags call.



Change-Id: Idc23e8b0cf599b02580737639da2f9ef4ccd0c0d
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-07-22 21:14:46 -04:00
Philip Yang 2c796e62be libhsakmt: Query pointer info returns HsaMemFlags
Query pointer info returns KFD_IOC_ALLOC_MEM_FLAGS_* flags, it should
return HsaMemFlags, fix it by renaming vm_obj->flags to mflags and
always saving HsaMemFlags.

Use consistent function parameter and variable name to avoid confusion:
mflags for HsaMemFlags and ioc_flags for KFD_IOC_ALLOC_MEM_FLAGS_*
flags.

AMDKFD_IOC_GET_DMABUF_INFO return ioc_flags, translate it to mflags
using new helper fmm_translate_ioc_to_hsa_flags.



Change-Id: If9e117c507139c0166abb1ab0df8c233ef7e48a1
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-07-22 21:14:46 -04:00
Aaron Liu 3d12437f1b libhsakmt: add yellow carp DID
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: If798dc733bc8d65c67922fb5d2e32aa1dada8381
2021-07-22 21:18:42 +08:00
Kent Russell ed62c7aa1c libhsakmt: Add gfx1032 DID
0x73E3 DID was missing, add it.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: Id1ae2f268e0e8b5cfec5ae2065153fe73854b93a
2021-07-22 07:37:19 -04:00
Aaron Liu 4032070c3e Add gfx1035 for yellow carp
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: I1e3e44352b5825fc0f249c39aed703d4990995ca
2021-07-22 13:48:31 +08:00
Philip Yang dee9c023a2 libhsakmt: update to KFD ioctl version 1.6
sync with KFD ioctl version 1.6:

1.6 - Query clear flags in SVM get_attr API

Change import export handle args pad field to flags, to pass memory
alloc flags from alloc process to import process.

Change-Id: I69360b244651947e885c4a8da9f64a1163101d20
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
2021-07-21 21:48:18 -04:00
Icarus Sparry b63dde24d0 Add dependency on rocm-core
Signed-off-by: Icarus Sparry <icarus.sparry@amd.com>
Change-Id: I5f99114e9186679585862f05db8a508663b74b0d
Signed-off-by: Icarus Sparry <icarus.sparry@amd.com>
2021-07-21 15:57:54 -04:00
Kent Russell 4f3440a8ac Fix drm.h include path
kernel-headers provides the drm/drm.h path, while libdrm-dev[el]
provides the libdrm/drm.h path, which is what we want to use. Fix the
path so we use the newer drm.h header, as well as fixing SLES, which
doesn't provide drm.h in their kernel-headers.

Change-Id: Icb2b6643698d356169e3baeef17527a1b4e05483
2021-07-20 12:49:15 -04:00
Jonathan Kim 303c0748ce libhsakmt: add drm.h header dependency for sles
Update to thunk API introduced dependency on drm.h in commit
31ac82617c libhsakmt: update thunk api for exception handling
so update dependency list in SLES builds.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I6d987fac07612e3eca7b6087205d76df50dc13d9
2021-07-19 12:48:13 -04:00
Sean Keely 59ee761f81 Add support for reporting vm faults through the queue error handler.
Under xnack we can now identify the queue which generated a vm fault.
This allows users to identify which queue, and therefore which
dispatch, a vm fault came from.

Change-Id: If72ff3de05800f2b811aa7842a15eedff8b5e45a
2021-07-16 18:03:26 -05:00
Laurent Morichetti ef1955ad42 Fix incorrect packet index in ttmp6
ttmp6.packet_index is reported as 0 for all waves, regardless of the
dispatch packet position in the queue, due to an issue in the clearing
of the previous trap_id and saved status.halt bit.

Fixed TTMP6_SAVED_STATUS_HALT_MASK to only be one bit, 1<<29.

Change-Id: Ia4934e51123a40d71de658efc387a1f3a6344f05
2021-07-16 18:03:26 -05:00
Jay Cornwall f3d942b67f Report union of wave errors as a bitmask in trap handler
Also fix incorrect PC increment on host trap.

Change-Id: Ic8bbf2b90f9f879ba62b558b909d010a8939a663
2021-07-16 18:03:26 -05:00
Jay Cornwall 8d4608ed0e Clear queue error code when not handling exceptions
If left non-zero the event loop will keep reinvoking the callback,
preventing AqlQueue::ExceptionHandler from running.

Change-Id: If85fbaf62f04ffd327ecf9d649aa23afad4442ce
2021-07-16 18:03:26 -05:00
Jay Cornwall 7e4088309d Add new trap handler, bump debug API version
Also fix hsaKmtRuntimeEnable error handling. Continue if ioctl fails.

Change-Id: I754ccba5910ccfef6f1ada1415593ef89ce33aba
2021-07-16 18:03:26 -05:00
Sean Keely 0159aea4c9 Initialize new exception handler state.
Change-Id: Ibcb699760837b9ec1508d6af948a272a81ddcd02
2021-07-16 18:03:26 -05:00
Sean Keely 206e87d28b Support debugging hw exceptions.
Change-Id: I9780147294af2e9457fa54693580735452ee2ae6
2021-07-16 18:03:26 -05:00