CLINFO(1) | General Commands Manual | CLINFO(1) |
clinfo - show OpenCL platforms and devices
clinfo [options ...]
clinfo prints all available information about all OpenCL platforms available on the system and the devices they expose.
clinfo accepts the following options:
OpenCL 1.1, OpenCL 1.2, OpenCL 2.0, OpenCL 2.1, OpenCL 2.2, OpenCL 3.0.
Supported OpenCL extensions:
Some information is duplicated when available from multiple sources. Examples:
Some floating-point configuration flags may only be meaningful for specific precisions and/or specific OpenCL versions. For example, CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT is only relevant for single precision in OpenCL 1.2 devices.
The implementation-defined behavior for NULL platform or context properties is tested for the following API calls:
Support for OpenCL 2.x properties is not fully tested.
Support for cl_khr_subgroup_named_barrier is experimental due to missing definitions in the official OpenCL headers.
Raw (machine-parsable) output is considered experimental, the output format might still undergo changes.
The properties of the ICD loader will also be queried if the clGetICDLoaderInfoOCLICD extension function is found.
Support for the properties exposed by cl_amd_copy_buffer_p2p is experimental.
Support for some (documented and undocumented) properties exposed by cl_amd_device_attribute_query is experimental (see also LIMITATIONS).
Support for the interop lists exposed by cl_intel_simultaneous_sharing is experimental.
The highest OpenCL version supported by the ICD loader is detected with some trivial heuristics (symbols found); a notice is output if this is lower than the highest platform OpenCL version, or if the detected version doesn't match the one declared by the ICD loader itself.
OpenCL provides no explicit mean to detect the supported version of any extension exposed by a device, which makes it impossible to determine a priori if it will be possible to successfully query a device about a specific property. Additionally, the actual size and meaning of some properties are not officially declared anywhere.
Most notably, this affects extensions such as cl_amd_device_attribute_query, cl_nv_device_attribute_query and cl_arm_core_id. Heuristics based on standard version support are partially used in the code to determine which version may be supported.
Properties which are known to be affected by these limitations include:
Please report any issues on the project tracker on GitHub.
If multiple OpenCL platforms using shared LLVM libraries are present in the system, clinfo (and other OpenCL application) may crash with errors to the tune of
: CommandLine Error: Option '(some option name)' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options
or similar. This is not an issue in clinfo, or in any OpenCL platform or application, but it is due to the way LLVM handles its own command-line options parsing. The issue has been reported upstream as issue #30587. See the next point for possible workarounds and assistance in identifying the conflicting platforms.
Faulty OpenCL platforms may cause segmentation faults in clinfo during the information gathering phase, sometimes even before any output is shown. There is very little clinfo can do to avoid this. If you see this happening, try disabling all platforms and then re-enabling them one by one until you experience the crash again. Chances are the last platform you enabled is defective in some way (either by being incompatible with other platforms or by missing necessary components and not handling their absence gracefully).
To selectively enable/disable platforms, one way is to move or rename the *.icd files present in /etc/OpenCL/vendors/ and then restoring them one by one. When using the free-software ocl-icd OpenCL library, a similar effect can be achieved by setting the OPENCL_VENDOR_PATH or OCL_ICD_VENDORS environment variables, as documented in libOpenCL(7). Other implementations of libOpenCL are known to support OPENCL_VENDOR_PATH too.
This one liner will run clinfo -l for each platform individually (hiding the normal output), and report the .icd path prefixed by 0 for successful runs, and a non-zero value for faulty platforms.
2021-02-21 | clinfo 3.0.21.02.21 |