Discarding blocks for reallocation on IPC export for better memory
performance trigger memory violations with DMA BUF exports so bypass
this for now as application performance drops haven't been observed
with the bypass.
The raw fragment should be passed to the DMA Buf export call as well
since offsets will be implicitly applied in the Thunk/KFD for
export/import calls.
Also, use the agent information directly from the pointer
information so that the export call doesn't have to scan memory to find
this. Pass the node ID in the handle so that the import call doesn't
have to make two thunk imports to fetch the node ID for GPU memory
imports.
Finally, allow the user to use DMA Buf IPC via
HSA_ENABLE_IPC_MODE_LEGACY=0 for developer testing as legacy mode will
be applied by default.
Change-Id: Ie8fe267f8768fa5df37126078406f7065f69ff4e
[ROCm/ROCR-Runtime commit: 32bb0764b7]
Fix some potentially unreleased memory, null value checks, files not
closed, and other such issues reported by codeql
Change-Id: Ia679aff97a773a642d8c8cbadeae30955554a62e
Signed-off-by: Kent Russell <kent.russell@amd.com>
[ROCm/ROCR-Runtime commit: d64e33520f]
In VM with 6vcpu, cpu schedule of
queue_delayed_work(system_freezable_wq) is lower than BM.
HSA_SMI_EVENT_QUEUE_RESTORE event from case HMMProfilingEvent/0 got
delayed execution and caused HMMProfilingEvent/1 fail.
The fix is only listen to HSA_SMI_EVENT_MIGRATE_START event and ignore
all other events.
Change-Id: I534e49b030bd4c534bc7a63eb431f4907659c8cd
[ROCm/ROCR-Runtime commit: 5a1b6bf14d]
Update the HSA capabilities field with precise ALU ops bit support
for GPU debugging.
Change-Id: I796f2c2e0559577828aba510c401ed5187e10179
[ROCm/ROCR-Runtime commit: 027af8dacd]
Update commentary on HWS scheduler support bit for GPU debugging in
the HSA capabilities node properties field.
Change-Id: I59c519d74a528d5ecf5817ef94e75091314bd844
[ROCm/ROCR-Runtime commit: a926a070ee]
Fix data race by protecting events_page access with mutex in event create
Fix potential NULL dereference in hsaKmtWaitOnMultipleEvents_Ext
Fix unchecked return value in hsaKmtCreateEvent function
Change-Id: I434bef43666e5205a8b061259569c1d99a952752
[ROCm/ROCR-Runtime commit: 857200e28c]
Eliminated declared but not referenced variables to fix warnings
Change-Id: I80032a699fb59ce4635c5001f669d009ba60e588
[ROCm/ROCR-Runtime commit: 303c02690d]
We had skipped doing it for PAGE_SIZE, but it should be left as the
regular PAGE_SHIFT name, especially for users who are using different
headers. We want PAGE_SHIFT and PAGE_SIZE to be consistent with one
another, so set them both explicitly to the same value if either
of them is undefined
Change-Id: I121d81c48409dd77351b59a192d824e2419a2410
Signed-off-by: Kent Russell <kent.russell@amd.com>
[ROCm/ROCR-Runtime commit: daad183bf8]
Add check before close to prevent closing invalid file descriptors
Change-Id: Ie1d50e0d55159512a14a70c1e4be058218aae668
[ROCm/ROCR-Runtime commit: ff6e1b44bf]
When an entry is deleted from the array, it's set to nullptr
but not removed. Most other functions that
iterate over the array check if the entry is nullptr
but this loop in IterateExecutables did not.
Change-Id: I763b361eea59f6df201bb86ead0234e95f2cf79c
[ROCm/ROCR-Runtime commit: f3664fd124]
Return false if trying to free a NULL pointer (or invalid size)
internally in ROCr. This is to detect errors within ROCr when trying
to free NULL pointers. If a user of ROCr tries to free a NULL
pointer, this condition should be caught at the beginning of the
Runtime::FreeMemory(...) function and return HSA_STATUS_SUCCESS. This
matches the behavior of the free(...) or delete functions that
silently ignores calls when the passed a NULL pointer.
Change-Id: I84bc26928b35023e19cd9f214b42c6ee9508029c
[ROCm/ROCR-Runtime commit: 0af7a54ebe]
Refactor VMemorySetAccess so that it can be re-used in the following
patch.
Change-Id: I341241da7a59724bb3611172f0d26b0689d7bb46
[ROCm/ROCR-Runtime commit: 8f1b05660a]
Individual simple tests such as CPUAccessToGPUMemoryTest are taking
several hours on emulators as the total amount of VRAM keeps increasing.
Limit the pool sizes to 2GB, only on emulator.
Change-Id: I4b33e8549f89413da255731e6748f606ca64a663
[ROCm/ROCR-Runtime commit: 588a5a2fd3]
Adds support for AllocateMemoryOnly inside XDNA driver.
Move the IsLocalMemory() check inside the KFD driver
since the XDNA driver can, and needs to, create handles
on system memory buffer objects.
Changed handle variable name from thunk_handle to user_mode_driver_handle,
which is more representative if we support non-GPU drivers.
Change-Id: I95db9d575afd1ab0ff2de74cea5175d9a12a721b
[ROCm/ROCR-Runtime commit: 4bf102dc6b]
If BUILD_SHARED_LIBS doesn't get set at all, other projects importing
hsakmt may have an inconsistent state regarding SHARED vs STATIC.
Instead of setting the option and setting it as an option(), just detect
the variable and use it
Change-Id: I9d5a5fc6049ca5351f5e7c63d38ee9bfcb89bdad
Signed-off-by: Kent Russell <kent.russell@amd.com>
[ROCm/ROCR-Runtime commit: 2a9572dda0]
The fmm_node_[added|removed] functions were added in the initial FMM
support, but weren't used. Remove them now since no one's referencing
them
Change-Id: I1e46e57294a72012227b38f46c7099de0b9263be
Signed-off-by: Kent Russell <kent.russell@amd.com>
[ROCm/ROCR-Runtime commit: 3b61f75f49]
License file is already there in hsa-rocr package .Devel package do not need the same
Change-Id: I08cceeb169d0c061078cd495342f78c089087f0d
[ROCm/ROCR-Runtime commit: d60f56ab32]
Adds support for the packet interface for interacting with
the Embedded Runtime (ERT) on AIE agents. The ERT is what
interprets command packets send to the AIE agent work
queues.
Change-Id: Id28fb98056b2c046354c446bdc9568d74385bea1
[ROCm/ROCR-Runtime commit: 6abb993f65]
Adds support for initialzing the XDNA driver so that
a hardware context can be created for an AIE queue.
Right now this initializes the device heap in the driver,
gets the relevant tile parameters for the AIE agent,
and creates a hardware context that backs the AIE queue.
Change-Id: Ib90e1bc67a8637f6db3ff2bebe34677843796417
[ROCm/ROCR-Runtime commit: 931733d51a]
Ensure rocprofiler-register is linked and added to DEB and RPM package dependencies.
Github ticket - https://github.com/ROCm/ROCm/issues/3654
Change-Id: Iaaaca8bfa81ca33da147673ef1be798109b70aa5
[ROCm/ROCR-Runtime commit: c30ff893a6]
Increase queue-size for co-op queues to 16K to improve performance on
some workloads
Change-Id: I4d3bf0ecbd30ebb648b68d9c5fdabadc670a386c
[ROCm/ROCR-Runtime commit: 924e11ba7f]
Add a negative test to try to free the ring buffer of a queue and
confirm that a memory error is generated.
Change-Id: I4afd95c69c62f7c3e1138d5d6c4a5fd237631e43
[ROCm/ROCR-Runtime commit: 3cb25e5236]
GFX 9.4.x has better performance for CPU-GPU copies when using
engines in reverse order from other devices.
Change-Id: I1eaebf0e837bb7f44712f40d5115df618f6a73d7
[ROCm/ROCR-Runtime commit: 509e8d863a]
If the KFD doesn't support targeting SDMA engines, ensure that ROCr
selects the correct downstream queue type by using an invalid engine.
Change-Id: Ia6848126f67f3d35ab37248633e8e0e6e2d77fff
[ROCm/ROCR-Runtime commit: 24b25003b0]
To support fully-static library ROCm builds, ensure that all global
symbols are prefixed with something meaningful to avoid collisions with
other libraries
A script was made using" objdump -C -t" to get a list of symbols,
then checking if the global symbols have a meaningful prefix (for thunk:
hsakmt or kmt in various cases)
Change-Id: Ifd353f64a3344eb60d1f6c4e041aa20967b38a59
Signed-off-by: Kent Russell <kent.russell@amd.com>
[ROCm/ROCR-Runtime commit: 3da42a0847]
Add cmake variable BUILD_ROCR so that user can elect to not
build ROCr.
Change-Id: I73bd28cde9430ba86aed50fb88ec2e42b3443dbb
[ROCm/ROCR-Runtime commit: a676d8639c]
- Use HSA_ALLOCATE_QUEUE_DEV_MEM=1 to create AQL queue in device
memory.
- Before writing AQL packet header to the queue use an SFENCE to ensure
that there is no reodering of the writes over PCIE
Change-Id: I5eacdc35108c4a1e245c75ae349b7495451aa60d
[ROCm/ROCR-Runtime commit: 3baaa6e9c0]
Fix for some places where the ISA buffers are not declared as
executable. Previous code in Thunk was blindly setting exec bit on all
memory allocations so this issue was masked.
Change-Id: Ic7a1169c69fb85ff9e8ea7bcc49a1845b37c08ff
[ROCm/ROCR-Runtime commit: fe8d8c15f1]
The function can return NULL if it fails to create the backend, so check
for NULL before using it.
Change-Id: I4d6501bffd6dd0fc0d0f2224720f7d6dca1646f3
Signed-off-by: Kent Russell <kent.russell@amd.com>
[ROCm/ROCR-Runtime commit: 545467be04]
trace is calloc'd but never freed. Free it.
Change-Id: I5795cbe5738f25a9621d24be86abb35c263fa8b7
Signed-off-by: Kent Russell <kent.russell@amd.com>
[ROCm/ROCR-Runtime commit: 4dc9d49aa6]
This reverts commit 7daedd5eef.
For APU, the PCIe atomic is supported by default. However, the PCIe
atomic feature needs to checked for dGPU. The kfd driver has already
set PCIe atomic support for APUs, so this patch can be reverted.
Change-Id: I131d5b8e095c1104e1695e7cf8b1ed178bccddde
Signed-off-by: Shane Xiao <shane.xiao@amd.com>
[ROCm/ROCR-Runtime commit: 821f6e58f9]
This is obsolete and can be dropped.
Change-Id: I4ed7d22567043f9cca39879a82e5ea945c27efc1
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
[ROCm/ROCR-Runtime commit: c574c81835]