Giter VIP home page Giter VIP logo

clinfo's Introduction

What is this?

clinfo is a simple command-line application that enumerates all possible (known) properties of the OpenCL platform and devices available on the system.

Inspired by AMD's program of the same name, it is coded in pure C and it tries to output all possible information, including those provided by platform-specific extensions, trying not to crash on unsupported properties (e.g. 1.2 properties on 1.1 platforms).

Usage

clinfo [options...]

Common used options are -l to show a synthetic summary of the available devices (without properties), and -a, to try and show properties even if clinfo would otherwise think they aren't supported by the platform or device.

Refer to the man page for further information.

Use cases

  • verify that your OpenCL environment is set up correctly; if clinfo cannot find any platform or devices (or fails to load the OpenCL dispatcher library), chances are high no other OpenCL application will run;
  • verify that your OpenCL development environment is set up correctly: if clinfo fails to build, chances are high no other OpenCL application will build;
  • explore/report the actual properties of the available device(s).

Segmentation faults

Some faulty OpenCL platforms may cause clinfo to crash. There isn't much clinfo itself can do about it, but you can try and isolate the platform responsible for this. On POSIX systems, you can generally find the platform responsible for the fault with the following one-liner:

find /etc/OpenCL/vendors/ -name '*.icd' | while read OPENCL_VENDOR_PATH ; do clinfo -l > /dev/null ; echo "$? ${OPENCL_VENDOR_PATH}" ; done

Building

Build status on Travis

Building requires an OpenCL SDK (or at least OpenCL headers and development files), and the standard build environment for the platform. No special build system is used (autotools, CMake, meson, ninja, etc), as I feel adding more dependencies for such a simple program would be excessive. Simply running make at the project root should work.

Windows support

The application can usually be built in Windows too (support for which required way more time than I should have spent, really, but I digress), by running make in a Developer Command Prompt for Visual Studio, provided an OpenCL SDK (such as the Intel or AMD one) is installed.

Precompiled Windows executable are available as artefacts of the AppVeyor CI.

Build statusWindows binaries
Build status on AppVeyor 32-bit 64-bit

CMake support

Cmake support is added for an alternative way to build on all platforms (Windows, Linux, Android).

On Windows/Linux, use vcpkg install OpenCL to install the OpenCL SDK. vcpkg can be installed here. Note: On 64-bit Windows, you may use vcpkg install OpenCL:x64-windows instead. To build on Windows/Linux, type these commands:

git clone https://github.com/HO-COOH/clinfo
cd clinfo
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE="<path_to_vcpkg>/scripts/buildsystems/vcpkg.cmake"
cmake --build .

On Android, the OpenCL header files is automatically download from KhronosGroup's repo and the OpenCL runtime library is automatically found and linked. Install a terminal emulator app like termux, and install cmake, git, clang by pkg install cmake git clang. And type these commands to build:

git clone https://github.com/HO-COOH/clinfo
cd clinfo
mkdir build
cd build
cmake ..
cmake --build .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.