Skip to content

Commit 5084a64

Browse files
committed
task: add more env var documentation
1 parent b4e0dca commit 5084a64

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

docs/doc_sources/user_guides/environment_variables.rst

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Environment variables
66

77
Behavior of :py:mod:`dpctl` is affected by :dpcpp_envar:`environment variables <>` that
88
affect DPC++ compiler runtime.
9+
Other relevant environment variables that may not be documented here can be found in:
10+
11+
- `Level Zero <https://intel.github.io/llvm/EnvironmentVariables.html>`_
12+
13+
- `OneAPI <https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/PROG.html#environment-variables>`_
14+
915

1016
Variable ``ONEAPI_DEVICE_SELECTOR``
1117
-----------------------------------
@@ -50,3 +56,59 @@ The value of the variable is a bit-mask, with the following supported values:
5056
- Enables tracing of PI calls
5157
* - ``-1``
5258
- Enables all levels of tracing
59+
60+
.. _env_var_ze_flat_device_hierarchy:
61+
62+
Variable ``ZE_FLAT_DEVICE_HIERARCHY``
63+
--------------------------
64+
Allows users to define the device hierarchy model exposed by Level Zero driver implementation.
65+
Keep in mind :py:mod:`dpctl.get_composite_devices` will only work while this is set to ``COMBINED``.
66+
67+
.. list-table::
68+
:header-rows: 1
69+
70+
* - Value
71+
- Description
72+
* - ``COMBINED``
73+
- Level Zero devices with multiple tiles will be exposed as a set of root devices, each corresponding to an individual tile. These root devices are component devices, which can be queried for their corresponding composite device, and the composite device can in turn be queried for components. Dedicated composite device APIs will return non-trivial results.
74+
* - ``COMPOSITE``
75+
- Level Zero devices with multiple tiles will be exposed as a singular root device, with tiles accessible as sub-devices.
76+
* - ``FLAT``
77+
- Level Zero devices with multiple tiles will be exposed as a set of root devices, each corresponding to an individual tile. Enabled by default.
78+
79+
Read more `about device hierarchy here <https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/PROG.html#device-hierarchy>`_ and `here <https://www.intel.com/content/www/us/en/developer/articles/technical/flattening-gpu-tile-hierarchy.html>`_.
80+
81+
Variable ``ZE_AFFINITY_MASK``
82+
-------------------------------
83+
Allows users to mask specific devices from being used by SYCL applications.
84+
If we have ZE_FLAT_DEVICE_HIERARCHY set to COMPOSITE, we can have an AFFINITY of “1” for our application to only see device #1 - making system devices 0, and 2+, invisible. Etc.
85+
86+
Read more about `affinity masks here <https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/PROG.html#affinity-mask>`_.
87+
88+
Variable ``ZE_ENABLE_PCI_ID_DEVICE_ORDER``
89+
-------------------------------
90+
Forces driver to report devices from lowest to highest PCI bus ID.
91+
92+
.. list-table::
93+
:header-rows: 1
94+
95+
* - Value
96+
- Description
97+
* - ``0``
98+
- Disabled. Default value.
99+
* - ``1``
100+
- Enabled.
101+
102+
Variable ``ZE_SHARED_FORCE_DEVICE_ALLOC``
103+
-------------------------------
104+
Forces all shared allocations into device memory
105+
106+
.. list-table::
107+
:header-rows: 1
108+
109+
* - Value
110+
- Description
111+
* - ``0``
112+
- Disabled. Default value.
113+
* - ``1``
114+
- Enabled.

dpctl/_sycl_device_factory.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ cpdef list get_composite_devices():
212212
Only available when `ZE_FLAT_DEVICE_HIERARCHY=COMBINED` is set in
213213
the environment, and only for specific Level Zero devices
214214
(i.e., those which expose multiple tiles as root devices).
215+
To read more about `ZE_FLAT_DEVICE_HIERARCHY=COMBINED`,
216+
see :ref:`env_var_ze_flat_device_hierarchy`.
215217
216218
For more information, see:
217219
https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_composite_device.asciidoc

0 commit comments

Comments
 (0)