Intel® oneAPI Level Zero Switch
Intel® oneAPI Level Zero Introduction
Packages to Install
Level Zero Loader
Level Zero 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 Level Zero 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 Level Zero) 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 a Level Zero GPU on Linux*
By default, if no special action is taken and the Level Zero 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 Level Zero 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 Level Zero 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, try running it with
SYCL_BE=PI_OPENCLto see if the problem is related to Level Zero.
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 and show all the devices detected by the PI discovery process.
How to Find all SYCL Plugins and Supported Devices Discovered in the System
sycl-lsutility to find all the SYCL plugins on your system.
sycl-lsqueries all the platforms and devices available through the plugins, and prints useful information about SYCL devices and their ID numbers. This information is useful when you want to designate a specific device to run a SYCL program. The
SYCL_DEVICE_FILTERstring is printed at each line to show three information pieces:
Verbose output is available with
$ sycl-ls --verbose, which gives you the same choices that are made by standard built-in device selectors and other custom device selectors.