You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sycl/doc/EnvironmentVariables.md
+46-46Lines changed: 46 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -11,70 +11,70 @@ subject to change. Do not rely on these variables in production code.
11
11
12
12
| Environment variable | Values | Description |
13
13
| -------------------- | ------ | ----------- |
14
-
| SYCL_PI_TRACE | Described [below](#sycl_pi_trace-options)| Enable specified level of tracing for PI. |
15
-
| SYCL_BE (deprecated) | PI_OPENCL, PI_LEVEL_ZERO, PI_CUDA | Force SYCL RT to consider only devices of the specified backend during the device selection. We are planning to deprecate SYCL_BE environment variable in the future. The specific grace period is not decided yet. Please use the new env var SYCL_DEVICE_FILTER instead. |
16
-
| SYCL_DEVICE_TYPE (deprecated) | CPU, GPU, ACC, HOST | Force SYCL to use the specified device type. If unset, default selection rules are applied. If set to any unlisted value, this control has no effect. If the requested device type is not found, a `cl::sycl::runtime_error` exception is thrown. If a non-default device selector is used, a device must satisfy both the selector and this control to be chosen. This control only has effect on devices created with a selector. We are planning to deprecate SYCL_DEVICE_TYPE environment variable in the future. The specific grace period is not decided yet. Please use the new env var SYCL_DEVICE_FILTER instead. |
17
-
| SYCL_DEVICE_FILTER | backend:device_type:device_num| See Section [SYCL_DEVICE_FILTER](#sycl_device_filter) below. |
18
-
| SYCL_PROGRAM_COMPILE_OPTIONS | String of valid OpenCL compile options | Override compile options for all programs. |
19
-
| SYCL_PROGRAM_LINK_OPTIONS | String of valid OpenCL link options | Override link options for all programs. |
20
-
| SYCL_USE_KERNEL_SPV | Path to the SPIR-V binary | Load device image from the specified file. If runtime is unable to read the file, `cl::sycl::runtime_error` exception is thrown.|
21
-
| SYCL_DUMP_IMAGES | Any(\*) | Dump device image binaries to file. Control has no effect if SYCL_USE_KERNEL_SPV is set. |
22
-
| SYCL_PRINT_EXECUTION_GRAPH | Described [below](#sycl_print_execution_graph-options)| Print execution graph to DOT text file. |
23
-
| SYCL_DISABLE_EXECUTION_GRAPH_CLEANUP | Any(\*) | Disable cleanup of finished command nodes at host-device synchronization points. |
24
-
| SYCL_THROW_ON_BLOCK | Any(\*) | Throw an exception on attempt to wait for a blocked command. |
25
-
| SYCL_DEVICELIB_INHIBIT_NATIVE | String of device library extensions (separated by a whitespace) | Do not rely on device native support for devicelib extensions listed in this option. |
26
-
| SYCL_DEVICE_ALLOWLIST | A list of devices and their driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. Special characters, such as parenthesis, must be escaped. More than one device can be specified using the piping symbol "\|".|
27
-
| SYCL_QUEUE_THREAD_POOL_SIZE | Positive integer | Number of threads in thread pool of queue. |
28
-
| SYCL_DEVICELIB_NO_FALLBACK | Any(\*) | Disable loading and linking of device library images |
29
-
| SYCL_PI_LEVEL_ZERO_MAX_COMMAND_LIST_CACHE | Positive integer | Maximum number of oneAPI Level Zero Command lists that can be allocated with no reuse before throwing an "out of resources" error. Default is 20000, threshold may be increased based on resource availabilty and workload demand. |
30
-
| SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR | Any(\*) | Disable USM allocator in Level Zero plugin (each memory request will go directly to Level Zero runtime) |
31
-
| SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR | MaxPoolableSize,Capacity,MaxPoolSize | Values specified as positive integers. Defaults are 1, 4, 256. MaxPoolableSize is the maximum allocation size in MB that may be pooled. Capacity is the number of allocations in each size range that are freed by the program but retained in the pool for reallocation. Size ranges follow this pattern: 32, 48, 64, 96, 128, 192, and so on, i.e., powers of 2, with one range in between. MaxPoolSize is the maximum size of the pool in MB. |
32
-
| SYCL_PI_LEVEL_ZERO_BATCH_SIZE | Integer | Sets a preferred number of 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. |
33
-
| SYCL_PI_LEVEL_ZERO_FILTER_EVENT_WAIT_LIST | Integer | When set to 0, disables filtering of signaled events from wait lists when using the Level Zero backend. The default is 1. |
34
-
| SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE | Integer | Allows the use of copy engine, if available in the device, in Level Zero plugin to transfer SYCL buffer or image data between the host and/or device(s) and to fill SYCL buffer or image data in device or shared memory. The default is 1. |
35
-
| SYCL_PI_LEVEL_ZERO_TRACK_INDIRECT_ACCESS_MEMORY | Any(\*) | Enable support of the kernels with indirect access and corresponding deferred release of memory allocations in the Level Zero plugin. |
36
-
| SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE | Any(\*) | Enables tracing of parallel_for invocations with rounded-up ranges. |
| SYCL_ENABLE_PCI | Integer | When set to 1, enables obtaining the GPU PCI address when using the Level Zero backend. The default is 0. |
39
-
| SYCL_HOST_UNIFIED_MEMORY | Integer | Enforce host unified memory support or lack of it for the execution graph builder. If set to 0, it is enforced as not supported by all devices. If set to 1, it is enforced as supported by all devices. |
40
-
| SYCL_CACHE_DIR | Path | Path to persistent cache root directory. Default values are `%AppData%\libsycl_cache` for Windows and `$XDG_CACHE_HOME/libsycl_cache` on Linux, if XDG_CACHE_HOME is not set then `$HOME/.cache/libsycl_cache`. |
41
-
| SYCL_CACHE_TRACE | Any(\*) | If the variable is set, messages are sent to std::cerr when non-blocking failures happen (e.g. unable to access cache item file). |
42
-
| SYCL_CACHE_DISABLE_PERSISTENT | Any(\*) | Switches persistent cache switch off when the variable is set. |
43
-
| SYCL_CACHE_EVICTION_DISABLE | Any(\*) | Switches cache eviction off when the variable is set. |
44
-
| SYCL_CACHE_MAX_SIZE | Positive integer | Cache eviction is triggered once total size of cached images exceeds the value in megabytes (default - 8 192 for 8 GB). Set to 0 to disable size-based cache eviction. |
45
-
| SYCL_CACHE_THRESHOLD | Positive integer | Cache eviction threshold in days (default value is 7 for 1 week). Set to 0 for disabling time-based cache eviction. |
46
-
| SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE | Positive integer | Minimum size of device code image in bytes which is reasonable to cache on disk because disk access operation may take more time than do JIT compilation for it. Default value is 0 to cache all images. |
47
-
| SYCL_CACHE_MAX_DEVICE_IMAGE_SIZE | Positive integer | Maximum size of device image in bytes which is cached. Too big kernels may overload disk too fast. Default value is 1 GB. |
14
+
|`SYCL_PI_TRACE`| Described [below](#sycl_pi_trace-options)| Enable specified level of tracing for PI. |
15
+
|`SYCL_BE` (deprecated) |`PI_OPENCL`, `PI_LEVEL_ZERO`, `PI_CUDA`| Force SYCL RT to consider only devices of the specified backend during the device selection. We are planning to deprecate `SYCL_BE` environment variable in the future. The specific grace period is not decided yet. Please use the new env var `SYCL_DEVICE_FILTER` instead. |
16
+
|`SYCL_DEVICE_TYPE` (deprecated) | CPU, GPU, ACC, HOST | Force SYCL to use the specified device type. If unset, default selection rules are applied. If set to any unlisted value, this control has no effect. If the requested device type is not found, a `cl::sycl::runtime_error` exception is thrown. If a non-default device selector is used, a device must satisfy both the selector and this control to be chosen. This control only has effect on devices created with a selector. We are planning to deprecate `SYCL_DEVICE_TYPE` environment variable in the future. The specific grace period is not decided yet. Please use the new env var `SYCL_DEVICE_FILTER` instead. |
17
+
|`SYCL_DEVICE_FILTER`|`backend:device_type:device_num`| See Section [`SYCL_DEVICE_FILTER`](#sycl_device_filter) below. |
18
+
|`SYCL_PROGRAM_COMPILE_OPTIONS`| String of valid OpenCL compile options | Override compile options for all programs. |
19
+
|`SYCL_PROGRAM_LINK_OPTIONS`| String of valid OpenCL link options | Override link options for all programs. |
20
+
|`SYCL_USE_KERNEL_SPV`| Path to the SPIR-V binary | Load device image from the specified file. If runtime is unable to read the file, `cl::sycl::runtime_error` exception is thrown.|
21
+
|`SYCL_DUMP_IMAGES`| Any(\*) | Dump device image binaries to file. Control has no effect if `SYCL_USE_KERNEL_SPV` is set. |
22
+
|`SYCL_PRINT_EXECUTION_GRAPH`| Described [below](#sycl_print_execution_graph-options)| Print execution graph to DOT text file. |
23
+
|`SYCL_DISABLE_EXECUTION_GRAPH_CLEANUP`| Any(\*) | Disable cleanup of finished command nodes at host-device synchronization points. |
24
+
|`SYCL_THROW_ON_BLOCK`| Any(\*) | Throw an exception on attempt to wait for a blocked command. |
25
+
|`SYCL_DEVICELIB_INHIBIT_NATIVE`| String of device library extensions (separated by a whitespace) | Do not rely on device native support for devicelib extensions listed in this option. |
26
+
|`SYCL_DEVICE_ALLOWLIST`| A list of devices and their driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. Special characters, such as parenthesis, must be escaped. More than one device can be specified using the piping symbol "\|".|
27
+
|`SYCL_QUEUE_THREAD_POOL_SIZE`| Positive integer | Number of threads in thread pool of queue. |
28
+
|`SYCL_DEVICELIB_NO_FALLBACK`| Any(\*) | Disable loading and linking of device library images |
29
+
|`SYCL_PI_LEVEL_ZERO_MAX_COMMAND_LIST_CACHE`| Positive integer | Maximum number of oneAPI Level Zero Command lists that can be allocated with no reuse before throwing an "out of resources" error. Default is 20000, threshold may be increased based on resource availabilty and workload demand. |
30
+
|`SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR`| Any(\*) | Disable USM allocator in Level Zero plugin (each memory request will go directly to Level Zero runtime) |
31
+
|`SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR`| MaxPoolableSize,Capacity,MaxPoolSize | Values specified as positive integers. Defaults are 1, 4, 256. MaxPoolableSize is the maximum allocation size in MB that may be pooled. Capacity is the number of allocations in each size range that are freed by the program but retained in the pool for reallocation. Size ranges follow this pattern: 32, 48, 64, 96, 128, 192, and so on, i.e., powers of 2, with one range in between. MaxPoolSize is the maximum size of the pool in MB. |
32
+
|`SYCL_PI_LEVEL_ZERO_BATCH_SIZE`| Integer | Sets a preferred number of 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. |
33
+
|`SYCL_PI_LEVEL_ZERO_FILTER_EVENT_WAIT_LIST`| Integer | When set to 0, disables filtering of signaled events from wait lists when using the Level Zero backend. The default is 1. |
34
+
|`SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE`| Integer | Allows the use of copy engine, if available in the device, in Level Zero plugin to transfer SYCL buffer or image data between the host and/or device(s) and to fill SYCL buffer or image data in device or shared memory. The default is 1. |
35
+
|`SYCL_PI_LEVEL_ZERO_TRACK_INDIRECT_ACCESS_MEMORY`| Any(\*) | Enable support of the kernels with indirect access and corresponding deferred release of memory allocations in the Level Zero plugin. |
36
+
|`SYCL_PARALLEL_FOR_RANGE_ROUNDING_TRACE`| Any(\*) | Enables tracing of `parallel_for` invocations with rounded-up ranges. |
|`SYCL_ENABLE_PCI`| Integer | When set to 1, enables obtaining the GPU PCI address when using the Level Zero backend. The default is 0. |
39
+
|`SYCL_HOST_UNIFIED_MEMORY`| Integer | Enforce host unified memory support or lack of it for the execution graph builder. If set to 0, it is enforced as not supported by all devices. If set to 1, it is enforced as supported by all devices. |
40
+
|`SYCL_CACHE_DIR`| Path | Path to persistent cache root directory. Default values are `%AppData%\libsycl_cache` for Windows and `$XDG_CACHE_HOME/libsycl_cache` on Linux, if `XDG_CACHE_HOME` is not set then `$HOME/.cache/libsycl_cache`. |
41
+
|`SYCL_CACHE_TRACE`| Any(\*) | If the variable is set, messages are sent to std::cerr when non-blocking failures happen (e.g. unable to access cache item file). |
42
+
|`SYCL_CACHE_DISABLE_PERSISTENT`| Any(\*) | Switches persistent cache switch off when the variable is set. |
43
+
|`SYCL_CACHE_EVICTION_DISABLE`| Any(\*) | Switches cache eviction off when the variable is set. |
44
+
|`SYCL_CACHE_MAX_SIZE`| Positive integer | Cache eviction is triggered once total size of cached images exceeds the value in megabytes (default - 8 192 for 8 GB). Set to 0 to disable size-based cache eviction. |
45
+
|`SYCL_CACHE_THRESHOLD`| Positive integer | Cache eviction threshold in days (default value is 7 for 1 week). Set to 0 for disabling time-based cache eviction. |
46
+
|`SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE`| Positive integer | Minimum size of device code image in bytes which is reasonable to cache on disk because disk access operation may take more time than do JIT compilation for it. Default value is 0 to cache all images. |
47
+
|`SYCL_CACHE_MAX_DEVICE_IMAGE_SIZE`| Positive integer | Maximum size of device image in bytes which is cached. Too big kernels may overload disk too fast. Default value is 1 GB. |
48
48
49
49
`(*) Note: Any means this environment variable is effective when set to any non-null value.`
50
50
51
-
### SYCL_DEVICE_FILTER
51
+
### `SYCL_DEVICE_FILTER`
52
52
53
-
This environment variable limits the SYCL RT to use only a subset of the system's devices. Setting this environment variable affects all of the device query functions (platform::get_devices() and platform::get_platforms()) and all of the device selectors.
53
+
This environment variable limits the SYCL RT to use only a subset of the system's devices. Setting this environment variable affects all of the device query functions (`platform::get_devices()` and `platform::get_platforms()`) and all of the device selectors.
54
54
55
-
The value of this environment variable is a comma separated list of filters, where each filter is a triple of the form "backend:device_type:device_num" (without the quotes). Each element of the triple is optional, but each filter must have at least one value. Possible values of "backend" are:
55
+
The value of this environment variable is a comma separated list of filters, where each filter is a triple of the form "`backend:device_type:device_num`" (without the quotes). Each element of the triple is optional, but each filter must have at least one value. Possible values of "backend" are:
56
56
- host
57
-
- level_zero
57
+
-`level_zero`
58
58
- opencl
59
59
- cuda
60
60
-\*
61
61
62
-
Possible values of "device_type" are:
62
+
Possible values of "`device_type`" are:
63
63
- host
64
64
- cpu
65
65
- gpu
66
66
- acc
67
67
-\*
68
68
69
-
Device_num is an integer that indexes the enumeration of devices from the sycl-ls utility tool, where the first device in that enumeration has index zero in each backend. For example, SYCL_DEVICE_FILTER=2 will return all devices with index '2' from all different backends. If multiple devices satisfy this device number (e.g., GPU and CPU devices can be assigned device number '2'), then default_selector will choose the device with the highest heuristic point.
69
+
`Device_num` is an integer that indexes the enumeration of devices from the sycl-ls utility tool, where the first device in that enumeration has index zero in each backend. For example, `SYCL_DEVICE_FILTER`=2 will return all devices with index '2' from all different backends. If multiple devices satisfy this device number (e.g., GPU and CPU devices can be assigned device number '2'), then default_selector will choose the device with the highest heuristic point.
70
70
71
-
Assuming a filter has all three elements of the triple, it selects only those devices that come from the given backend, have the specified device type, AND have the given device index. If more than one filter is specified, the RT is restricted to the union of devices selected by all filters. The RT does not include the "host" backend and the host device automatically unless one of the filters explicitly specifies the "host" device type. Therefore, SYCL_DEVICE_FILTER=host should be set to enforce SYCL to use the host device only.
71
+
Assuming a filter has all three elements of the triple, it selects only those devices that come from the given backend, have the specified device type, AND have the given device index. If more than one filter is specified, the RT is restricted to the union of devices selected by all filters. The RT does not include the "host" backend and the host device automatically unless one of the filters explicitly specifies the "host" device type. Therefore, `SYCL_DEVICE_FILTER`=host should be set to enforce SYCL to use the host device only.
72
72
73
-
Note that all device selectors will throw an exception if the filtered list of devices does not include a device that satisfies the selector. For instance, SYCL_DEVICE_FILTER=cpu,level_zero will cause host_selector() to throw an exception. SYCL_DEVICE_FILTER also limits loading only specified plugins into the SYCL RT. In particular, SYCL_DEVICE_FILTER=level_zero will cause the cpu_selector to throw an exception since SYCL RT will only load the level_zero backend which does not support any CPU devices at this time. When multiple devices satisfy the filter (e..g, SYCL_DEVICE_FILTER=gpu), only one of them will be selected.
73
+
Note that all device selectors will throw an exception if the filtered list of devices does not include a device that satisfies the selector. For instance, `SYCL_DEVICE_FILTER`=cpu,level_zero will cause host_selector() to throw an exception. `SYCL_DEVICE_FILTER` also limits loading only specified plugins into the SYCL RT. In particular, `SYCL_DEVICE_FILTER`=level_zero will cause the cpu_selector to throw an exception since SYCL RT will only load the level_zero backend which does not support any CPU devices at this time. When multiple devices satisfy the filter (e..g, `SYCL_DEVICE_FILTER`=gpu), only one of them will be selected.
74
74
75
-
### SYCL_PRINT_EXECUTION_GRAPH Options
75
+
### `SYCL_PRINT_EXECUTION_GRAPH` Options
76
76
77
-
SYCL_PRINT_EXECUTION_GRAPH can accept one or more comma separated values from the table below
77
+
`SYCL_PRINT_EXECUTION_GRAPH` can accept one or more comma separated values from the table below
78
78
79
79
| Option | Description |
80
80
| ------ | ----------- |
@@ -86,9 +86,9 @@ SYCL_PRINT_EXECUTION_GRAPH can accept one or more comma separated values from th
86
86
| after_addHostAcc | print graph after addHostAccessor method |
87
87
| always | print graph before and after each of the above methods |
88
88
89
-
### SYCL_PI_TRACE Options
89
+
### `SYCL_PI_TRACE` Options
90
90
91
-
SYCL_PI_TRACE accepts a bit-mask. Supported tracing levels are in the table below
91
+
`SYCL_PI_TRACE` accepts a bit-mask. Supported tracing levels are in the table below
0 commit comments