Commit Graph

215 Commits

Author SHA1 Message Date
Neil R. Spruit
46b1b2783b feature: Support for opaque IPC handles on Windows and Linux
- Added support for creating and managing opaque IPC NT handles in the
WDDM layer.
- Introduced a new flag `shareableWithoutNTHandle` to indicate if memory
can be shared without an NT handle.
- Updated the `isShareableMemory` method to accommodate this new flag.
- Added debug variable EnableShareableWithoutNTHandle to control the
behavior of sharing memory without NT handles until requested.
- Updated Linux path to enable sharing DMA Buf FDs between processes
for use in pidfd_getfd

Related-To: NEO-15345 , NEO-15346 , NEO-15347, NEO-10380

Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
2025-08-14 08:33:56 +02:00
Maciej Bielski
478c7ce9a8 fix: possible race-condition in SvmAllocationCache::insert
Related-To: NEO-15630

Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
2025-08-13 11:18:22 +02:00
Michal Mrozek
3eefd8a4ad refactor: add type for mutex and lock
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
2025-08-04 13:51:35 +02:00
Dominik Dabek
ff662b3e88 fix: usm reuse aub/tbx indirect access
When allocation is saved for reuse, remove it from allocations map.
On get from reuse, reinsert it with new allocId.

Allocations saved for reuse should not be made resident for indirect
access.

Only applicable on aub/tbx csr types.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-07-10 08:02:03 +02:00
Dominik Dabek
3dcfef5812 fix: usm reuse aub/tbx update alloc id
On getting from reuse update alloc id and increment allocations counter.
This is to ensure that making indirect allocations resident picks up the
reuse allocation.
Only applicable on aub/tbx csr types.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-07-07 15:49:16 +02:00
Dominik Dabek
e52fa32271 fix: disable usm reuse if debugger enabled
Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-07-01 14:22:15 +02:00
Dominik Dabek
dde8bf1b9b fix: usm reuse blocking free handling
on blocking free wait for engines completion before putting into reuse
mark allocation as completed and do not check is in use status on
getting

Related-To: NEO-6893, HSD-18042686276

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-06-30 11:46:45 +02:00
Dominik Dabek
bd9b458add fix: correct debug break if, usm reuse
Should break if memory manager is nullptr

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-06-26 13:25:54 +02:00
Dominik Dabek
4cbd6c79a0 fix: mark aub/tbx writable on get from usm reuse
Related-To: NEO-6893, NEO-15359, HSD-18042681561

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-06-25 19:36:16 +02:00
Dominik Dabek
5c7fd72d5f performance: enable l0 usm reuse
Do not reuse internal or imported allocations.
Mark as aub writable on getting from reuse.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-06-25 15:49:15 +02:00
Chandio, Bibrak Qamar
c1867ed981 feature: atomic attributes for shared system alloc
Related-To: NEO-13715, NEO-14862

Signed-off-by: Chandio, Bibrak Qamar <bibrak.qamar.chandio@intel.com>
2025-06-23 20:14:47 +02:00
Dominik Dabek
77e25f90d7 fix: prepare for l0 usm reuse enable
adjust ULTs
disable usm reuse in multi device l0
don't initialize usm caches if max reuse size is 0
check requested alignment when returning from cache
guard against double free

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-06-23 17:17:18 +02:00
Dominik Dabek
7a091919a4 fix: usm reuse trim, non locked vector read
Remove checking allocations.empty before lock.

Related-To: NEO-14529

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-05-19 21:17:17 +02:00
Michal Mrozek
6f4a397cfc refactor: remove not required parameter
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
2025-05-08 23:13:06 +02:00
Lukasz Jobczyk
f7939735da refactor: Adjust USM cleaner to ULLS light
Related-To: NEO-13922

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-04-15 14:05:02 +02:00
Dominik Dabek
bd516b3552 fix: usm reuse, clean from largest
When trimming old allocations in usm reuse start from largest
allocations.
This will reduce memory usage more quickly once max hold time is hit.

Related-To: NEO-6893, NEO-14429

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-04-04 14:57:15 +02:00
Dominik Dabek
3703ff550c fix: use real size when putting into usm reuse
Real allocation size should be used to properly apply limits and allow
more usm reuse hits.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-04-04 09:44:32 +02:00
Dominik Dabek
be27367020 performance: usm reuse, avoid looking up svmData
Save svmData on putting into reuse, instead of searching each time.
Change UNRECOVERABLE_IF to DEBUG_BREAK_IF.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2025-04-03 15:50:49 +02:00
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
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
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
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
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
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
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
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
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
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
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
Dominik Dabek
e55aa958b7 fix: track usm reuse usage in multiple contexts
Add tracking of memory used for usm reuse mechanism when multiple cl
contexts are used.
Tracking for device added to NEO::Device, for host added to
NEO::MemoryManager.

This fixes usm reuse using x% of memory per each context instead of
globally.

Related-To: NEO-13308

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2024-11-26 16:00:45 +01:00
Dominik Dabek
471615926f fix: adjust limiting device usm reuse
if limiting, disable device usm reuse (set max size to 0)

do not reserve vector for allocation infos if reuse is disabled

Related-To: NEO-12924

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2024-11-15 14:37:27 +01:00
Bartosz Dunajski
7bf22ed33e feature: counter based allocation peer sharing
Related-To: NEO-13079

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2024-11-13 15:01:32 +01:00
Szymon Morek
8aa5331bc1 fix: wait for latest known usage of indirect usm
Related-To: GSD-9989

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
2024-11-04 16:24:30 +01:00
Dominik Dabek
741101551e fix: add infrastructure to limit device usm reuse max memory used
Related-To: NEO-12924

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2024-10-25 21:54:41 +02:00
Dominik Dabek
9159e2acd4 fix: limit max size for allocation reuse
Limit max size for allocation reuse mechanism to 256MB.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2024-10-08 11:52:47 +02:00
Dominik Dabek
752f313808 fix: limit allocation cache memory wastage
Allocations over a certain size will be checked for memory utilization
when chosen for reuse.
If utilization is below a threshold, they will not be reused.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2024-10-01 09:49:19 +02:00
Bartosz Dunajski
fa4812f963 fix: add alignment flag support in svm path
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2024-08-01 10:40:47 +02:00
Dominik Dabek
9b3ccf73b7 refactor: host usm recycle
Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2024-07-23 16:20:21 +02:00