Graf commitů

1165 Commity

Autor SHA1 Zpráva Datum
David Yat Sin 566e2c60fd PC Sampling: Add create and destroy APIs
Implement PC Sampling session create and destroy APIs.

Change-Id: I93370d3d01b74ee15e71b8b0e20feb8f0066a3dc

Signed-off-by: David Yat Sin <David.YatSin@amd.com>
Signed-off-by: Vladimir Indic <Vladimir.Indic@amd.com>
Change-Id: Ib0c64356a1a4616b12d5dbeebe16273fe2a84abe


[ROCm/ROCR-Runtime commit: 632f9e60f7]
2024-04-11 12:52:35 -04:00
David Yat Sin 0a4415f202 PC Sampling: API to list supported configurations
Add new PC Sampling API to list the supported PC Sampling methods and
options on a specific agent. If there is already a PC Sampling session
active on this agent, the list of methods returned will be reduced to
methods that can be run simultaneously with the current active session.

Change-Id: I42ac2b8f30d5c368faf8ed4cf37ca4134db22985


[ROCm/ROCR-Runtime commit: 295acf6b27]
2024-04-11 12:52:30 -04:00
David Yat Sin 8165c03e7b PC Sampling: Create PC Sampling interfaces
Create new interface group for PC Sampling

Change-Id: I59b4cfe9f8d1ae313dc28be1d2ed49f750d8212b


[ROCm/ROCR-Runtime commit: 0bc244e10a]
2024-04-11 12:52:23 -04:00
David Yat Sin b79e044711 PC Sampling: Update public headers for new APIs
Change-Id: Ib9987efdb41d5f6d203e7e86f9b26809d020e04e


[ROCm/ROCR-Runtime commit: 6a7122b183]
2024-04-11 12:52:16 -04:00
David Yat Sin bc77ec44f6 Create fine-grained allocator
Create allocator helper function to provide fine-grained memory on
a specific agent.

Change-Id: I32ba9aceb9c9dc708b140a0c45158e6e7a018844


[ROCm/ROCR-Runtime commit: 71f1a6726c]
2024-04-11 12:52:10 -04:00
David Yat Sin 6b38aecae9 Extend ExecutePM4() to accept completion signal and fences
ExecutePM4() function can optionally accept extra arguments for
acquire fence scope, release fence scope andcompletion signal. When
a completion signal is provided, ExecutePM4() does not wait for the
commands to complete.

Change-Id: Ib2a433b7bce1cb6260be8b76fe902335bd5dfada


[ROCm/ROCR-Runtime commit: 721e56ef5c]
2024-04-11 12:51:52 -04:00
David Yat Sin f3db911e3c Add limit checks for HSA_SINGLE_SCRATCH_LIMIT
Hard limit for scratch is 4GB per XCC and checks in case user specifies
values exceeding this value

Change-Id: Ib3cade762ff66c7e7d6a2d311e482cacbcf2b0de


[ROCm/ROCR-Runtime commit: d7adc94e3f]
2024-04-11 14:03:25 +00:00
Konstantin Zhuravlyov 45eafcf4ea loader: allow but skip static relocations for code object v2+
Change-Id: I4ae14cb5e740d7d45810b75038b15a0b94d2bf0b


[ROCm/ROCR-Runtime commit: 08c94463de]
2024-04-09 11:39:18 -04:00
Konstantin Zhuravlyov ae24ca1528 Switch to per-executable contexts in the loader
- Per-executable contexts should be used from now on
  - Global contexts are left as is for now for backwards
    compatibility and will be phased out in follow up
    patches.

Change-Id: I6291abf865c7ed24ee71f5065e539afc23f5ce64


[ROCm/ROCR-Runtime commit: b983c19729]
2024-04-09 10:31:51 -04:00
Shweta Khatri 89e51e1f63 Revert "Use HybridMutex for IPC locks"
This reverts commit 5c520f4544c654e5f18e05cabd1c63d64473cfab.

Reason for revert: This patch is introducing a synchronization related bug in Unit_hipGetSetDevice_MultiThreaded testcase.

Change-Id: I367e4d4f1d75b21658ac1127c58982894a97cedb


[ROCm/ROCR-Runtime commit: 244ad319ac]
2024-04-02 12:27:55 -04:00
David Yat Sin b19929b090 Temporary: Set AllocateGTTAccess and node_id for MES
Temporary change to set the AllocateGTTAccess flag and node_id
on MES devices.

Change-Id: I22385d11b17b76cfb44278fa0d8a09bc8721cea6


[ROCm/ROCR-Runtime commit: efe455c2fa]
2024-03-29 19:38:19 +00:00
Konstantin Zhuravlyov 2a7fb7a808 Add R_AMDGPU_ABS32 support
Change-Id: I0ee0302d919ede44765adf02eab15015573efef2


[ROCm/ROCR-Runtime commit: 9e8f185397]
2024-03-26 18:47:29 -04:00
Konstantin Zhuravlyov 853ccdecbb Add dynamic relocation types (NFC)
Change-Id: I1b443003077ba241f34444da293e362266c2ae92


[ROCm/ROCR-Runtime commit: c5e74b7d0a]
2024-03-26 18:47:05 -04:00
Konstantin Zhuravlyov ec66509986 Rename existing relocation types to legacy/v1 (NFC)
Change-Id: Ided7f656c34131b8067a19c0d3b2955fc8823628


[ROCm/ROCR-Runtime commit: b2c32ad6cb]
2024-03-26 18:46:50 -04:00
Shweta.Khatri 565dbac2d4 Replace lazy_ptr's Init() with reset() method
The function Init() called by one of the constructors of lazy_ptr is undefined.
Replacing with reset method sets the object to an uninitialized state and assigns a new constructor function

Fix submitted on github by zhoumin2 - https://github.com/ROCm/ROCR-Runtime/pull/184

Change-Id: I7d906d526ce7fe7e2548b01810e6395b13497bf3


[ROCm/ROCR-Runtime commit: 00b63f7452]
2024-03-26 15:07:34 -04:00
Shweta.Khatri cef0e09844 Convert some comments to Doxygen-style comments
hsa_ext_amd.h - Fix provided by github developer - Mátyás Aradi
Github request - https://github.com/ROCm/ROCR-Runtime/pull/187

Change-Id: I63e4175caebd10be0151f21bd5f048dd011aaf06


[ROCm/ROCR-Runtime commit: 02a40e9272]
2024-03-25 11:47:14 -04:00
David Yat Sin 7382f5b5b3 Fix uninialized variables
Change-Id: Ie5da4547fa764e55162aff287cbb338ed4324093


[ROCm/ROCR-Runtime commit: 9d842dd1d8]
2024-03-14 15:20:56 -04:00
pvanhout 8e43aaab04 [libamdhsacode] Support COV6/Generic Targets
Change-Id: I4680577eb56dc436fbc134b169f172dd476bff37


[ROCm/ROCR-Runtime commit: a93c18dc90]
2024-03-12 07:37:32 -04:00
Jonathan R. Madsen 64d380d125 Add hsa_api_trace_version.h
- hsa_api_trace.h contains C++
- rocprofiler-sdk needs to include the table version number defines (*_MAJOR_VERSION and *_STEP_VERSION) for the HSA API in it's public headers
- rocprofiler-sdk needs it's public headers to be C-compatible so hsa_api_trace_version.h was created

Change-Id: Ieece990b3b7775cb0446b545c9e3391c5f691c61


[ROCm/ROCR-Runtime commit: 5402842d5f]
2024-03-12 01:17:34 -04:00
Jonathan Kim 5cfa60e03e Fix deferred dmabuf export on IPC due to GEM object loss
When deferring a dmabuf export on an import call, there may be a
failure to export as the GEM object is not referenced by the kernel
mode driver.  To get around this, do a non-deferred export and
immediately close the dmabuf FD to keep FD creation to a minimum.
This way, the GEM object will have a kernel mode driver reference
when a deferred export is done.

Also a bad dmabuf FD sent over a socket may not be received by an import
reader and this can cause a hang.
Set a 10 second timer so that importer is not blocking indefinitely.

Change-Id: I11a9b5ec64aa2e16fd6aecdf46c34e4eb56ccfd0


[ROCm/ROCR-Runtime commit: eb2100daad]
2024-03-07 12:12:06 -05:00
Alex Sierra 7721aadf66 core dump: Generates a core dump from a fault event
Extracts and creates a core dump ELF file from a fault event, using
core dump front end. GFX11 is not supported.

Signed-off-by: Alex Sierra <Alex.Sierra@amd.com>
Change-Id: I5ae154e886f39ab3ce7bbae5803efb27a96c7e2e


[ROCm/ROCR-Runtime commit: cbeddf9eb6]
2024-03-05 09:28:44 -05:00
Lancelot SIX 7f763d499a trap_handler: Set status.skip_export when halting a wave
When inspecting waves on architectures where SPI may not initialize TTMP
registers, the debugger cannot reliably know if the trap handler was
entered and if it saved valuable information in TTMP registers.

This patch uses the status.skip_export bit (unused by the compute
shaders) to indicate that it got executed before halting a wave.
This is done except for gfx940, where ttmp11[31] can be used (as long as
TTMP registers are always initialized by SPI for this architecture).  It
could be possible to be more selective as architectures always
initializing TTMP registers do not require this step, but always doing
is makes maintenance simpler.

Change-Id: I5c4148c78062f7ffa049ac7856c2edc82dbc77d1


[ROCm/ROCR-Runtime commit: 5d3f6a63f1]
2024-03-05 09:28:33 -05:00
Jonathan Kim f9a6578b6b Disable SDMA ganging on non-APU multi-partition modes
Work around SDMA hang in non-SPX modes for non-APU devices by disabling
ganging.
Root cause of hang not found.
non-APU xGMI modes have only 1 link between socket devices anyways so
there's likely no real system level gain in ganging intra-socket.

Change-Id: Ia4eda2f85cbf25151d3dbcf50cc45b8b775c60e2


[ROCm/ROCR-Runtime commit: ed462035fa]
2024-02-28 14:52:01 -05:00
Jonathan Kim 1e46d28ee6 Fix gang item wait on dependency signals
Gang items have to wait on dependency signals as well as the leader.
Copies should not start if shaders are still operating on memory
to be copied.

Change-Id: I99703b420045ebcba2c9da39ec64678129dc140f


[ROCm/ROCR-Runtime commit: ed260ea970]
2024-02-27 12:45:41 -05:00
Shweta Khatri a0ebf06e6e Record interop mapped object in allocation_map_
This allows the VA to be recorded in ROCr so that they are not
treated as an invalid pointer in future API calls.

Change-Id: I8d1d8ef9816a984c89d30a2179b0ce8940fef1da


[ROCm/ROCR-Runtime commit: f2006d6899]
2024-02-26 13:40:55 -05:00
Jonathan R. Madsen c85e1dc4cd Update rocprofiler-register support
- add rocprofiler-register to CPACK_DEBIAN_BINARY_PACKAGE_DEPENDS when found
- add rocprofiler-register to CPACK_RPM_BINARY_PACKAGE_REQUIRES when found
- remove report_tool_load_failures_explicit_
- add HSA_TOOLS_DISABLE_REGISTER flag
- add HSA_TOOLS_REPORT_REGISTER_FAILURE
- use HSA_TOOLS_REPORT_REGISTER_FAILURE instead of HSA_TOOLS_REPORT_LOAD_FAILURE
- changed rocprofiler-register message to not include the word "error"

Change-Id: Ib7fd7f14c42758a54c347874018281bb1b5477a6


[ROCm/ROCR-Runtime commit: 7ce263b0e4]
2024-02-22 11:55:25 -05:00
Shweta Khatri 7b3dbd6d9e Avoid releasing scratch for blit queues
At hsa_shutdown(), scratch_lock_ may be gone. Blit queues don't need it.

Change-Id: Ic132ac8a6be31fb2f0623137115608b0b222f077


[ROCm/ROCR-Runtime commit: 24633c7a85]
2024-02-22 14:12:05 +00:00
Jonathan Kim 18d556cba7 Fix export-close race during IPC attach request
If two attach requests to the same piece of shared memory occur,
a double export or premature dmabuf fd close can occur since the export
and close on demand calls are not atomic.

Use a reference counter on shared memory dmabuf FDs that have
already been opened to avoid this problem.

Change-Id: I14a59209c0385e32582af42a57b33b1c6838a9b1


[ROCm/ROCR-Runtime commit: 1f63ea3476]
2024-02-22 14:12:05 +00:00
David Yat Sin 5288e97de6 rocrtst: Add non-contiguous VMM map tests
Add rocrtst to test mapping non-contiguous memory to a
single VA range

Change-Id: Id2e57f83512f8b482456b2b1925586951ada7400


[ROCm/ROCR-Runtime commit: b77ade9c64]
2024-02-22 14:12:05 +00:00
David Yat Sin a4003bb849 rocrtst: Add test for GPU access to memory
Add test to verify whether GPU shaders can read memory created using VMM
APIs.
Split VMM rocrtst to two separate groups: Basic and Access tests

Change-Id: Iead8d46125580c71ccd582e967c8e2e891e75c5e


[ROCm/ROCR-Runtime commit: 99e31e43aa]
2024-02-22 14:12:05 +00:00
David Yat Sin 1e44ddc349 Fix compile error when using clang
Change-Id: Ibacf094934a9b489c052a18eeb6b26639aba3032


[ROCm/ROCR-Runtime commit: 1f50219634]
2024-02-22 14:12:05 +00:00
David Yat Sin 7a6c962b36 Fix compile error on certain gcc versions
Change-Id: I8a4fab76d1dcc576eb7706ab45fc786c0cab274a


[ROCm/ROCR-Runtime commit: 5b28a1bc17]
2024-02-13 15:25:34 -05:00
David Yat Sin 65497f8f2c Use sysconf pagesize for system pagesize
Provided by user huanggyizhi on github
https://github.com/RadeonOpenCompute/ROCR-Runtime/pull/124

Change-Id: Ia03c45f7a869ae2c804accf8163f8ae36c20dd5a


[ROCm/ROCR-Runtime commit: ae16b3e14e]
2024-02-13 14:28:10 -05:00
Joseph Huber 3f872d8c97 Add executable symbol info for the wavefront size
The wavefront size is currently only exposed as an agent level
attribute. This is not correctyl, because while the agent has a default
wave front size that is usually correct, it can easily be overridden via
options like -mwavefrontsize64 on various ISAs. The wavefrontsize
attribute is actually more of a calling convention that is consistent
within a callgraph. Because the root of each call graph is a kernel in
this architecture, we need to be able to query this on a per-kernel
basis. This information is already avialable in the kernel descriptor
packet, but it wasn't exported.

This patch adds HSA_CODE_SYMBOL_INFO_KERNEL_WAVEFRONT_SIZE as a new
option to query on the executable symbol.

Change-Id: I744815c89cc9d4c82f25479bdd48ae1f32e859ff


[ROCm/ROCR-Runtime commit: 9e26cbac14]
2024-02-09 15:55:30 +00:00
Jonathan Kim 8ac93cff2e Minimize FD creation on IPC Create
Instead of caching shared memory fds for export on the exporter side,
only export the FD in the async handler when requested.
The importer should request export fd closure once import is done.

Change-Id: I469e0cd1749beeb9c506c8a6461745fb039d9c3b


[ROCm/ROCR-Runtime commit: e911335cee]
2024-02-07 18:50:54 -05:00
Mythreya 8c4d3fc62f Fix ToolsApiTable versioning
ToolsApiTable's version was incorrectly default initialized to 0.
Fixes error in commit fc889669

Change-Id: I41e9301a9c33b119ee50f6164d21ddf11dc188c4


[ROCm/ROCR-Runtime commit: 8e312471dc]
2024-02-07 17:02:32 -05:00
Shweta Khatri 7a310f2e91 Set max_alloc to 95%,reduce by 1% on fail
Prevents OOM-Killer trigger,if all physical and swap mem gets fully used

Change-Id: I70d558fa9c06fe6217e62d57e11aec6a089aa0bb


[ROCm/ROCR-Runtime commit: 13800cc6d5]
2024-02-07 14:46:58 -05:00
David Yat Sin 1f38927b0d VMM: Allow non-contiguous memory maps
Adjust code to allow the use of non-contiguous chunks of memory to be
mapped within a single VA range.

Change-Id: Ida21ba202927229347b3a32d9b7106df10819cf5


[ROCm/ROCR-Runtime commit: f7de85082e]
2024-02-07 16:56:52 +00:00
David Yat Sin 2ab36a8f08 rocrtst: Add some tests for hsa_amd_pointer_info
Add tests to catch whether ROCr breaks ABI compatibility with the
hsa_amd_pointer_info API in case the hsa_amd_pointer_info struct is
extended.

Change-Id: I4e69bf30db9791e59f895b2798b87985c41242e5


[ROCm/ROCR-Runtime commit: 776da1a3f7]
2024-02-07 16:56:52 +00:00
David Yat Sin 1d9eaae944 Improve documentation for set_async_scratch_limit API
Change-Id: I03ca986cdd468c7b167e119bd2f25d5c79ff2142


[ROCm/ROCR-Runtime commit: 0f30da58a7]
2024-02-07 16:56:52 +00:00
Mythreya e5d4513c7b Initial support for scratch allocation tracking
Add new tools table and functions to notify in case of an event

Change-Id: I47f0c2f3c8e02d7bcb74d649903eb4f86721c154


[ROCm/ROCR-Runtime commit: a67af3807f]
2024-02-07 16:56:52 +00:00
Joseph Greathouse 30a05ed11e Fix undefined behavior in definition of hsa_amd_memory_fault_reason_t
Currently, the definition of hsa_amd_memory_fault_reason_t tries to
set a constant of 0x8000_0000 by using the definition "1 << 31".

However, the 1 in this definition is a signed integer by C++ rules.
On our architectures, shifting a signed integer by 31 results in
signed integer overflow. Signed integer overflow results in
undefined behavior.

Forcing the 1 to be unsigned avoids this.

Change-Id: I860431eeede4eff29598f646abf3c1337b048d71


[ROCm/ROCR-Runtime commit: 1d6691e06b]
2024-02-07 16:56:52 +00:00
Jonathan Kim d9d10761f5 Fix copy logic on devices with no xgmi SDMAs
Fix gang factor overwrite of 0 if there are no xGMI SDMAs
on the device and gang factor is 1.

Change-Id: I041d4b4ae87fb68f224ee4dedb758c6f06c022a9


[ROCm/ROCR-Runtime commit: 1dd4a7dc18]
2024-02-07 16:56:52 +00:00
Jonathan Kim 39e3120f44 Fix IPC import on device memory with no requested nodes
Users can import device memory without specifying the target node.
DMA buf imports return a Thunk handle that's not useful for
gpu mapping calls.

Fix this by using the import node information to re-import and
map with the correct target GPU.

Also fix IPC detach calls by deregistering the Thunk handle
import immediately during attach instead of failing to do it later
on detach since Thunk handles aren't placed into ROCr allocation
map.

Finally refactor the IPC attach function for cleaner logic flow.

Change-Id: Ib2bf178110b2be98bd6917c765f724e4e613f5f2


[ROCm/ROCR-Runtime commit: a3efd13a2f]
2024-02-06 23:15:29 +00:00
Jonathan Kim 976cf45b0c Fix DMABuf FD closure for IPC attach client
We should also close the client side dmabuf fd after importing for target
nodes.

Change-Id: I74f61dd65bebb03dc002f5df7301efd1ef8d9603


[ROCm/ROCR-Runtime commit: 15691ae460]
2024-02-06 23:15:29 +00:00
Jonathan Kim 15127c6f85 Optimize and fix SDMA gang copies
Optimizations include:
- Greedy gang by placing gang leaders on first D2D sdma blit context
to avoid dead locking with other gang leaders and items.  Note that
this is fine since we can't avoid an oversubscription problem when
there is only 1 xGMI link anyways, so treat all xGMI links as a single
pipe for ganging.
- Non-leader gang items don't have to poll on dependency signals so this
opens up more non-blocking SDMA channels.
- unlock gang lock when gangs are not needed.
- Change gang factor lookup from vector pair to map and register all
gpus in gang factor lookup regardless of link type so that we can take
advantage of the O(logN) direct key/value lookup time.

Fixes include:
- HSA_PAGE_SIZE_4KB was an incorrect macro to use for gang size limit.
As a result, small copies ended up ganging and hitting latency limit.
Use hardcoded 4096 bytes instead.
- Cap auxillary gang factor to the number of non-XGMI SDMA engines.

Change-Id: Ic23fde131502906a807134a04599aa6d012e8cbb


[ROCm/ROCR-Runtime commit: 62f3f250ce]
2024-01-25 10:42:27 -05:00
James Zhu 399abc66f7 rocrtst: change max memory search algorithm.
The old max memory search algorithm is using Binary Search
algorithm to find last successful memory allocation. But each
successful memory allocation takes times. Since the unsuccessful
memory allocation returns very quick. Changing the search algorithm
to find first successful memory allocation starting from MAX, each
testing step with granularity interval will speed up this test.

Change-Id: Idada3c6f750c94f3bb223f4f3bff4e4ebd3e98f7
Signed-off-by: James Zhu <James.Zhu@amd.com>


[ROCm/ROCR-Runtime commit: caedadcc6f]
2024-01-18 13:46:44 -05:00
Sam Wu b9a5201cbc Apply doc standards for ReadtheDocs builds
Applies the following changes:
add version number to documentation left navigation bar and page title
add an "About" section with a license page
enable htmlzip, pdf, epub formats when publishing on Read the Docs
set pdf title, author, copyright, and version
rename .sphinx/.doxygen to sphinx/doxygen
remove docBin from URL
update rocm-docs-core dependency

Change-Id: I947cf32cd42d9f4e55b1ddd324ad4a7e4ba3f3e3


[ROCm/ROCR-Runtime commit: 1c6ad56dc6]
2024-01-18 12:07:27 -05:00
David Yat Sin 8450291bac VMM: rocrtst for exporting/importing dmabuf
This is part of patch series for Virtual Memory API.

Change-Id: I1f1357a39b48b0d0611967ce9dd0b83b6a8db864


[ROCm/ROCR-Runtime commit: 84c30dd735]
2024-01-17 10:25:20 -05:00
David Yat Sin 99ced0140e VMM: rocrtst for basic virtual memory APIs
This is part of patch series for Virtual Memory API.

Change-Id: Ic3b44435cb09ad17d833b4a4b2551bd211b494e9


[ROCm/ROCR-Runtime commit: a69c1e9f39]
2024-01-17 10:25:09 -05:00