Skip to content

Commit 9037fa2

Browse files
committed
task: add more env var documentation
1 parent b4e0dca commit 9037fa2

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

docs/doc_sources/user_guides/environment_variables.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ 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+
- `Level Zero <https://intel.github.io/llvm/EnvironmentVariables.html>`_
11+
- `OneAPI <https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/PROG.html#environment-variables>`_
12+
913

1014
Variable ``ONEAPI_DEVICE_SELECTOR``
1115
-----------------------------------
@@ -50,3 +54,59 @@ The value of the variable is a bit-mask, with the following supported values:
5054
- Enables tracing of PI calls
5155
* - ``-1``
5256
- Enables all levels of tracing
57+
58+
.. _env_var_ze_flat_device_hierarchy:
59+
60+
Variable ``ZE_FLAT_DEVICE_HIERARCHY``
61+
--------------------------
62+
Allows users to define the device hierarchy model exposed by Level Zero driver implementation.
63+
Keep in mind :py:mod:`dpctl.get_composite_devices` will only work while this is set to ``COMBINED``.
64+
65+
.. list-table::
66+
:header-rows: 1
67+
68+
* - Value
69+
- Description
70+
* - ``COMBINED``
71+
- 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.
72+
* - ``COMPOSITE``
73+
- Level Zero devices with multiple tiles will be exposed as a singular root device, with tiles accessible as sub-devices.
74+
* - ``FLAT``
75+
- Level Zero devices with multiple tiles will be exposed as a set of root devices, each corresponding to an individual tile. Enabled by default.
76+
77+
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>`_.
78+
79+
Variable ``ZE_AFFINITY_MASK``
80+
-------------------------------
81+
Allows users to mask specific devices from being used by SYCL applications.
82+
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.
83+
84+
Read more about `affinity masks here <https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/PROG.html#affinity-mask>`_.
85+
86+
Variable ``ZE_ENABLE_PCI_ID_DEVICE_ORDER``
87+
-------------------------------
88+
Forces driver to report devices from lowest to highest PCI bus ID.
89+
90+
.. list-table::
91+
:header-rows: 1
92+
93+
* - Value
94+
- Description
95+
* - ``0``
96+
- Disabled. Default value.
97+
* - ``1``
98+
- Enabled.
99+
100+
Variable ``ZE_SHARED_FORCE_DEVICE_ALLOC``
101+
-------------------------------
102+
Forces all shared allocations into device memory
103+
104+
.. list-table::
105+
:header-rows: 1
106+
107+
* - Value
108+
- Description
109+
* - ``0``
110+
- Disabled. Default value.
111+
* - ``1``
112+
- 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)