mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Allow the application to force storageInfo.localOnly and get the out-of-memory returned if not possible. This is a windows-only feature supported on discrete platforms. Related-To: NEO-13428 Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
1.2 KiB
1.2 KiB
Local memory allocation mode
At the moment this is supported on Windows only.
In Level Zero, the API function to allocate a device (local) memory is zeMemAllocDevice. For such (device USM) allocations, there are two policies of handling the scenario enough resources being available:
- Local-preferred mode: A region is primarily allocated out of local-memory resources, however system-memory may be used as a fallback.
- Local-only mode: A can only be allocated out of local-memory resources. If the amount of available local-memory is not sufficient the
ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORYerror is returned.
Depending on the hardware, one of these two modes is being used by default or a specific one can be enforced by setting an environment variable NEO_LOCAL_MEMORY_ALLOCATION_MODE to respective value:
NEO_LOCAL_MEMORY_ALLOCATION_MODE=0: HW-default (value of the flag when it is not set)NEO_LOCAL_MEMORY_ALLOCATION_MODE=1: Local-onlyNEO_LOCAL_MEMORY_ALLOCATION_MODE=2: Local-preferred