Update docs

Removed old information from docs and updated script snippets to be
easily copyable for user experience.
This commit is contained in:
Kreczko, Konrad
2025-07-22 10:44:19 +00:00
committed by igcbot
parent dac4abb69a
commit c8ee2afd36

View File

@ -1,6 +1,6 @@
<!---======================= begin_copyright_notice ============================
Copyright (C) 2019-2021 Intel Corporation
Copyright (C) 2019-2025 Intel Corporation
SPDX-License-Identifier: MIT
@ -13,14 +13,14 @@ SPDX-License-Identifier: MIT
Building IGC needs flex, bison, libz and cmake version at least 3.13.4. You can install required packages on Ubuntu using this command:
```shell
$ sudo apt-get install flex bison libz-dev cmake libc6 libstdc++6 python3-pip
$ sudo python3 -m pip install mako
sudo apt-get install flex bison libz-dev cmake libc6 libstdc++6 python3-pip
sudo python3 -m pip install mako
```
Some of the incoming git operations will try to download and apply patches. For this purpose it is necessary to setup git credentials if they are not already in the git configuration:
```shell
$ git config --global user.name "FirstName LastName"
$ git config --global user.email "your@email.com"
git config --global user.name "FirstName LastName"
git config --global user.email "your@email.com"
```
### 2. Install LLVM, LLD, Clang and OpenCL Clang
@ -43,14 +43,14 @@ Also, depending on the Ubuntu release, SPIRV-LLVM-Translator available through a
For **LLVM**, **LLD** and **Clang** packages please visit this [link](https://apt.llvm.org/) to download and install desired version.
For `apt` package manager you can use this command:
```shell
$ sudo apt-get install llvm-15 llvm-15-dev clang-15 liblld-15 liblld-15-dev libllvmspirvlib15 libllvmspirvlib-15-dev
sudo apt-get install llvm-15 llvm-15-dev clang-15 liblld-15 liblld-15-dev libllvmspirvlib15 libllvmspirvlib-15-dev
```
As of now **OpenCL Clang** is still needed to be built and installed manually. Sources are available [here](https://github.com/intel/opencl-clang). You can use out-of-tree build method with LLVM and Clang preinstalled.
**VC Intrinsics** is a lightweight library that is built from sources with IGC and there is no package for it.
Installing LLVM, Clang, and OpenCL Clang components means you no longer have to download their sources alongside IGC, so the workspace tree in the next step may look like this:
```
<workspace>
IGC_WORKSPACE_DIR
|- igc https://github.com/intel/intel-graphics-compiler
|- vc-intrinsics https://github.com/intel/vc-intrinsics
|- SPIRV-Tools https://github.com/KhronosGroup/SPIRV-Tools
@ -66,23 +66,26 @@ Moreover, OpenCL Clang and Vector Compiler share the SPIRV-LLVM Translator libra
#### Build from sources
Download all dependencies and create workspace.
You can use following commands for setup:
Create workspace and ```cd``` into it:
```shell
$ cd <workspace>
$ git clone https://github.com/intel/vc-intrinsics vc-intrinsics
$ git clone -b llvmorg-15.0.7 https://github.com/llvm/llvm-project llvm-project
$ git clone -b ocl-open-150 https://github.com/intel/opencl-clang llvm-project/llvm/projects/opencl-clang
$ git clone -b llvm_release_150 https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/llvm-spirv
$ git clone https://github.com/KhronosGroup/SPIRV-Tools.git SPIRV-Tools
$ git clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Headers
export IGC_WORKSPACE_DIR=/your/desired/path
mkdir -p $IGC_WORKSPACE_DIR && cd $IGC_WORKSPACE_DIR
```
Download all dependencies
```shell
git clone https://github.com/intel/vc-intrinsics vc-intrinsics
git clone -b llvmorg-15.0.7 https://github.com/llvm/llvm-project llvm-project
git clone -b ocl-open-150 https://github.com/intel/opencl-clang llvm-project/llvm/projects/opencl-clang
git clone -b llvm_release_150 https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/llvm-spirv
git clone https://github.com/KhronosGroup/SPIRV-Tools.git SPIRV-Tools
git clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Headers
```
These commands will set up a workspace with LLVM 15. If you wish to use any other version please refer to the [component revision table](#Revision-table)
Correct directory tree looks like this:
```
<workspace>
IGC_WORSPACE_DIR
|- igc https://github.com/intel/intel-graphics-compiler
|- vc-intrinsics https://github.com/intel/vc-intrinsics
|- SPIRV-Tools https://github.com/KhronosGroup/SPIRV-Tools
@ -129,11 +132,16 @@ For more detailed info about every mode see:
1. Download sources:
```shell
$ cd <workspace>
$ git clone https://github.com/intel/intel-graphics-compiler igc
[If using specific release]
$ cd igc && git checkout -b tag igc-<version>
git clone https://github.com/intel/intel-graphics-compiler igc
```
If you want to use a specific IGC release, for example [v2.14.1](https://github.com/intel/intel-graphics-compiler/releases/tag/v2.14.1), do the following:
```shell
cd igc
git fetch --all --tags --prune
git checkout tags/v2.14.1 -b 2.14.1
```
After checkout you can name your new branch however you want, above is only an example.
To get a list of all releases go [here](https://github.com/intel/intel-graphics-compiler/releases).
2. Prepare workspace and build
@ -143,24 +151,24 @@ If you are using [Build from sources](#build-from-sources) method IGC will autom
You can use following commands to build IGC:
```shell
$ cd <workspace>
$ mkdir build
$ cd build
$ cmake ../igc
$ make -j`nproc`
cd $IGC_WORKSPACE_DIR
mkdir build && cd build
cmake ../igc
make -j`nproc`
```
3. Install IGC:
```shell
$ sudo make install
sudo make install
```
#### Additional notes on OpenCL LIT tests run
If you have installed [intel-opencl-icd](https://github.com/intel/compute-runtime), you can pass the following CMake flags to run the integrated OpenCL LIT test-suite when building IGC, or separately afterwards:
```shell
$ cmake -DIGC_OPTION__ENABLE_OCLOC_LIT_TESTS=ON -DSPIRV_SKIP_EXECUTABLES=OFF ../igc
$ make check-ocloc -j`nproc`
cd $IGC_WORKSPACE_DIR
cmake -DIGC_OPTION__ENABLE_OCLOC_LIT_TESTS=ON -DSPIRV_SKIP_EXECUTABLES=OFF ../igc
make check-ocloc -j`nproc`
```
Also note that these tests require **Debug** IGC build.
@ -173,9 +181,9 @@ Also note that these tests require **Debug** IGC build.
| Version | Product quality |
|:----------------:|-----------------|
| LLVM 16 | Experimental |
| LLVM 15 | **Production** |
| LLVM 14 and older| Experimental |
| LLVM 16/Clang 16 | Experimental |
| LLVM 15/Clang 15 | **Production** |
| LLVM 14/Clang 14 and older| Experimental |
| Terminology | Description |
|-------------------|-|
@ -195,49 +203,3 @@ When checking out the components refer to the following table, replace **XX** wi
| SPIRV-Headers | no | master | master |
| SPIRV-LLVM-Translator | yes | llvm_release_**XX**0 | llvm_release_150 |
| opencl-clang | yes | ocl-open-**XX**0 | ocl-open-150 |
### LLVM/LLD/Clang version specific caveats
Some LLVM versions require special steps to build successfully.
#### LLVM7/Clang7
In the **OpenCL Clang** project there are patches for Clang.
If the Clang you are using to build IGC does not have these patches (for example, when you are using prebuilt packages) it is necessary to add ```-DVME_TYPES_DEFINED=FALSE``` to IGC CMake flags.
VectorComplier must be disabled by adding ```-DIGC_BUILD__VC_ENABLED=OFF``` to CMake flags.
#### LLVM8/Clang8
We recommend building LLVM8/Clang8 from sources instead for using prebuilds, because packaged Clang8 is missing these patches:
* [0001-OpenCL-Change-type-of-block-pointer-for-OpenCL.patch](https://github.com/intel/opencl-clang/blob/ocl-open-80/patches/clang/0001-OpenCL-Change-type-of-block-pointer-for-OpenCL.patch)
* [0002-OpenCL-Simplify-LLVM-IR-generated-for-OpenCL-blocks.patch](https://github.com/intel/opencl-clang/blob/ocl-open-80/patches/clang/0002-OpenCL-Simplify-LLVM-IR-generated-for-OpenCL-blocks.patch)
* [0003-OpenCL-Fix-assertion-due-to-blocks.patch](https://github.com/intel/opencl-clang/blob/ocl-open-80/patches/clang/0003-OpenCL-Fix-assertion-due-to-blocks.patch)
which are needed for [enqueue_kernel](https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/enqueue_kernel.html).
VectorComplier must be disabled by adding ```-DIGC_BUILD__VC_ENABLED=OFF``` to CMake flags.
#### LLVM9/Clang9 to LLVM11/Clang11
**Deprecated/Experimental**
We can no longer provide LLVM9-11/Clang9-11 conformance/performance guarantees.
#### LLVM12/Clang12 to LLVM13/Clang13
**Experimental**
There are no LLVM12-13/Clang12-13 conformance/performance guarantees.
#### LLVM14/Clang14
**Experimental**
There are no LLVM14/Clang14 conformance/performance guarantees.
#### LLVM15/Clang15
No additional steps are needed.
#### LLVM16/Clang16
**Experimental**
There are no LLVM16/Clang16 conformance/performance guarantees.