Commit Graph

767 Commits

Author SHA1 Message Date
Lukasz Jobczyk 0a11a96a53 refactor: Add dedicated method to check if any ULLS light enabled
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-03-31 16:36:20 +02:00
Dominik Dabek c76edaba4e fix: enable usm reuse limit based on memory usage
Related-To: NEO-14160, NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-03-27 15:14:08 +01:00
Dominik Dabek 915d657420 fix: flag to limit usm reuse based on memory usage
Host usm and device usm for igfx checks system memory usage.
Device usm for dgfx checks local memory usage.

If used memory is above limit threshold:
- no new allocations will be saved for reuse
- cleaner will use shorter hold time of 2 seconds
- cleaner will free all eligible allocations, regardless of async
deleter thread having work

Motivation: in case of gfx memory being full, making resident new
allocations will require evictions which leads to massive slowdown on
enqueue calls.
This change aims to minimize cases where extra memory usage from usm
reuse mechanism leads to above situation.

Related-To: NEO-6893, NEO-14160

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-03-27 10:25:19 +01:00
Dominik Dabek 6e998fc3c1 fix: move host usm reuse max size to mem manager
Intialize value on memory manager creation.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-03-24 08:53:30 +01:00
Lukasz Jobczyk 6cb52f71b4 fix: Avoid mutex deadlock when switch ulls light ring buffer
Related-To: NEO-14406

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-03-19 11:47:40 +01:00
John Falkowski 4d281cf51d feature: Implement appendMemoryPrefetch for Shared System USM allocations
Related-To: NEO-12989

Signed-off-by: John Falkowski <john.falkowski@intel.com>
2025-03-13 06:26:38 +01:00
Compute-Runtime-Validation fa2e3adad3 Revert "feature: Implement appendMemoryPrefetch for Shared System USM Allocat...
This reverts commit 97799b3faf.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2025-03-12 05:55:32 +01:00
John Falkowski 97799b3faf feature: Implement appendMemoryPrefetch for Shared System USM Allocations
Related-To: NEO-12989

Signed-off-by: John Falkowski <john.falkowski@intel.com>
2025-03-11 09:12:48 +01:00
Dominik Dabek 2170f5ca88 refactor: usm reuse to unique ptr
Change usm allocation cache in usm manager to unique ptr

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-03-07 15:14:58 +01:00
Dominik Dabek 9eb8e1812c feature: flag to log usm reuse operations
If flag "LogUsmReuse" is set, usm reuse will log operations to csv file.
Each line will contain: timestamp, host/device, operation type,
allocation size, true/false whether operation succeeded.

This data can then be used to produce graphs and help in analyzing
usm reuse in a particular workload.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-03-06 11:06:27 +01:00
Lukasz Jobczyk b7cba510a3 fix: Do not increase host USM alignment when CAL enabled
Resolves: GSD-10808

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-02-28 10:10:42 +01:00
Lukasz Jobczyk 20d29207cd refactor: Allow debug key to force USM cleaner with ULLS light
Related-To: NEO-13922

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-02-26 17:52:18 +01:00
Filip Hazubski b60c02d597 fix: Add asserts to ensure NonCopyable and NonMovable n/n
Related-To: NEO-14068

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2025-02-19 11:36:24 +01:00
Filip Hazubski 6b6202446b fix: Add asserts to ensure NonCopyable and NonMovable 3/n
Related-To: NEO-14068

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2025-02-18 17:16:03 +01:00
Filip Hazubski c651209617 fix: Add asserts to ensure NonCopyable and NonMovable 2/n
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2025-02-18 13:08:00 +01:00
Kamil Kopryk b1ffe640bb refactor: correct typo
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2025-02-17 23:31:27 +01:00
Filip Hazubski 4c7900008f refactor: Change wording from NonCopyableOrMovable to NonCopyableAndNonMovable
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2025-02-17 14:19:10 +01:00
Lukasz Jobczyk 356d89d608 performance: Disable USM cleaner for ULLS light
Realted-To: NEO-13922

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-02-14 12:38:16 +01:00
Lukasz Jobczyk 9085f6aeca fix: drain gem close worker on csr destroy
Resolves: HSD-18041493278

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-02-13 20:34:13 +01:00
Bartosz Dunajski 68a0aa0525 fix: return correct allocation from InOrderExecInfo getter
Related-To: NEO-13971

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2025-02-13 17:35:54 +01:00
Jaroslaw Warchulski 9732653019 performance: reuse usm allocations with similar requested size
Resolves: NEO-14009
Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
2025-02-11 10:50:27 +01:00
Chandio, Bibrak Qamar 7149743162 fix: Set vmbind user fence when makeMemoryResident
Related-To: NEO-11977, GSD-10293

Signed-off-by: Chandio, Bibrak Qamar <bibrak.qamar.chandio@intel.com>
2025-02-10 14:20:09 +01:00
Dominik Dabek e2d317aaee performance: tweak usm reuse cleaner
Cleaner thread will run every 15ms instead of 2s.
Allocations will be held for at least 10s.
If deferred deleter has elements to release, will skip cleaning cache.
Will clean only 1 allocation per cache, per cleaning run.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-02-10 12:18:13 +01:00
Jaroslaw Warchulski f07fa90483 fix: set correct allocation size in freeSVMAlloc
Resolves: GSD-10621
Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
2025-02-05 20:10:43 +01:00
Maciej Bielski 971b7c27a2 fix: enable usm compression on linux
Related-To: NEO-12056
Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
2025-02-04 13:09:04 +01:00
Compute-Runtime-Validation d23249b061 Revert "fix: Set vmbind user fence when makeMemoryResident"
This reverts commit 80dc4fb43a.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2025-01-31 11:36:29 +01:00
Chandio, Bibrak Qamar 80dc4fb43a fix: Set vmbind user fence when makeMemoryResident
Related-To: NEO-11977, GSD-10293

Signed-off-by: Chandio, Bibrak Qamar <bibrak.qamar.chandio@intel.com>
2025-01-28 22:04:37 +01:00
Dominik Dabek bebeef0e88 feature: enable usm reuse cleaner
Keep disabled in ULTs, except multi thread tests.

Related-To: NEO-13425

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-01-25 00:38:04 +01:00
Dominik Dabek 9cfc6e6bbe fix: usm reuse cleaner mt tests
Related-To: NEO-13425

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-01-22 18:21:18 +01:00
Mateusz Hoppe 19a0a27862 refactor: adjust unit tests to work with secondary engines
Related-To: NEO-12952, NEO-13789


Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2025-01-22 13:31:43 +01:00
Dominik Dabek 3f646839ca fix: usm reuse cleaning unused allocations
mechanism for freeing allocations saved for reuse that have not been
used in a given time

Related-To: NEO-13425

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-01-21 14:23:19 +01:00
Dominik Dabek 474b91aa36 fix: move device usm reuse max size to device
Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-01-20 18:05:37 +01:00
Lukasz Jobczyk 2dd9940f60 Revert "fix: count active modules for enabling per-dispatch private memory"
This reverts commit a483b361f9.

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-01-15 15:03:37 +01:00
Compute-Runtime-Validation af031ee0e3 Revert "performance: align structures for 64-bit platforms"
This reverts commit 9f07f56f7f.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2025-01-15 09:02:01 +01:00
Wenbin Lu a483b361f9 fix: count active modules for enabling per-dispatch private memory
Related-To: NEO-13086

Signed-off-by: Wenbin Lu <wenbin.lu@intel.com>
2025-01-10 15:03:34 +01:00
Jack Myers 7f9fadc314 fix: regression caused by tbx fault mngr
Addresses regressions from the reverted merge
of the tbx fault manager for host memory.

Recursive locking of mutex caused deadlock.

To fix, separate tbx fault data from base
cpu fault data, allowing separate mutexes
for each, eliminating recursive locks on
the same mutex.

By separating, we also help ensure that tbx-related
changes don't affect the original cpu fault manager code
paths.

As an added safe guard preventing critical regressions
and avoiding another auto-revert, the tbx fault manager
is hidden behind a new debug flag which is disabled by default.

Related-To: NEO-12268
Signed-off-by: Jack Myers <jack.myers@intel.com>
2025-01-09 07:48:53 +01:00
Semenov Herman (Семенов Герман) 9f07f56f7f performance: align structures for 64-bit platforms
Signed-off-by: Semenov Herman (Семенов Герман) <GermanAizek@yandex.ru>
2025-01-09 06:03:39 +01:00
Lukasz Jobczyk 983b46fbbb performance: Align host USM to 2MB
Only on discrete devices and if size is greater than 2MB

Resolves: NEO-12652

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-01-07 14:32:26 +01:00
Dominik Dabek 5b429dd415 fix: usm reuse, check for in use before returning
Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2024-12-20 18:24:18 +01:00
Compute-Runtime-Validation 124e755b9d Revert "fix: regression caused by tbx fault mngr"
This reverts commit 9a14fe2478.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2024-12-19 17:35:03 +01:00
Jack Myers 9a14fe2478 fix: regression caused by tbx fault mngr
Addresses regressions from the reverted merge
of the tbx fault manager for host memory.

This fixes attempts by the tbx fault manager
to protect/unprotect host buffer memory, even
if the host ptr was not driver-allocated.

In the case of the smoke test that triggered
the critical regression, clCreateBuffer was
called with the CL_MEM_USE_HOST_PTR flag.
The subsequent `mprotect` calls on the
provided host ptr then failed.

Related-To: NEO-12268
Signed-off-by: Jack Myers <jack.myers@intel.com>
2024-12-18 23:16:36 +01:00
Filip Hazubski a0cc124b2e performance: Pass RootDeviceIndicesContainer by reference
Additionally pass std::map by reference in UsmMemAllocPoolsManager c-tor.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2024-12-17 14:18:30 +01:00
Dominik Dabek d298e5ddb3 refactor: usm reuse, memory manager pointers
Keep pointers to memory managers in reuse structure.

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2024-12-16 17:09:51 +01:00
Mateusz Hoppe 0589a70dc7 feature(sysman): reinitialize gfxPartition on reset
Related-To: NEO-13203

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2024-12-12 16:27:25 +01:00
Compute-Runtime-Validation 6c5d9a6ed7 Revert "feature: extend TBX page fault manager from CPU implementation"
This reverts commit 51c0e80299.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2024-12-12 12:30:22 +01:00
Jack Myers 51c0e80299 feature: extend TBX page fault manager from CPU implementation
In TBX mode, the host could not write to host buffers after access from device
code due to the lack of a migration mechanism post-initial TBX upload.
Migration is unnecessary with real hardware, but required for TBX.

This patch introduces a new page fault manager type that extends the original
CPU fault manager, enabling automatic migration of host buffers in TBX mode.

Refactoring was necessary to avoid diamond inheritance, achieved by using a
template parameter as the base class for OS-specific fault managers.

Related-To: NEO-12268
Signed-off-by: Jack Myers <jack.myers@intel.com>
2024-12-11 09:09:50 +01:00
Filip Hazubski 3315db7d92 fix: Correct mutex logic in SVMAllocsManager::freeSVMAllocImpl
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2024-12-10 16:16:53 +01:00
Compute-Runtime-Validation 484210d656 Revert "fix: limit usm device reuse based on used memory"
This reverts commit 1252b10ba9.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2024-12-05 23:17:51 +01:00
Fabian Zwoliński d2ce3badfc fix: bindlessHeapsHelper handle unavailable external heap
This PR handles the situation in which a component
has reserved a front window space for itself in the external heap,
so that the Compute Runtime cannot access this area.

In such a situation, we perform the following steps:
1. reserve 4GB chunk in heapStandard
2. split our chunk into 2 parts: heapFrontWindow, heapRegular
3. from this point on, map all linearStream allocations in reserved 4GB
chunk

Patch applies to Windows and WSL.
Patch only applies when the bindless global allocator is enabled.

Related-To: HSD-16025889919
Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
2024-12-05 14:18:01 +01:00
Dominik Dabek 1252b10ba9 fix: limit usm device reuse based on used memory
Calculate available memory for usm device reuse based as (total device
memory - used memory) * fraction for reuse.

Use sys mem allocs for devices without local memory.

Related-To: NEO-12902

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2024-12-04 08:11:23 +01:00