Commit Graph

915 Commits

Author SHA1 Message Date
Jaime Arteaga 37ed03a15c feature: Propagate error from makeResident to caller
Have makeResident return error to the caller, instead of always
SUCCESS. This will allow interfaces like zeContextMakeMemoryResident
to fail properly.

Additionally, change the parsing of MemoryOperationsStatus from
ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY to
ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY, since when making resources
resident, it is the device running out of memory, instead of the
host.

Related-To: LOCI-4443

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2023-05-24 21:08:27 +02:00
Neil R Spruit ded9d7bff2 feature: Get Peer Allocation with specified base Pointer
Related-To: LOCI-4176

- Given a Base Pointer passed into Get Peer Allocation, then the base
pointer is used in the map of the new allocation to the virtual memory.
- Enables users to use the same pointer for all devices in Peer To Peer.
- Currently unsupported on reserved memory due to mapped and exec
resiedency of Virtual addresses.

Signed-off-by: Neil R Spruit <neil.r.spruit@intel.com>
2023-05-24 20:41:20 +02:00
Mateusz Hoppe 7d82b690e4 fix(debugger): use per-context fences for vm_bind operations
- vm_bind with user fence updates fence value independently for every
VM hence with per-context VMs, every context needs its unique fence
address. This prevents 2 contexts from updating value possibly
writing lower value than the one that was already stored

Resolves: NEO-8004

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-05-24 15:17:31 +02:00
Kamil Kopryk 915495ce28 refactor: remove not needed forward declaration
Related-To: NEO-7786
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-05-23 16:06:16 +02:00
Daria Hinz 331f167cfe feature: Add debug flag for setting hw ip version
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-7954
2023-05-23 15:32:46 +02:00
Kamil Kopryk 4be9b7e609 fix: setup ipVersion in linux paths
Get ipVersion from productHelper function on xe and upstream.
On prelim first try to query ipVersion from kmd,
if it fails, get ipVersion from productHelper function.

Related-To: NEO-7786
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-05-23 09:27:15 +02:00
Matias Cabral 38bc7ae403 build: update i915 headers
third_party/uapi/drm - from c7c12de893f808bd7c1215fe9056262295e5203b
https://cgit.freedesktop.org/drm-tip

third_party/uapi/prelim/drm from prelim v2.0-rc17
https://github.com/intel-gpu/drm-uapi-helper

Signed-off-by:  Matias Cabral <matias.a.cabral@intel.com>
2023-05-22 10:25:00 +02:00
Compute-Runtime-Validation c748fd07dc Revert "fix: initialize ipVersion in linux paths"
This reverts commit 049cd1b568.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-05-20 07:32:36 +02:00
Kamil Kopryk 049cd1b568 fix: initialize ipVersion in linux paths
Related-To: NEO-7786
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-05-19 13:49:27 +02:00
Francois Dugast ae7cff3c3e fix: waitUserFence on bind and unbind in Xe
This fixes illegal memory accesses by the job submitted to the GuC.
Also some unit tests are added to harness the vmBind operation.

Related-To: NEO-7996
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-05-18 15:27:47 +02:00
Milczarek, Slawomir ac9a96c07f refactor: Unify getters to check platform support for KMD migration
Related-To: NEO-6465

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-05-17 15:45:42 +02:00
Milczarek, Slawomir 22e6e327fc refactor: Use helper to check platform support for KMD migration
Related-To: NEO-6465

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-05-16 16:14:42 +02:00
Milczarek, Slawomir 66eb1c9c0a refactor: Add helpers to control kmd migration support on PVC platform
This commit keeps KMD migration still disabled by default on PVC platform.

Related-To: NEO-6465

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-05-15 13:51:19 +02:00
Compute-Runtime-Validation b2b41e613b Revert "fix: add alignment support to host and shared UnifiedMemoryAllocation"
This reverts commit c3df92ac41.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-05-12 13:04:08 +02:00
Diedrich, Kamil 5a4a2ab8ab feature: Add new environment variables for compiler cache
This patch add new environment variables to control compiler cache.
Works as follow: If persistent cache is set driver check if NEO_CACHE_DIR
is set. If not then driver checks XDG_CACHE_HOME - If exists
then driver create neo_compiler_cache folder, if
not then driver checks HOME directory. If each NEO_CACHE_DIR,
XDG_CACHE_HOME and HOME are not set then compiler cache is disabled.
Current support is for Linux only.

Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>

Related-To: NEO-4262
2023-05-12 10:21:27 +02:00
Lu, Wenbin c3df92ac41 fix: add alignment support to host and shared UnifiedMemoryAllocation
Related-To: LOCI-4334

Signed-off-by: Lu, Wenbin <wenbin.lu@intel.com>
2023-05-11 11:45:12 +02:00
Mateusz Hoppe 9c17cb9bd9 fix: add CLOEXEC flag when opening gpu cards
- close-on-exec prevents old file descriptor to leak when exec() is
called

Resolves: NEO-7944

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-05-09 11:53:57 +02:00
Mateusz Jablonski 769a9e515e fix: setup MultiTileArchInfo in Xe path
when discovering engines we know which tiles are available

Related-To: NEO-7931
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-05-05 15:21:11 +02:00
Filip Hazubski e8ac22c265 fix: Increase size of reported global memory available to 98%
This change applies to Linux.

Resolves: NEO-7229

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2023-05-04 13:56:26 +02:00
Mateusz Jablonski 87aab0bf6e fix: don't create fake memory regions in xe ioctl helper
populate memory info based on mem usage and gts info
propagate error from xeWaitUserFence function

Related-To: NEO-7931

Co-authored-by: Francois Dugast <francois.dugast@intel.com>
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-05-04 13:51:37 +02:00
Mateusz Jablonski 26a2a2829e fix: don't create fake distance info in xe ioctl helper
populate multi tile engine info based on gt_id from xe engine info

Related-To: NEO-7931
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-05-04 08:21:28 +02:00
Mateusz Jablonski 88c352c580 refactor: move query engine / memory info logic to ioctl helper
Related-To: NEO-7931
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-05-02 10:05:26 +02:00
Diedrich, Kamil 5149d74141 refactor: Remove globaly enabled cl_cache
Current behaviour will be detecd path existence

Related-To: NEO-4262

Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>
2023-04-28 23:28:49 +02:00
Mateusz Jablonski fd1ad7c1f0 feature: setup heap extended host size based on system memory size
Related-To: NEO-7665
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-04-28 15:23:01 +02:00
Mateusz Jablonski 5a5c20f99c fix: create separate heap for host and shared usm in 48-56b VA
Related-To: NEO-7665
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-04-28 10:09:38 +02:00
Fabian Zwolinski e351a90f81 refactor: Rename member variables to camelCase 2/n
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-04-27 20:39:22 +02:00
Milczarek, Slawomir 3ead7f6ac9 refactor: Simplify prefetch memory logic for kmd-migrated shared allocation
Related-To: NEO-7641

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-04-27 12:14:16 +02:00
Mateusz Jablonski 32d8a3bc6d fix: store registered engines per root device
in most cases we need to iterate over engines associated to single root device

Related-To: NEO-7925
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-04-27 10:54:07 +02:00
Spruit, Neil R 364c2da9fb feature: Add Support for zeMemPutIpcHandle & zeMemGet IPC Handle converters
Related-To: LOCI-4172, LOCI-4305, LOCI-4306

- Create a new IPC Memory handle upon call to getIpcMemHandle if the
previous handle has been freed.
- Release the Ipc Memory Handle when zeMemPutIpcHandle is called.
- Create a new IPC Handle for tracking thru zeMemGetAllocProperties
when ze_external_memory_export_fd_t is used.
- Convert FD to opaque IPC handle and IPC Handle to FD.

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2023-04-27 03:53:52 +02:00
Fabian Zwolinski c441e9e971 refactor: Rename member variables to camelCase
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-04-26 16:05:07 +02:00
Diedrich, Kamil 26ca64bb28 Add process safety to cl_cache on Linux
Current flow will be to have one synchronization point
config.file. Read remains unblocking, only write(caching)
operation will be blocking (lock on config.file)

Related-To: NEO-4262

Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>
2023-04-25 17:35:40 +02:00
Milczarek, Slawomir c9fdeb200c [perf] Prefetch of kmd-migrated shared allocation with initial placement on GPU
Related-To: NEO-7646

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-04-25 17:27:33 +02:00
Mateusz Jablonski 06bd405e88 feature: add debug flag to control usage of heap extended for USM Host
Related-To: NEO-7665
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-04-25 15:39:49 +02:00
Fabian Zwolinski 2022592f3d Apply CamelCase for class and struct names 2/2
Additionally change .clang-tidy not to ignore struct names.

Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-04-25 13:10:23 +02:00
Dunajski, Bartosz 6e9257c623 Debug flag to force early exit
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2023-04-25 09:44:44 +02:00
Krzysztof Gibala 16db7cc890 fix: Add missing checks in multi gpu scenario
- Check allocation root device index during eviction
- Wait for and marked allocation only from the current root device index

Related-To: NEO-7920
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
2023-04-24 23:26:28 +02:00
Milczarek, Slawomir bf778be99e [fix] zeCommandListAppendMemAdvise to clear preferred location correctly
The memadvise with preferred location for kmd-migrated shared allocation
is set to device associated with cmd list by default to migrate data
to lmem on non-atomic gpu page fault as well (for performance reasons).

Related-To: NEO-7252

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-04-24 14:51:49 +02:00
Maciej Bielski 09b111cc97 refactor: improve code reuse and readability
Extract distinct steps as dedicated functions, especially when the code
is duplicated. This eases analysis of the logic and highlights
differences between callers of a common code.

Related-To: NEO-7788
Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
2023-04-24 12:30:01 +02:00
Lukasz Jobczyk 853a65aae9 Add PCI barrier implementation
Resolves: NEO-7850

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2023-04-24 10:33:03 +02:00
Cencelewska, Katarzyna 659109adc6 fix: do not add link engines on integrated gpu
- caps check is not needed when link engines are not available for
product

Related-To: NEO-7886
Signed-off-by: Cencelewska, Katarzyna <katarzyna.cencelewska@intel.com>
2023-04-20 13:28:20 +02:00
Maciej Plewka bab299ee78 Increment fenceValue only after successful bind operation
Related-To: NEO-7835

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2023-04-19 12:26:45 +02:00
Fabian Zwolinski 3fe0272381 Do not force Cooperative Context in Offline Debugging Mode
Related-To: NEO-7630
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-04-13 22:52:01 +02:00
Milczarek, Slawomir 0ff46562db [perf] Improve placement of KMD shared allocation in scenario with subdevice 1
Improves performance for benchmarks with KMD-migrated shared allocation
in scenarios with ZE_AFFINITY_MASK=0.1.

Related-To: NEO-7881

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-04-13 17:55:50 +02:00
Mateusz Jablonski e4a446df58 feature usm: add debug flag to allocate shared USM in heap extended
Related-To: NEO-7665
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-04-13 11:30:09 +02:00
Milczarek, Slawomir 8e04a7a83f Access counters mode to not rely on KMD cross-tile migrations (by default)
Add new regkey KMDSupportForCrossTileMigrationPolicy
(disabled by default, in absence of KMD suppport for cross-tile migrations)
to control placement of shared allocation and memory prefetch behavior.

Related-To: NEO-7885

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-04-11 15:56:14 +02:00
Fabian Zwolinski a1066177a5 Attach UUID to SbaAllocations
Related-To: NEO-7630
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-04-11 12:53:03 +02:00
John Falkowski 007d39cbf7 move two functions to cpp file
Signed-off-by: John Falkowski <john.falkowski@intel.com>
2023-04-11 09:50:50 +02:00
John Falkowski e056082710 refactor graphics allocation structure elements for sub-allocation properties
Resolves:  LOCI-3772

Signed-off-by: John Falkowski <john.falkowski@intel.com>
2023-04-07 16:53:23 +02:00
Fabian Zwolinski fd971f7a61 Generate Offline Dump Context ID
On linux OfflineDumpContextId consists of
32b processId in bits 63:32
32b drmContestId in bits 31:0
Also cache linux implementation of getProcessId since
the value is constant.

Related-To: NEO-7630
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-04-04 15:58:56 +02:00
Milczarek, Slawomir b839f26ed7 Call VM prefetch for KMD-migrated shared allocation on all VMs
Call VM prefetch ioctl on all VMs for the KMD to apply
a synchronoues bind operation of buffer objects on all VMs.

Related-To: NEO-7841

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-04-04 13:01:44 +02:00