Commit Graph

102 Commits

Author SHA1 Message Date
Spruit, Neil R b5692c04cd Support Mapping Multiple Physical Memory with one VA and Bug Fix
- Added support for mapping any portion of a virtual allocation to a
physical mapping with a lookup function for reserved virtual addresses.
- Added support for multiple mappings linked to the same virtual
reservation.
- Fixed bug with 64 bit addresses on windows with invalid addresses
passed to the user.

Related-To: LOCI-3904, LOCI-3914, LOCI-3931

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2023-01-30 02:36:10 +01:00
Warchulski, Jaroslaw bc13db734d Cleanup includes 41
Cleaned up files:
shared/source/command_stream/aub_command_stream_receiver_hw.h
shared/source/helpers/common_types.h
shared/source/os_interface/linux/drm_neo.h
shared/source/os_interface/windows/hw_device_id.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-24 14:37:36 +01:00
Spruit, Neil R f928d695e7 Support for Mapping Physical with Virtual Memory
Related-To: LOCI-3422, LOCI-3421

Signed-off-by: Neil R Spruit <neil.r.spruit@intel.com>
2023-01-20 05:17:10 +01:00
HeFan2017 2ea734491a Deferred deletion of allocations in main thread
Add a clearQueueTillFirstFailure interface to DeferredDeleter, which
iterates the queue from the front and delete the allocations in the
queue till a failure. It is called by defer deletion of allocations
occupied by mutliple contexts to unlock the execution in main thread

Related-To: NEO-7532

Signed-off-by: HeFan2017 <fan.f.he@intel.com>
2023-01-13 09:20:35 +01:00
John Falkowski 01017a5df3 L0: add support for deferred memory free as per ContextImp::freeMemExt
Signed-off-by: John Falkowski <john.falkowski@intel.com>
2023-01-12 21:05:02 +01:00
Compute-Runtime-Validation af81c79076 Revert "Deferred deletion of allocations in main thread"
This reverts commit c268e30189.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-01-04 18:33:39 +01:00
HeFan2017 c268e30189 Deferred deletion of allocations in main thread
Add a clearQueueTillFirstFailure interface to DeferredDeleter, which
iterates the queue from the front and delete the allocations in the
queue till a failure. It is called by defer deletion of allocations
occupied by mutliple contexts to unlock the execution in main thread

Related-To: NEO-7532

Signed-off-by: HeFan2017 <fan.f.he@intel.com>
2023-01-03 13:51:15 +01:00
Warchulski, Jaroslaw 0eac749fcc Cleanup includes 19
Cleaned up files:
opencl/source/api/cl_types.h
shared/source/compiler_interface/external_functions.h
shared/source/compiler_interface/linker.h
shared/source/device_binary_format/elf/elf.h
shared/source/helpers/preamble.h
shared/source/memory_manager/definitions/storage_info.h
shared/source/memory_manager/memory_manager.h
shared/source/memory_manager/os_agnostic_memory_manager.h
shared/source/program/program_info.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-03 11:02:05 +01:00
Warchulski, Jaroslaw 803bbb89d2 Cleanup includes 13
Cleaned up files:
shared/source/helpers/blit_commands_helper.h
shared/source/helpers/heap_assigner.h
shared/source/memory_manager/alignment_selector.h
shared/source/memory_manager/gfx_partition.h
shared/source/memory_manager/memory_manager.h
shared/source/os_interface/os_memory.h
shared/source/utilities/heap_allocator.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-12-16 12:36:27 +01:00
Jaime Arteaga 675272a32c Return a unique pointer for multiple calls to openIpcHandles
This to make zexMemOpenIpcHandles and zeMemOpenIpcHandle
behave similarly.

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-12-08 21:56:21 +01:00
Slawomir Milczarek 5c1b50bccf Add memory prefetch modes for single and multiple subdevices
Single-subdevice prefetch for cmd list copy-only (with bcs) and acc mode.
Multi-subdevice prefetch (default) for shared allocation with multiple BOs.

Related-To: NEO-6740

Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
2022-12-07 15:25:32 +01:00
Warchulski, Jaroslaw be647d42d9 Cleanup includes 12
Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-12-07 13:14:15 +01:00
Warchulski, Jaroslaw c10aa90815 Cleanup includes 11
Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-12-06 12:25:30 +01:00
Jaime Arteaga 99655d34f9 Return a unique pointer for multiple calls to openIpcHandle
This to follow specification, which says:

zeMemOpenIpcHandle:

- Multiple calls to this function with the same IPC handle will return
unique pointers.

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-12-01 18:42:54 +01:00
Spruit, Neil R d81b0b14a1 L0 Virtual Memory Reservation support
- Enable support for L0 Virtual Memory reservation on Linux and Windows.
- Excludes support for Linux to allow pStart option

Related-To: LOCI-3397, LOCI-1543

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2022-12-01 00:55:19 +01:00
Warchulski, Jaroslaw dfa65bd358 Cleanup includes 9
Related-to: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-11-30 14:48:50 +01:00
Mateusz Jablonski 6648adef15 Handle error in register memory allocation methods
Related-To: NEO-7412
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-11-15 17:23:55 +01:00
Patryk Wrobel 9b26e96b11 Do not copy std::vector of OS handles when it is not needed
This change replaces unneeded copying of std::vectors
with usage of const references. Furthermore, it adds
reserve() call before filling the container via push_back().

Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
2022-10-21 10:28:58 +02:00
Mateusz Hoppe 0fdb308207 Use correct context for validateHostPtr
- with per context VMs, context with subdeviceBitfield must
be selected

Resolves: NEO-7426

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-10-18 13:10:28 +02:00
Patryk Wrobel 90ba50bf52 Warn when RAII lock returned from function is discarded
Discarding RAII lock returned from function almost always
is a bug. This change introduces usage of [[no_discard]]
attribute from C++17 to prevent such misues.

Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
2022-09-01 16:53:03 +02:00
Milczarek, Slawomir 046f9d95fc zeCommandListAppendMemoryPrefetch with memory prefetch manager
Related-To: NEO-6740

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2022-08-02 20:07:31 +02:00
Kamil Kopryk d4d54f5093 Cleanup includes
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2022-07-25 09:58:38 +02:00
Lukasz Jobczyk 4ac6e09117 Do not reuse mem obj's allocation
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2022-07-19 11:42:17 +02:00
Maciej Plewka 213dc2fe24 Make CPU copy for read buffer when host ptr is write combined on DG2
With this commit on DG2 32bit driver will check if passed host ptr for
clEnqueueReadBuffer is write combined memory. If check will be true copy
will be make on CPU.

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2022-06-13 21:23:21 +02:00
Bartosz Dunajski 39c1c4d530 Remove virtual padding support
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2022-06-08 12:42:44 +02:00
Mateusz Jablonski 943ad0e1eb style: skip redundant unique_ptr::get function
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-05-10 13:22:40 +02:00
Krzysztof Gibala 4f1e01d279 Create getGmmHelper function in MemoryManager
Related-To: NEO-6523
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
2022-05-09 16:51:23 +02:00
Jaime Arteaga 3f26f45c10 Add support for IPC handles with implicit scaling
When using implicit scaling, device allocations may have
more than one internal allocation created internally. In that case,
a separate dma-buf handle per internal allocation needs to be
exported.

So introduced two driver experimental extensions to export and
import more than one IPC handle:

- zexMemGetIpcHandles
- zexMemOpenIpcHandles

Related-To: LOCI-2919

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-05-09 00:38:17 +02:00
Dominik Dabek 8d1ad5a4f3 Refactor: use stack vector for root device indices
Stack vector will not cause dynamic allocations in most circumstances
ie. number of root device indices not more than 16

Related-To: NEO-6837

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2022-04-14 14:05:42 +02:00
Milczarek, Slawomir f03f530327 Extend zeCommandListAppendMemoryPrefetch to migrate to associated device
Related-To: NEO-6740

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2022-03-23 14:21:17 +01:00
Milczarek, Slawomir c0b7f05897 Add memory prefetch for kmd migrated shared allocations
This feature is disabled by default, controlled with the knob
AppendMemoryPrefetchForKmdMigratedSharedAllocations

Related-To: NEO-6740

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2022-03-09 16:02:18 +01:00
Jaime Arteaga a010fb3634 Dont close shared handle on imported allocations
Related-To: LOCI-2272

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-03-06 04:35:47 +01:00
Lukasz Jobczyk 090bfb9642 Reuse kernel allocation
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2022-02-28 19:26:19 +01:00
Lukasz Jobczyk 0634aa3f1b Create resource with given address
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2022-02-24 17:06:19 +01:00
Bartosz Dunajski 4b0d986876 Move AllocationType enum out of GraphicsAllocation class
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2022-02-04 17:49:09 +01:00
Spruit, Neil R ae77bd1bd2 Enable Device Memory to be shared in WSL-2 with L0
- Add getMemoryManagerType to check which memory manager has been init
to determine if Linux + WDDM memory manager is in use.
- Add isNTHandle to test and verify if a handle is an NT handle during
L0 Open IPC Handle.

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2022-01-27 23:14:29 +01:00
Michal Mrozek 592eb4607e [4/n] Improve indirect allocations handling.
Add memory manager interfaces to obtain the status.
Only support when VmBind is supported.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
2022-01-26 15:24:32 +01:00
Joshua Santosh Ranjan 7fc9b2c3dc Implement UUID using pcie bdf
This patch implements the fallback method for Device UUID
using the BDF of the device for all product families.


Related-To: LOCI-2827

Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
2022-01-05 23:31:00 +01:00
Mateusz Jablonski 95610188af Fallback to cpu copy when filling work partition allocation
move some command stream receiver tests to shared

Related-To: NEO-6325
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-11-03 12:17:02 +01:00
Compute-Runtime-Validation 782a287b27 Revert "Fallback to cpu copy when filling work partition allocation"
This reverts commit 93e3d948f5.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2021-10-29 04:39:22 +02:00
Mateusz Jablonski 93e3d948f5 Fallback to cpu copy when filling work partition allocation
move some command stream receiver tests to shared

Related-To: NEO-6325
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-10-28 14:30:00 +02:00
Jitendra Sharma f8c89fe984 Refactor memory manager so as to support device reset
Move out neoDevice dependent pieces of memory manager code into
separate methods. Those methods could be used for recreating a neoDevice
after a device reset is performed.

Related-To: LOCI-2615

Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2021-10-19 07:16:29 +02:00
Milczarek, Slawomir 5aeae0cf99 Add mem advise control flags to drm alocation
Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2021-10-12 11:39:06 +02:00
Milczarek, Slawomir afa45bd9e7 Add support for mem advise to set cache policy in buffer object
Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2021-10-07 22:16:58 +02:00
Mateusz Hoppe d4a4c35759 Zero-initialize debug surface
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-09-22 14:36:36 +02:00
Kamil Diedrich 4390590831 Add shareable allocation for Windows
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
2021-08-26 13:43:55 +02:00
Bartosz Dunajski fb996a3d5b Add EngineDescriptor helper
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2021-08-12 15:19:46 +02:00
Dominik Dabek 2a7757651a Change percent of global memory returned
Related-To: NEO-5796

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2021-08-11 13:33:16 +02:00
Kamil Diedrich 2d5d071e66 Extended import device memory functionality
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
2021-08-10 13:24:56 +02:00
Andrzej Koska 94c97fc14c Allowing the creation of overlapping buffers
Related-To: NEO-5871

Signed-off-by: Andrzej Koska <andrzej.koska@intel.com>
2021-08-10 10:59:29 +02:00