Graf Tiomantas

407 Tiomáintí

Údar SHA1 Teachtaireacht Dáta
Sean Keely a2fb1cbfbc 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
2021-10-03 12:29:12 -04:00
Sean Keely 234ef77e32 Close KFD when failing due to debugger state.
Change-Id: I6a6890fd9e86d27f87ae96de1c47c89d40a4e010
2021-10-03 12:27:49 -04:00
Sean Keely 280a458d0c 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
2021-09-30 05:53:49 -04:00
Sean Keely a8c3ea82a4 Add debug option to skip setting the initial cu mask.
Adds debug variable HSA_CU_MASK_SKIP_INIT.

Change-Id: I5c742d1184a36fdef818bc50c3b780b859b68560
2021-09-16 23:43:49 -05:00
Sean Keely 5535b1f86f Correct fast f16 capability reporting.
Was hard coded to false.  Updated to reflect f16 availablity since
gfx8.

Change-Id: I7d5b9792c8e0163199c421a61b5d49b25cd98645
2021-09-16 21:15:52 -05:00
Oak Zeng 80206af91e Add gfx1013 support
Change-Id: I7122caea3ef2254b50bde25ec545116685452116
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2021-09-15 01:10:20 -04:00
Sean Keely 5af558f739 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
2021-09-14 17:49:24 -04:00
Sean Keely 907679c989 Register the default queue error handler for all internal queues.
Also make failure to handle queue errors fatal.

Motivation is to improve detection of queue error conditions
that currently appear as application hangs.

Change-Id: I655643616dc0bd303d7df3ce8aca2c099bec3d46
2021-08-27 20:11:58 -04:00
Sean Keely e06dd39d89 Correct queue exception hander termination.
Set handler state to terminated before exiting.
Also simplify scratch handler exit loop.

Change-Id: I0a80c8a1899e8b60a6e7aa6989ba28de42ba31e7
2021-08-27 20:06:44 -04:00
Sean Keely 02666ec0f1 Allow passing zero bits into hsa_amd_queue_cu_set_mask.
Passing 0 into num_cu_mask_count used to be an implicit error.
This has been repurposed as a short hand for enabling all CUs.
Enabling all CUs when HSA_CU_MASK is set will cause the CU mask to
reset to whatever was set by HSA_CU_MASK which may then be queried.

Change-Id: I1d6bb2034595a78ee48fa72aa05563e8ea6c0fff
2021-08-27 20:05:24 -04:00
Sean Keely 2aa0795b33 Improve HSA_CU_MASK parsing efficiency.
Delay parsing until after GPU discovery.  Use the surfaced
GPU count and maximum phyiscal CU count to limit parsed bit masks.

This prevents pathological input such as
HSA_CU_MASK=0-8000000:0-8000000 from attempting to consume 7TiB.

Change-Id: I3773d2db3740c2023b0f6275d1818b69119b0495
2021-08-27 20:05:18 -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
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 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
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
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
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
Sean Keely 3d6a18b67c Always execute the first satisfied async signal handler.
Certain special signals do not carry their updates via their signal
value.  These signals are wrappers around special KFD events, of
which the only current instance informs about VM faults.  We either
need to check each signal for this special event type or rely on
the checking done in hsa_amd_signal_wait_any.  Since there will always
be a small number of these signals it doesn't make much since to
penalize the performance path with this check.  Additionally we know
that the signal indicated by hsa_amd_signal_wait_any is satisfied so
don't need to recheck it's conditions.

Change-Id: I9fc6298300ad543d823ecd28ca8fab4ad26c23ef
2021-06-24 02:45:31 -05:00
Sean Keely 9e53cab613 Add agent info query for HSA_AMD_AGENT_INFO_SVM_DIRECT_HOST_ACCESS.
Allows determining if the host can directly access HMM memory that
is physically resident in vram.

Change-Id: Ie452eedd0e27fe1b511afd416f5a1cd01b3d84e8
2021-06-17 03:45:26 -04:00
Sean Keely 8adbda1c18 Allocate any size vram request through the fragment allocator.
Enables the fragment allocator to handle >2MB allocations, maintaining
good TLB alignment.  Prior code contained a bug that caused the effective
API granule for vram allocations >2MB to be bumped to 2MB.

Also adjusts the block cache's block retention heuristic to not
count discarded blocks as in use.  This will reduce block retention
when a significant amount of large blocks or IPC is in use.

Change-Id: I30bd85eb87951df822211f799d9cfe579ab109c6
2021-06-10 19:30:54 -05:00
Sean Keely 981c6bd8c3 Remove unused GpuAgent.local_region_ member.
Change-Id: I99526e6b1f64e810f7fed5d922c540d252a46d80
2021-06-07 19:59:58 -04:00
Sean Keely bd59789f0b Add debugging checks for packet type in the scratch handler.
Change-Id: I84a6f18548ac39349595e3a1c8a5a9ff27d4e178
2021-06-07 15:36:18 -04:00
Sean Keely 3323e18f3e Limit reporting of GPU_ONLY signal waits from host.
Such waits must spin but are functionally correct.

Change-Id: I4992852f04da788495c6f566c46a3dffaf38397c
2021-06-03 15:26:40 -05:00
Sean Keely ca8387768e Allow limiting debug warning messages.
Add macro debug_warning_n to stop printing a message after
N instances.

Change-Id: Id5f84b11eb63b3a20bd2bcb2ea8f10a066b457ef
2021-06-03 15:25:55 -05:00
Sean Keely 6b398eb72c Improve async handler performance.
Under high async handler load signal retention and event sorting
become bottlenecks.  This change processes more handlers in a
single pass to amortize wait_any overheads.

Change-Id: I8b276e102db647e3858e120547aa0c6fca85ab4c
2021-06-02 23:52:07 -05:00
Sean Keely f6c2aa1c78 Add Read Mostly attribute support.
Change-Id: Ia7c60edacb892cbf14bdb50350c0a0a627e53964
2021-06-01 23:39:12 -05:00
Chris Freehill 8cb686fdc5 Add gfx1034 support
Change-Id: I2d4bfcb9012704daf7de10739c966827bd2a09e2
2021-05-25 16:43:16 -05:00
Mike (Tianxin) Li 36c54c63f7 Revert "Get the size of VGPR and SGPR register file"
This reverts commit 344ed757e0.

Change-Id: I9988218ad1d2b6182d92aad09d18a95e77e46c01
2021-05-18 15:01:30 -04:00
Mike Li 344ed757e0 Get the size of VGPR and SGPR register file
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: Ifa515ad7e1df1dd27f25f1e919b0053049531063
2021-05-13 11:54:41 -04:00
Sean Keely 0439dc90cd Correct merge error.
Old memory properties info name used after removing branches.
This caused the CPU coarse grain pool to initialize with random
bits.

Change-Id: I397bc5ecf09fab69bdf1d7fafadcf54d71b64070
2021-05-06 18:40:56 -05:00
Sean Keely c9ce27a640 Add exception forwarding to tools API callbacks.
Prevents poorly written tools which throw in tools interface
callbacks from causing ROCr to catch and return a generic error
code.

Change-Id: I2f5bf7104dc7d4ee688eb48423c7ffdb06bd7702
2021-05-04 02:14:20 -05:00
Sean Keely 0b7d9db964 Correct scratch in use computation.
Old logic did not consider memory held in the scratch cache to be
free when deciding whether or not to reclaim.

Change-Id: I7f7c7549c72d743edbf7c53489fe9a453dc4177a
2021-04-22 20:07:25 -04:00
Sean Keely ee8b1b64ad Report HMM driver support status.
Implements HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED.

Change-Id: If5182edcc1fa067fa514aa2c1bd326c4c42d1b64
2021-04-21 21:44:42 -05:00
Sean Keely 77046a1aaa Revert "Revert SVM and XNACK support."
This reverts commit 5bd153974d.

Conflicts:
	opensrc/hsa-runtime/core/util/flag.h

Change-Id: I16daf41588e6139126d66af54b0693de2e7e39f3
2021-04-21 14:49:43 -05:00
Sean Keely 3127d1ffdc Ensure ROCr created threads have no CPU affinity.
Change-Id: I53828dbaf055b65b61bdd11f0eadfcc806596821
2021-04-19 19:47:06 -05:00
Konstantin Zhuravlyov 15e54d684d Expose iterator for executables
Change-Id: I0c5d39fc33c15a6eb8ee10ff181c2dcf2e042675
2021-04-16 20:51:48 -04:00
Mike Li d077606e22 Get GPU cache information from KFD
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: I8dc8c97ae81c3747b7cd88cf2cdb7a9e4694a88d
2021-04-13 10:29:34 -04:00
Tony Tye a97c14abea Add support for gfx909 and gfx90c
Change-Id: I88158789cdda44a173e3ca26d2c96b8e0ea0e221
2021-04-08 22:37:30 +00:00
Sean Keely 243e29ba8e Remove emulator SRAMECC override controls.
Change-Id: Iea9e7870dbf517032f34cebec673c90226b96960
2021-04-02 02:11:05 -04:00
Sean Keely 5bd153974d Revert SVM and XNACK support.
KFD is not ready yet.

Change-Id: I61deb292ddb92185d33504c2115169888d56e211
2021-04-02 02:10:59 -04:00