|
800 | 800 | <section id="environment-variables"> |
801 | 801 | <span id="user-guides-env-variables"></span><h1>Environment variables<a class="headerlink" href="#environment-variables" title="Permalink to this heading">¶</a></h1> |
802 | 802 | <p>Behavior of <a class="reference internal" href="../api_reference/dpctl/index.html#module-dpctl" title="dpctl"><code class="xref py py-mod docutils literal notranslate"><span class="pre">dpctl</span></code></a> is affected by <a class="reference external" href="https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md">environment variables</a> that |
803 | | -affect DPC++ compiler runtime.</p> |
| 803 | +affect DPC++ compiler runtime. |
| 804 | +Other relevant environment variables that may not be documented here can be found in:</p> |
| 805 | +<ul class="simple"> |
| 806 | +<li><p><a class="reference external" href="https://intel.github.io/llvm/EnvironmentVariables.html">Level Zero</a></p></li> |
| 807 | +<li><p><a class="reference external" href="https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/PROG.html#environment-variables">OneAPI</a></p></li> |
| 808 | +</ul> |
804 | 809 | <section id="variable-oneapi-device-selector"> |
805 | 810 | <h2>Variable <code class="docutils literal notranslate"><span class="pre">ONEAPI_DEVICE_SELECTOR</span></code><a class="headerlink" href="#variable-oneapi-device-selector" title="Permalink to this heading">¶</a></h2> |
806 | 811 | <p>The variable <code class="docutils literal notranslate"><span class="pre">ONEAPI_DEVICE_SELECTOR</span></code> can be used to limit the choice of devices |
@@ -848,6 +853,92 @@ <h2>Variable <code class="docutils literal notranslate"><span class="pre">SYCL_P |
848 | 853 | </table> |
849 | 854 | </div> |
850 | 855 | </section> |
| 856 | +<section id="variable-ze-flat-device-hierarchy"> |
| 857 | +<span id="env-var-ze-flat-device-hierarchy"></span><h2>Variable <code class="docutils literal notranslate"><span class="pre">ZE_FLAT_DEVICE_HIERARCHY</span></code><a class="headerlink" href="#variable-ze-flat-device-hierarchy" title="Permalink to this heading">¶</a></h2> |
| 858 | +<p>Allows users to define the device hierarchy model exposed by Level Zero driver implementation. |
| 859 | +Keep in mind <a class="reference internal" href="../api_reference/dpctl/generated/dpctl.get_composite_devices.html#dpctl.get_composite_devices" title="dpctl.get_composite_devices"><code class="xref py py-mod docutils literal notranslate"><span class="pre">dpctl.get_composite_devices</span></code></a> will only work while this is set to <code class="docutils literal notranslate"><span class="pre">COMBINED</span></code>.</p> |
| 860 | +<div class="table-wrapper docutils container"> |
| 861 | +<table class="docutils align-default"> |
| 862 | +<thead> |
| 863 | +<tr class="row-odd"><th class="head"><p>Value</p></th> |
| 864 | +<th class="head"><p>Description</p></th> |
| 865 | +</tr> |
| 866 | +</thead> |
| 867 | +<tbody> |
| 868 | +<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">COMBINED</span></code></p></td> |
| 869 | +<td><p>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.</p></td> |
| 870 | +</tr> |
| 871 | +<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">COMPOSITE</span></code></p></td> |
| 872 | +<td><p>Level Zero devices with multiple tiles will be exposed as a singular root device, with tiles accessible as sub-devices.</p></td> |
| 873 | +</tr> |
| 874 | +<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">FLAT</span></code></p></td> |
| 875 | +<td><p>Level Zero devices with multiple tiles will be exposed as a set of root devices, each corresponding to an individual tile. Enabled by default.</p></td> |
| 876 | +</tr> |
| 877 | +</tbody> |
| 878 | +</table> |
| 879 | +</div> |
| 880 | +<p>Read more about device hierarchy in <a class="reference external" href="https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/PROG.html#device-hierarchy">Level Zero Specification</a> and <a class="reference external" href="https://www.intel.com/content/www/us/en/developer/articles/technical/flattening-gpu-tile-hierarchy.html">Intel GPU article</a>.</p> |
| 881 | +</section> |
| 882 | +<section id="variable-ze-affinity-mask"> |
| 883 | +<h2>Variable <code class="docutils literal notranslate"><span class="pre">ZE_AFFINITY_MASK</span></code><a class="headerlink" href="#variable-ze-affinity-mask" title="Permalink to this heading">¶</a></h2> |
| 884 | +<p>Allows users to mask specific devices from being used by SYCL applications. |
| 885 | +If we have <code class="docutils literal notranslate"><span class="pre">ZE_FLAT_DEVICE_HIERARCHY</span></code> set to <code class="docutils literal notranslate"><span class="pre">COMPOSITE</span></code>, we can have an AFFINITY of “1” for our application to only see device #1 - making system devices 0, and 2+, invisible.</p> |
| 886 | +<p>If we have <code class="docutils literal notranslate"><span class="pre">ZE_FLAT_DEVICE_HIERARCHY</span></code> set to <code class="docutils literal notranslate"><span class="pre">FLAT</span></code>, we can have a <code class="docutils literal notranslate"><span class="pre">ZE_AFFINITY_MASK</span></code> of “1” for our application to only see the second tile in the system as logical device #0. |
| 887 | +If the system has four dual-tile GPUs installed, this would be the second tile in the first GPU. In <code class="docutils literal notranslate"><span class="pre">FLAT</span></code> mode, the numbers use a system-wide-sub-device-number from a flat numbering perspective. |
| 888 | +Therefore, we could use the second tile in each of four dual-tile GPUs with <code class="docutils literal notranslate"><span class="pre">ZE_AFFINITY_MASK=1,3,5,7</span></code>.</p> |
| 889 | +<div class="line-block"> |
| 890 | +<div class="line">If we have <code class="docutils literal notranslate"><span class="pre">ZE_FLAT_DEVICE_HIERARCHY</span></code> set to <code class="docutils literal notranslate"><span class="pre">COMBINED</span></code>, the way tiles and composite devices are exposed depends on the physical devices present and the value of <code class="docutils literal notranslate"><span class="pre">ZE_AFFINITY_MASK</span></code>:</div> |
| 891 | +<div class="line"><strong>If all exposed tiles (as determined by ``ZE_AFFINITY_MASK``) belong to the same physical device:</strong></div> |
| 892 | +<div class="line">- That composite device is available to the application, and each tile is accessible as a component device of that composite device.</div> |
| 893 | +</div> |
| 894 | +<div class="line-block"> |
| 895 | +<div class="line"><strong>If the exposed tiles belong to different physical devices:</strong></div> |
| 896 | +<div class="line">- A composite device is available for each physical device, and the tiles are accessible as component devices of their respective composite device.</div> |
| 897 | +</div> |
| 898 | +<p>Additional examples to illustrate this are in the detailed documentation for <code class="docutils literal notranslate"><span class="pre">ZE_AFFINITY_MASK</span></code>, read more about it in <a class="reference external" href="https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/PROG.html#affinity-mask">Level Zero Specification</a>.</p> |
| 899 | +</section> |
| 900 | +<section id="variable-ze-enable-pci-id-device-order"> |
| 901 | +<h2>Variable <code class="docutils literal notranslate"><span class="pre">ZE_ENABLE_PCI_ID_DEVICE_ORDER</span></code><a class="headerlink" href="#variable-ze-enable-pci-id-device-order" title="Permalink to this heading">¶</a></h2> |
| 902 | +<p>Forces driver to report devices from lowest to highest PCI bus ID.</p> |
| 903 | +<div class="table-wrapper docutils container"> |
| 904 | +<table class="docutils align-default"> |
| 905 | +<thead> |
| 906 | +<tr class="row-odd"><th class="head"><p>Value</p></th> |
| 907 | +<th class="head"><p>Description</p></th> |
| 908 | +</tr> |
| 909 | +</thead> |
| 910 | +<tbody> |
| 911 | +<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td> |
| 912 | +<td><p>Disabled. Default value.</p></td> |
| 913 | +</tr> |
| 914 | +<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td> |
| 915 | +<td><p>Enabled.</p></td> |
| 916 | +</tr> |
| 917 | +</tbody> |
| 918 | +</table> |
| 919 | +</div> |
| 920 | +</section> |
| 921 | +<section id="variable-ze-shared-force-device-alloc"> |
| 922 | +<h2>Variable <code class="docutils literal notranslate"><span class="pre">ZE_SHARED_FORCE_DEVICE_ALLOC</span></code><a class="headerlink" href="#variable-ze-shared-force-device-alloc" title="Permalink to this heading">¶</a></h2> |
| 923 | +<p>Forces all shared allocations into device memory</p> |
| 924 | +<div class="table-wrapper docutils container"> |
| 925 | +<table class="docutils align-default"> |
| 926 | +<thead> |
| 927 | +<tr class="row-odd"><th class="head"><p>Value</p></th> |
| 928 | +<th class="head"><p>Description</p></th> |
| 929 | +</tr> |
| 930 | +</thead> |
| 931 | +<tbody> |
| 932 | +<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td> |
| 933 | +<td><p>Disabled. Default value.</p></td> |
| 934 | +</tr> |
| 935 | +<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td> |
| 936 | +<td><p>Enabled.</p></td> |
| 937 | +</tr> |
| 938 | +</tbody> |
| 939 | +</table> |
| 940 | +</div> |
| 941 | +</section> |
851 | 942 | </section> |
852 | 943 |
|
853 | 944 | </article> |
@@ -909,6 +1000,10 @@ <h2>Variable <code class="docutils literal notranslate"><span class="pre">SYCL_P |
909 | 1000 | <li><a class="reference internal" href="#variable-oneapi-device-selector">Variable <code class="docutils literal notranslate"><span class="pre">ONEAPI_DEVICE_SELECTOR</span></code></a></li> |
910 | 1001 | <li><a class="reference internal" href="#variable-sycl-cache-persistent">Variable <code class="docutils literal notranslate"><span class="pre">SYCL_CACHE_PERSISTENT</span></code></a></li> |
911 | 1002 | <li><a class="reference internal" href="#variable-sycl-pi-trace">Variable <code class="docutils literal notranslate"><span class="pre">SYCL_PI_TRACE</span></code></a></li> |
| 1003 | +<li><a class="reference internal" href="#variable-ze-flat-device-hierarchy">Variable <code class="docutils literal notranslate"><span class="pre">ZE_FLAT_DEVICE_HIERARCHY</span></code></a></li> |
| 1004 | +<li><a class="reference internal" href="#variable-ze-affinity-mask">Variable <code class="docutils literal notranslate"><span class="pre">ZE_AFFINITY_MASK</span></code></a></li> |
| 1005 | +<li><a class="reference internal" href="#variable-ze-enable-pci-id-device-order">Variable <code class="docutils literal notranslate"><span class="pre">ZE_ENABLE_PCI_ID_DEVICE_ORDER</span></code></a></li> |
| 1006 | +<li><a class="reference internal" href="#variable-ze-shared-force-device-alloc">Variable <code class="docutils literal notranslate"><span class="pre">ZE_SHARED_FORCE_DEVICE_ALLOC</span></code></a></li> |
912 | 1007 | </ul> |
913 | 1008 | </li> |
914 | 1009 | </ul> |
|
0 commit comments