Граф коммитов

2930 Коммитов

Автор SHA1 Сообщение Дата
Ken O'Brien 24d10e5c76 rocr: Fixes memory allocation issue
Fixes a bug in memory allocation in which dmabuf export only works on
GPU 0 in a multi-GPU environment.


[ROCm/ROCR-Runtime commit: 7b8a6f8ca2]
2025-06-24 14:53:14 -04:00
Sunday Clement a9a8190453 rocrtst: Add new test for querying Clock Counters
added new subtest to Agent Properties test, to check functionality of
query.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: d2b35dfee6]
2025-06-23 18:45:09 -04:00
Sunday Clement 315b1abaf9 rocr: Add hsa-agent Queries for Clock Counters
Support has been added to query the following
HSA_AMD_INFO_GET_CLOCK_COUNTERS agent info exposed through the hsa api
in rocr, rather than the user having to make a direct IOCTL call
through the kernel driver.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: e97d06530e]
2025-06-23 18:45:09 -04:00
Tony Gutierrez a62368e2ba rocr: Update Driver queue-related APIs
Update the user-mode driver queue APIs to leverage KMT types.

Move queue-related calls to the core::Driver API.


[ROCm/ROCR-Runtime commit: e03d44d742]
2025-06-23 12:21:01 -07:00
David Yat Sin 39bddd8b9d rocr: support reserving non-registered VA
Extend hsa_amd_vmem_address_reserve/hsa_amd_vmem_address_reserve_align
to support HSA_AMD_VMEM_ADDRESS_NO_REGISTER flag. This allocation can be
used to reserve virtual address ranges that can later be used by
hsa_amd_svm_attributes_set for SVM based memory allocations.


[ROCm/ROCR-Runtime commit: b3c48cc68c]
2025-06-18 18:21:11 -04:00
Chris Freehill 14b5faf333 rocr: Add missing close of dmabuf after import
[ROCm/ROCR-Runtime commit: 24f36de037]
2025-06-17 20:22:34 -04:00
David Yat Sin b0e43cc426 rocrtst: Reduce host memory limit to 90%
Further reduce upper bound for rocrtstFunc.Memory_Max_Mem
as previous limit of 95% can still trigger OOM killer.


[ROCm/ROCR-Runtime commit: 649ec63a4f]
2025-06-16 21:02:20 -04:00
David Yat Sin e3b013b208 rocr: Always send free scratch notifications
Always send notification to profiler tools when scratch memory is freed.


[ROCm/ROCR-Runtime commit: 488cfd467c]
2025-06-16 17:39:33 -04:00
Alysa Liu a36892da4d rocr: Fix wrong sizeof argument
Update size calculation from 2 * sizeof(void*) to 2 * sizeof(uint64_t)

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: 3b450397d6]
2025-06-16 13:11:07 -04:00
Sunday Clement 90e35e8486 rocr: Remove Recursive Include
Removed unnecessary header inlude in file to prevent circular include.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: 31b6474801]
2025-06-13 12:29:52 -04:00
Sunday Clement 76dbfc159c rocr: Fix Recursive Include in header files
scratch_cache.h includes amd_gpu_agent.h which then again includes
scratch_cache.h, this has now been fixed removing the unecessary
header include.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: 06efa50c09]
2025-06-13 12:29:52 -04:00
David Yat Sin b66b6991b0 rocr: Remove scratch_backing_memory_byte_size
scratch_backing_memory_byte_size was originally removed, and then put
back in e130172218. This was because it
was used by rocgdb. rocgdb code has been updated to not use this field.
Bumped _amdgpu_r_debug for the ABI change.


[ROCm/ROCR-Runtime commit: 3c0af843e3]
2025-06-12 15:33:47 -04:00
David Yat Sin 10b8b00193 cmake: Remove unused file
[ROCm/ROCR-Runtime commit: 17b8f9b24d]
2025-06-12 10:38:58 -04:00
David Yat Sin 37afa1c0eb rocr: Remove support for Kaveri GPUs
Kaveri GPUs are EoL


[ROCm/ROCR-Runtime commit: 24ce840732]
2025-06-12 10:38:58 -04:00
David Yat Sin 8982f2c2c6 rocr: Fix compile warning when using clang
[ROCm/ROCR-Runtime commit: 96d0f07b15]
2025-06-12 10:38:58 -04:00
Alysa Liu ab747b1ffd rocr: Prevent int overflow in arithmetic operation
Cast range->x and range->y to uint64_t before performing multiplication

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: 77b86ca908]
2025-06-11 19:36:36 -04:00
David Yat Sin ec4830eb5c rocr: document pseudo-code for scratch reclaim
Document CP FW and ROCr pseudo-code for asynchronous reclaim.
No code change.


[ROCm/ROCR-Runtime commit: df5d66eae5]
2025-06-11 16:19:59 -04:00
Chris Freehill 91268a6be9 rocr: Add hsa_amd_portable_export_dmabuf_v2
The original version of hsa_amd_portable_export_dmabuf() did not
consider the conditions under which a dmabuf could be shared.
In the new version (hsa_amd_portable_export_dmabuf_v2()), the caller
can specify the flag HSA_AMD_DMABUF_MAPPING_TYPE_PCIE, which means they
want to share the dmabuf over PCIe. In that case, the new code will check
that if it is a PCIe GPU and it is not in a XGMI Hive then if
large-BAR is not supported, we will return an error.


[ROCm/ROCR-Runtime commit: a34604bddb]
2025-06-09 15:42:58 -05:00
Chris Freehill 287986ab65 rocr: Add hsa_amd_portable_export_dmabuf_v2
The original version of hsa_amd_portable_export_dmabuf() did not
consider the conditions under which a dmabuf could be shared.
In the new version (hsa_amd_portable_export_dmabuf_v2()), the caller
can specify the flag HSA_AMD_DMABUF_MAPPING_TYPE_PCIE, which means they
want to share the dmabuf over PCIe. In that case, the new code will check
that if it is a PCIe GPU and it is not in a XGMI Hive then if
large-BAR is not supported, we will return an error.


[ROCm/ROCR-Runtime commit: 3a9d14bb66]
2025-06-09 15:42:58 -05:00
Sunday Clement 5c7524ba3e rocr: Fix Unintentional Integer Overflow
Its safer to have the integer literal explicitly be an unsigned long
in this expression as that's what the type of the errorCode variable
resolves to, preventing any overflow errors.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: dce52be686]
2025-06-09 15:16:10 -04:00
Sunday Clement 1eaee1649a rocr: Fix Unintended Sign Extension
ehdr->e_shentshize and ehdr->e_shnum are both 16-bit unsigned integers
and so their types get implicitly promoted to signed int automatically
during the multiplication, they must be explicitly cast into a larger
unsigned type, otherwise if the signed product is large enough the
value is sign extended resulting in incorrect values.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: d00ca2e9b7]
2025-06-09 15:16:10 -04:00
Alysa Liu 03430838af rocr: Remove structurally dead code
Remove unreachable return statement.

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: 9b3d15e68d]
2025-06-09 14:01:39 -04:00
Alysa Liu d1c3b7262d rocr: Add proper file descriptor cleanup
Ensure file descriptor 'in' is properly closed in error cases
when calling _lseek() during readFrom() operations.
Fix potential resource leak when errors occur during file operations.

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: 167602edfb]
2025-06-04 22:37:21 -04:00
Sunday Clement 1da312af87 rocr: Fix Potential Deadlock
Moved the Call to pthread_mutex_lock to an else statement for better
code readibility.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: 1635746a9c]
2025-06-04 10:18:09 -04:00
Sunday Clement 25886ecda8 rocr: Fix Potential Deadlock
Because eventDescrp->mutex is a non-recursive lock attempting to
acquire the lock with pthread_mutex_lock can cause the system to hang
indefinitely if the lock was already previously aquired with the
preceeding call to pthread_mutex_trylock.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: a97b7df4b9]
2025-06-04 10:18:09 -04:00
Alysa Liu 6de1c81b71 rocr: Fix inefficient copy operations
Refactor variable assignments to use std::move() where appropriate.
Updat function headers to accept parameters by const& where appropriate.

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: f6c8cbd293]
2025-06-02 11:18:36 -04:00
Alysa Liu 65f5ce6f0a rocr: Fixed inefficient copy operations
Changed variable assignments to use std::move() where appropriate.
Changed function headers to pass string arguments by reference where appropriate.

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: ae6851dbb4]
2025-06-02 11:18:36 -04:00
Alysa Liu b97f9ba6d5 rocr: Fixed inefficient copy operations
Changed variable assignments to use std::move() where appropriate.
Revert change in amd_kfd_driver.cpp.

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: a945b5d493]
2025-06-02 11:18:36 -04:00
Alysa Liu 88dd451c64 rocr: Fixed inefficient copy operations
Changed variable assignments to use std::move() where appropriate

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: 369d89ade3]
2025-06-02 11:18:36 -04:00
Sunday Clement 3d3cca8083 rocr: Fix Resource Leak
allocated memory was previously not freed in the event of an error
with rwlock initialization.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>


[ROCm/ROCR-Runtime commit: 293092f32f]
2025-05-30 09:16:26 -04:00
David Yat Sin d2982b797a rocr: Add all sysfs entries for L2 Cache
For L2 Cache and above, we report the total amount of cache for the
whole partition, so we add up the L2 Cache entry for each partition.


[ROCm/ROCR-Runtime commit: fc561ff37a]
2025-05-29 19:02:38 -04:00
David Yat Sin 8f7c7458aa rocr: Remove extra check for page-aligned
ROCr initially had a bug where memory allocations that were not 4K
aligned were internally 4K aligned but ROCr would not keep track
of user-requested size. This would cause some pointer_info queries
to fail, but HIP was already aligning the buffer sizes for IPC
requests. For backward compatibility accross 2 minor versions,
we allowed IPC look-ups to be both aligned and un-aligned.
Removing this check as this 4 minor versions have been released
since then.


[ROCm/ROCR-Runtime commit: d52f1d0453]
2025-05-29 12:35:15 -04:00
David Yat Sin 4515a48355 rocr: Update async-scratch reclaim API doc
[ROCm/ROCR-Runtime commit: c3978d03a4]
2025-05-28 20:08:52 -04:00
David Yat Sin 1b1d4e017a rocr:Fix compile warnings
[ROCm/ROCR-Runtime commit: 11da1293de]
2025-05-28 16:12:02 -04:00
David Yat Sin 39ecc88315 rocr: Remove deprecated doorbell type 1 support
[ROCm/ROCR-Runtime commit: 0d70045817]
2025-05-28 16:12:02 -04:00
David Yat Sin b83b8b4535 rocr: Remove deprecated queue doubleMap code
[ROCm/ROCR-Runtime commit: 4bae509296]
2025-05-28 16:12:02 -04:00
David Yat Sin e84a855c98 rocr: Remove queue_full_workaround code
Remove deprecated queue_full_workaround code as gfx7 and gfx8 GPUs are
EoL.


[ROCm/ROCR-Runtime commit: b8434529a5]
2025-05-28 16:12:02 -04:00
David Yat Sin a16f5380cd rocr: Remove addrlib files for EoL GPUs
[ROCm/ROCR-Runtime commit: 2b691c3d5f]
2025-05-28 16:12:02 -04:00
David Yat Sin 4ecd0382b7 rocr: update required CP FW version
Update required CP FW version required for async-scratch memory support
on gfx950.


[ROCm/ROCR-Runtime commit: 04dbf769f6]
2025-05-28 13:03:58 -04:00
David Yat Sin 5e7bd6145d rocr: Fix compile error when using clang
[ROCm/ROCR-Runtime commit: 9d38ca0d22]
2025-05-27 23:56:28 -04:00
Apurv Mishra 226d8126c9 kfdtest: Disable KFD RAS test case
disable KFD RAS test case as the tests cause GPU reset
which affects the active kfdtest, the tests can only be
run successfully as separate processes

Signed-off-by: Apurv Mishra <Apurv.Mishra@amd.com>


[ROCm/ROCR-Runtime commit: d9a95605cc]
2025-05-27 19:04:04 -04:00
cfreeamd c20e30db93 rocr: Support unmap adjacent mem sections in 1 try
[ROCm/ROCR-Runtime commit: f0ce7a8e59]
2025-05-27 15:13:20 -04:00
Alysa Liu 296e60d882 rocr: Add check for 'value' pointer
Replaces assertion check assert(value) with explicit null pointer check
Returns HSA_STATUS_ERROR_INVALID_ARGUMENT on null valuesrocr: Add check for 'value' pointer

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: 625425326d]
2025-05-27 12:18:04 -04:00
Alysa Liu 8cbabdbbe3 rocr: Unchecked return value as arg
v1: Add value pointer validation before
dereferencing in GetInfo method for MODULE_NAME case.

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>


[ROCm/ROCR-Runtime commit: f1f34da4f6]
2025-05-27 12:18:04 -04:00
cfreeamd 7fe67829ef rocr: Fix ISA generic's for gfx906 wrt sramecc
gfx9-generic cannot support sramecc- and sramecc+.
sramecc feature is only configurable on gfx906.

The code object produced for gfx9-generic can be loaded on both
gfx906 with any sramecc setting, compiler will produce the isa
that will correctly work on both (EF_AMDGPU_FEATURE_SRAMECC_ANY_V4).


[ROCm/ROCR-Runtime commit: b7361c5ee4]
2025-05-27 07:45:00 -05:00
cfreeamd b7d56427ec rocr: Fix ISA generic's for gfx906 wrt sramecc
gfx9-generic cannot support sramecc- and sramecc+.
sramecc feature is only configurable on gfx906.

The code object produced for gfx9-generic can be loaded on both
gfx906 with any sramecc setting, compiler will produce the isa
that will correctly work on both (EF_AMDGPU_FEATURE_SRAMECC_ANY_V4).


[ROCm/ROCR-Runtime commit: 3e99bb6150]
2025-05-27 07:45:00 -05:00
Yifan Zhang 3ab8b5a98b coredump: call KFD_IOC_DBG_TRAP_DISABLE in error path.
KFD assumes kfd_dbg_trap_enable/disable be called in pair, or there will
be kfd_process ref leak in KFD.


[ROCm/ROCR-Runtime commit: ccd91bcd19]
2025-05-27 13:54:00 +08:00
Eric Huang 0d5e261f39 libhsakmt: optimize big system buffer allocation
To change biggest single buffer to be huge page aligned
and other optimization.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>


[ROCm/ROCR-Runtime commit: afe7965796]
2025-05-26 18:30:00 -04:00
Eric Huang 2c6f84b12c libhsakmt: add big system buffer allocation support
when allocating userptr buffer in system ram with size bigger
than or equal 512G, TTM has limit and returns error, to split one
big buffer into multiple small buffers in vm_object will solve
this issue.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>


[ROCm/ROCR-Runtime commit: 8887d25304]
2025-05-26 11:04:30 -04:00
Flora Cui 4360679cb7 rocrtst: performance::memory_async_copy test fix on DXG
Signed-off-by: Flora Cui <flora.cui@amd.com>


[ROCm/ROCR-Runtime commit: e884650952]
2025-05-26 15:01:27 +08:00