DPC++ L0 Switch
Level Zero (L0)
Packages to Install
L0 GPU Driver
The PI for
performs device discovery of all available devices through all available PI plugins. The same physical hardware device can be seen as multiple different
devices if multiple plugins support it (for example, OpenCL Gen90 and L0 Gen90). The
runtime performs device selection from the available devices based on device selectors. The device selectors can be user-defined or built in (for example,
Discovery of Multiple PI Plugins
The implication of support for the discovery of multiple plugins is that the same GPU card can be seen as multiple different GPU devices available under different PI plugins.
Corresponding runtimes (OpenCL and/or L0) must be installed correctly and independently for PI to see their devices. The
/SYCL* specification does not define which device will be used if there are multiple devices that match criteria (for example,
Default Preference is Given to an L0 GPU on Linux*
By default, if no special action is taken and the L0 runtime reports support for the installed GPU, then the
runtime uses the installed GPU. This is true for standard built-in device selectors and custom device selectors, where no action is taken to change the default behavior.
Currently, on Windows*, the preference is given to an OpenCL GPU.
Devices that are not supported with the L0 runtime (CPU/FPGA) continue to run with OpenCL.
How to Change the Default Preference
SYCL_BEenvironment variable to change the default preference. The valid values are
For example, if you specify
SYCL_BE=PI_OPENCLand the PI OpenCL plugin reports the availability of the device of the required type, then that device is used. It overrides the default preference that is given to the L0 GPU, if the GPU is supported by the installed version of OpenCL.
SYCL_BEsetting only works when there are multiple choices.
If your code does not work out of the box, try running it with
SYCL_BE=PI_OPENCLto see if the problem is related to L0.
How to See Where the Code is Running
SYCL_PI_TRACE=1environment variable to see where your code is running. It reports the choice made by the built-in device selectors, if they are used.
SYCL_PI_TRACE=-1to enable verbose tracing of the PI. This shows all devices detected by the PI discovery process.
How to Load all SYCL Plugins Discovered in the System
sycl-lsutility to load all the SYCL plugins on your system. This utility also queries all the platforms and devices available through the plugins.
There is a verbose output available with
$ sycl-ls --verbose. This gives you the same choice that would be made by a standard built-in device selector.