Skip to content

Commit 876f5c0

Browse files
committed
[UR] Add UR_L0_V2_DISABLE_ZE_LAUNCH_KERNEL_WITH_ARGS debugging variable
Add UR_L0_V2_DISABLE_ZE_LAUNCH_KERNEL_WITH_ARGS debugging environment variable to disable calling ZeCommandListAppendLaunchKernelWithArguments(). Signed-off-by: Lukasz Dorau <[email protected]>
1 parent ec5d354 commit 876f5c0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

sycl/doc/EnvironmentVariables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ older hardware or when SYCL_UR_USE_LEVEL_ZERO_V2=0 is set.</span>
272272
| Environment variable | Values | Description | Adapter Support |
273273
| -------------------- | ------ | ----------- | --------------- |
274274
| `UR_L0_V2_FORCE_DISABLE_COPY_OFFLOAD` | Integer | By default, copy operations submitted to any queue can be offloaded to dedicated copy engines. Setting this variable instructs the driver to keep all copy operations on the engine behind the original queue. The default value is 0. | V2 |
275+
| `UR_L0_V2_DISABLE_ZE_LAUNCH_KERNEL_WITH_ARGS` | Integer | By default, ZeCommandListAppendLaunchKernelWithArguments() will be called when available and possible. Setting this variable instructs the driver to not call ZeCommandListAppendLaunchKernelWithArguments() and use the old path using ZeCommandListAppendLaunchKernel(). The default value is 0. | V2 |
275276
| `SYCL_PI_LEVEL_ZERO_SINGLE_THREAD_MODE` | Integer | A single-threaded app has an opportunity to enable this mode to avoid overhead from mutex locking in the Level Zero adapter. A value greater than 0 enables single thread mode. A value of 0 disables single thread mode. The default is 0. | Legacy |
276277
| `SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR` | [EnableBuffers][;[MaxPoolSize][;[host\|device\|shared:][MaxPoolableSize][,[Capacity][,SlabMinSize]]]...] | EnableBuffers enables pooling for SYCL buffers, default 1, set to 0 to disable. MaxPoolSize is the maximum size of the pool, by default there is no size limit. MemType is host, device, shared or read_only_shared. Other parameters are values specified as positive integers with optional K, M or G suffix. MaxPoolableSize is the maximum allocation size that may be pooled, default 0 for shared, 2MB for host, 4MB for device and read_only_shared. Capacity is the number of allocations in each size range freed by the program but retained in the pool for reallocation, default 4. Size ranges follow this pattern: 64, 96, 128, 192, and so on, i.e., powers of 2, with one range in between. SlabMinSize is the minimum allocation size, 64KB for host and device, 2MB for shared and read_only_shared. Example: SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=1;32M;host:1M,4,64K;device:1M,4,64K;shared:0,0,2M| Legacy and V2 |
277278
| `SYCL_PI_LEVEL_ZERO_BATCH_SIZE` | Integer | Sets a preferred number of compute commands to batch into a command list before executing the command list. A value of 0 causes the batch size to be adjusted dynamically. A value greater than 0 specifies fixed size batching, with the batch size set to the specified value. The default is 0. | Legacy |

unified-runtime/source/adapters/level_zero/v2/command_list_manager.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,14 +1250,20 @@ ur_result_t ur_command_list_manager::appendKernelLaunchWithArgsExp(
12501250
cooperativeKernelLaunchRequested = true;
12511251
}
12521252

1253+
int DisableZeLaunchKernelWithArgs = 0;
1254+
if (auto DisableZeLaunchKernelWithArgsVal =
1255+
std::getenv("UR_L0_V2_DISABLE_ZE_LAUNCH_KERNEL_WITH_ARGS")) {
1256+
DisableZeLaunchKernelWithArgs = std::atoi(DisableZeLaunchKernelWithArgsVal);
1257+
}
1258+
12531259
ur_platform_handle_t hPlatform = hContext->getPlatform();
12541260
bool KernelWithArgsSupported =
12551261
hPlatform->ZeCommandListAppendLaunchKernelWithArgumentsExt.Supported;
12561262
bool CooperativeCompatible =
12571263
hPlatform->ZeCommandListAppendLaunchKernelWithArgumentsExt
12581264
.DriverSupportsCooperativeKernelLaunchWithArgs;
12591265
bool RunNewPath =
1260-
KernelWithArgsSupported &&
1266+
!DisableZeLaunchKernelWithArgs && KernelWithArgsSupported &&
12611267
(!cooperativeKernelLaunchRequested ||
12621268
(cooperativeKernelLaunchRequested && CooperativeCompatible));
12631269
if (RunNewPath) {

0 commit comments

Comments
 (0)