Commit Graph

93 Commits

Author SHA1 Message Date
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
Kamil Kopryk
73b2104183 Rename L0HwHelper -> L0GfxCoreHelper
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2022-12-05 11:26:05 +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
Jaime Arteaga
4dfdbd612d Fail when handle cannot be obtain for an allocation
If a handle cannot be obtained, like PRIME_HANDLE_TO_FD, then
properly check for the error and propagate it upwards.

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-11-30 20:59:02 +01:00
Compute-Runtime-Validation
565d44e59c Revert "Fail when handle cannot be obtain for an allocation"
This reverts commit 4391ad21bb.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-11-23 05:45:01 +01:00
Jaime Arteaga
4391ad21bb Fail when handle cannot be obtain for an allocation
If a handle cannot be obtained, like PRIME_HANDLE_TO_FD, then
properly check for the error and propagate it upwards.

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-11-22 19:29:19 +01:00
Kamil Kopryk
146e18d9a4 Move L0HwHelper ownership to RootDeviceEnvironment 2/n
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>

Use RootDeviceEnvironment getHelper<L0CoreHelper> for
- imageCompressionSupported
- usmCompressionSupported
- forceDefaultUsmCompressionSupport
2022-11-15 15:49:55 +01:00
Lukasz Jobczyk
ff500e0de6 Add support for external hostptr in shared allocations
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2022-11-09 14:48:01 +01:00
Zbigniew Zdanowicz
27d042107a Add feature to estimate number of event packets
Related-To: NEO-7469

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2022-11-04 18:38:17 +01:00
Zbigniew Zdanowicz
b284b727e9 Fix number of available events in IPC event pools
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2022-11-03 13:06:28 +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
Patryk Wrobel
2dd3c11248 Do not copy ze_ipc_mem_handle_t in internal functions of NEO
The size of this type is at least 64 bytes due to
ZE_MAX_IPC_HANDLE_SIZE. This change introduces usage
of const reference instead of copying.

Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
2022-10-17 13:51:03 +02:00
Patryk Wrobel
90597995d2 Do not copy ze_ipc_event_pool_handle_t in internal functions of NEO
The size of this type is at least 64 bytes due to
ZE_MAX_IPC_HANDLE_SIZE. This change introduces usage
of const reference instead of copying.

Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
2022-10-17 13:17:24 +02:00
Jim Snow
8e9242dc92 Support ray tracing memory allocation extension in L0.
Related-To: NEO-5579

Signed-off-by: Jim Snow <jim.m.snow@intel.com>
2022-10-08 01:13:12 +02:00
Zbigniew Zdanowicz
55be825dda Rename files to use unique names
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2022-10-07 09:39:51 +02:00
Lukasz Jobczyk
4bd27e4d3e Store context handle in cmd list
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2022-09-08 19:32:47 +02:00
Jaime Arteaga
3f5c3a8cdf Fix P2P support for implicit scaling (2)
When creating a remote allocation for P2P access, pass the correct
device handle so all handles are used.

Related-To: LOCI-3122

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-08-29 23:30:04 +02:00
Neil R Spruit
ada9b5d4a9 Handle if L0 Event Memory is Shareable
- Properly check for IPC event handle flag to determine if the event
pool memory is sharable between processes.
- Given Host Visible Event Pool, a check is done to determine if the
Host memory can be shared between the processes.
- Enabled handling if Event Host Memory is shareable for DRM
- If Event Pool Memory is Not shareable, then retrieving the IPC Event
Pool Handle returns unsupported.

Signed-off-by: Neil R Spruit <neil.r.spruit@intel.com>
2022-08-05 00:11:05 +02:00
Aravind Gopalakrishnan
110adb50a9 Modify ZEX_HOST_MEM_ALLOC_FLAG_USE_HOST_PTR for shared allocs
If flag present, re-route to creating host allocs and honor the user pointer

Related-To: NEO-7004

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
2022-07-29 07:45:16 +02:00
Lukasz Jobczyk
8eae6c2ba3 Add ZEX_HOST_MEM_ALLOC_FLAG_USE_HOST_PTR flag
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2022-07-14 13:28:48 +02:00
Jaime Arteaga
235e167565 Correctly return number of IPC handles in zexMemGetIpcHandles
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-07-11 11:12:54 +02:00
Mateusz Hoppe
5956aea18d Limit header includes from level_zero device.h
- remove including debugger_l0.h from device.h
- add getL0Debugger() to shared NEO Device

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-07-06 16:41:17 +02:00
Jaime Arteaga
260838430f Add support for zeVirtualMemQueryPageSize
Related-To: LOCI-1543

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-06-13 17:00:33 +02:00
Mateusz Jablonski
747c2d3d83 Cleanup includes in cmdlist, cmdqueue, context, device, driver and module
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-06-03 02:54:41 +02:00
Jaime Arteaga
8c6a3639d9 Remove non-needed branch from freeMem
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-06-02 20:06:56 +02:00
Mateusz Jablonski
2a4c68dc38 Remove not needed dependencies from device_imp.h
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-06-02 18:35:34 +02:00
Jaime Arteaga
1670081df7 Clean up context vector of devices
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-06-02 07:00:14 +02:00
Artur Harasimiuk
e9be9b64c6 clang-tidy configuration cleanup
Define single .clang-tidy configuration with all used checks and use
NOLINT to selectively silence tool. That way cleanup should be easier.
third_part/ has its own configuration that disables clang-tidy for this
folder.

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2022-05-11 14:02:04 +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
Jim Snow
0a926c7d12 Add Windows image memory export functionality
Adds zeImageGetAllocPropertiesExt function, implementation code shared
shared with zeMemGetAllocProperties moved into common helper function.

Related-To: LOCI-2665

Signed-off-by: Jim Snow <jim.m.snow@intel.com>
2022-03-26 05:11:35 +01:00
Krzysztof Gibala
f7a5d29085 Introduce debug flag ForceExtendedUSMBufferSize usage for L0
Forces extended buffer size by adding pageSize specify by number when
debug flag is >=1 in L0 USM calls

Usage:
ForceExtendedUSMBufferSize=2
size += (2 * pageSize)

Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
2022-02-08 16:23:40 +01:00
Spruit, Neil R
8986435bd7 Convert FD to NT Handle for Import/Export of Memory
- In WSL the handle for DMA buf is an NT handle.
- To share and import this memory we check if the
handle is an NT handle before attempting to
load as an FD.
- If the handle is and NT handle, then we open the fd
as an NT handle.

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2022-02-04 21:01:26 +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
593756bee0 Fail given WDDM Driver and Fd Handle in WSL
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2022-02-02 19:01:35 +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
Jaime Arteaga
e3ac89adbe Remove non-needed DEBUG_BREAK_IF
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-01-25 23:39:40 +01:00
Jaime Arteaga
dbf0f90186 Return pageSize in getMemAllocProperties
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-01-25 18:26:13 +01:00
Jaime Arteaga
f182259a97 Return user size on zeMemGetAddressRange
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-01-11 23:12:23 +01:00
Jaime Arteaga
3b497270c8 Add support for memory free policies
Add support for ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_BLOCKING_FREE
added in v1.3.

Related-To: LOCI-2672

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2021-12-28 08:27:50 +01:00
Bartosz Dunajski
e040c8c6bb Initial compression support for L0 Device allocations
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2021-12-16 15:55:13 +01:00
Filip Hazubski
cf4ce308d9 Rename function
Rename multiDeviceCapable to implicitScalingCapable
Rename isMultiDeviceCapable to isImplicitScalingCapable

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2021-12-09 11:14:08 +01:00
Zbigniew Zdanowicz
357f650b8b Unify code for check is implicit scaling enabled
Related-To: NEO-6262

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2021-11-24 12:41:00 +01:00
Mateusz Jablonski
babdbfb0cf Rename L0 Device method
remove gmock from mock device
add macros to define mock methods with ref return

Related-To: NEO-4914
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-11-16 22:01:14 +01:00
Zbigniew Zdanowicz
df6829f361 Use event pool init code for result of event pool api creation function
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2021-11-09 16:29:49 +01:00
Lukasz Jobczyk
99972e2a98 Add ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED implementation
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2021-10-25 14:39:20 +02:00
Kamil Diedrich
465bec3d76 Add NTHandle sharing
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
2021-10-19 14:17:25 +02:00
Jaime Arteaga
e0a093b87a Make IPC events available for P2P operations
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2021-10-13 17:20:35 +02:00
John Falkowski
92c2c07bff Correct device handle for device/shared alloc
Signed-off-by: John Falkowski <john.falkowski@intel.com>
2021-09-17 23:25:19 +02:00