Skip to content

Instantly share code, notes, and snippets.

@paoletto
Forked from Brainiarc7/intel-opencl-neo-build.md
Created August 30, 2022 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paoletto/9bad7bc2ecc95d23142364815b1f69d7 to your computer and use it in GitHub Desktop.
Save paoletto/9bad7bc2ecc95d23142364815b1f69d7 to your computer and use it in GitHub Desktop.
Build Intel's Neo OpenCL platform on Ubuntu 18.04LTS

Intel OpenCL stack enablement on Ubuntu 18.04LTS.

Here's how to build and install Intel's new OpenCL enablement stack, Neo, which replaces the legacy Beignet ICD.

Install the dependencies:

Build dependencies:

sudo apt-get install ccache flex bison clang-4.0 cmake g++ git patch zlib1g-dev autoconf xutils-dev libtool pkg-config libpciaccess-dev

Create the project structure:

mkdir -p ~/intel-compute-runtime/workspace

Within this workspace directory, fetch the sources for the required dependencies:

cd ~/intel-compute-runtime/workspace

git clone -b release_40 https://github.com/llvm-mirror/clang clang_source

git clone https://github.com/intel/opencl-clang common_clang

git clone https://github.com/intel/llvm-patches llvm_patches

git clone -b release_40 https://github.com/llvm-mirror/llvm llvm_source

git clone -b release_70 https://github.com/llvm-mirror/llvm llvm7.0.0_source

git clone https://github.com/intel/gmmlib gmmlib

git clone https://github.com/intel/intel-graphics-compiler igc

git clone https://github.com/KhronosGroup/OpenCL-Headers khronos

git clone https://github.com/intel/compute-runtime neo

ln -s khronos opencl_headers

Create a build directory for the Intel Graphics Compiler under the workspace:

mkdir -p ~/intel-compute-runtime/workspace/build_igc

Then build:

cd ~/intel-compute-runtime/workspace/build_igc

cmake -DIGC_OPTION__OUTPUT_DIR=../igc-install/Release ../igc/IGC

time make -j$(nproc) VERBOSE=1

Recommended: Generate Debian archives for installation:

time make -j$(nproc) package VERBOSE=1

Install:

sudo dpkg -i *.deb

(Ran in the build directory) will suffice.

On NVIDIA Optimus systems where CUDA is present and LLVM 4.0 coexist:

Append /usr/local/cuda/bin:/usr/lib/llvm-4.0/bin at the end of the PATH variable in /etc/environment and source the file:

source /etc/environment

Important: Either way, make sure that LLVM 4.0 is in your path, as its' required by Intel's OCL runtime.

Next, build and install the compute runtime project. Start by creating a separate build directory for it:

mkdir -p ~/intel-compute-runtime/workspace/build_icr

cd ~/intel-compute-runtime/workspace/build_icr

cmake -DBUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release ../neo

time make -j$(nproc) package VERBOSE=1

Then install the deb archives:

  sudo dpkg -i *.deb 

From the build directory.

Testing:

Use clinfo and confirm that the ICD is detected.

Next, run luxmark and confirm that Intel Neo's OpenCL platform is detected and usable.

Be aware that Luxmark, among others, require freeglut, which you can install by running:

sudo apt install freeglut3*

Post with benchmarks for the Eurocom Q6: http://forum.notebookreview.com/threads/opencl-benchmarks-on-windows-10-build-1803-vs-ubuntu-linux-18-04lts.818024/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment