Skip to content

Commit 25af2bf

Browse files
pszymichgfxbot
authored andcommitted
Update README.md and documentation.
Change-Id: I34f4d080afe167e377b0e9f08f4a508bdd04894f
1 parent b95b222 commit 25af2bf

File tree

2 files changed

+155
-62
lines changed

2 files changed

+155
-62
lines changed

README.md

Lines changed: 11 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,44 @@
1-
# Intel(R) Graphics Compiler for OpenCL(TM)
1+
# Intel® Graphics Compiler for OpenCL
22

33
## Introduction
44

5-
The Intel(R) Graphics Compiler for OpenCL(TM) is an llvm based compiler for
6-
OpenCL(TM) targeting Intel Gen graphics hardware architecture.
5+
The Intel® Graphics Compiler for OpenCL is an LLVM based compiler for
6+
OpenCL targeting Intel Gen graphics hardware architecture.
77

88
Please refer to http://01.org/compute-runtime for additional details regarding
99
Intel's motivation and intentions wrt OpenCL support in the open source.
1010

1111

1212
## License
1313

14-
The Intel(R) Graphics Compute Runtime for OpenCL(TM) is distributed under the MIT.
14+
The Intel® Graphics Compute Runtime for OpenCL is distributed under the MIT License.
1515

1616
You may obtain a copy of the License at:
1717

1818
https://opensource.org/licenses/MIT
1919

2020
## Dependencies
2121

22-
* Common Clang - https://github.com/intel/opencl-clang
23-
* Clang Source - https://github.com/llvm-mirror/clang
24-
* Khronos OpenCL Headers - https://github.com/KhronosGroup/OpenCL-Headers
2522
* LLVM Source - https://github.com/llvm-mirror/llvm
23+
* Clang Source - https://github.com/llvm-mirror/clang
24+
* OpenCL Clang - https://github.com/intel/opencl-clang
25+
* SPIRV-LLVM Translator - https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git
2626

2727
## Supported Linux versions
2828

29-
IGC is supported on the following 32/64 bits Linux operating systems:
29+
IGC is supported on the following 64 bit Linux operating systems:
3030

31-
* Ubuntu 14.04, 16.04, 17.04, 18.04
31+
* Ubuntu 16.04, 18.04, 19.04
3232

3333
## Building
3434

35-
1. Install prerequisites
36-
37-
Building IGC needs flex, bison, cmake version later than 3.4.3 and
38-
libz. You can install required packages on ubuntu 18.04 like below:
39-
```
40-
$ sudo apt-get install flex bison libz-dev cmake
41-
```
42-
43-
2. Download all dependencies and create workspace folder as below:
44-
```
45-
<workspace>
46-
|- igc https://github.com/intel/intel-graphics-compiler
47-
|- llvm_patches https://github.com/intel/llvm-patches
48-
|- llvm_source https://github.com/llvm-mirror/llvm
49-
|- projects/opencl-clang https://github.com/intel/opencl-clang
50-
|- projects/llvm-spirv https://github.com/KhronosGroup/SPIRV-LLVM-Translator
51-
|- tools/clang https://github.com/llvm-mirror/clang
52-
```
53-
54-
This can be done using the following commands:
55-
56-
```
57-
$ cd <workspace>
58-
$ git clone -b release_70 https://github.com/llvm-mirror/llvm llvm_source
59-
$ git clone -b release_70 https://github.com/llvm-mirror/clang llvm_source/tools/clang
60-
$ git clone -b ocl-open-70 https://github.com/intel/opencl-clang llvm_source/projects/opencl-clang
61-
$ git clone -b llvm_release_70 https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm_source/projects/llvm-spirv
62-
$ git clone https://github.com/intel/llvm-patches llvm_patches
63-
$ git clone https://github.com/intel/intel-graphics-compiler igc
64-
[If using specific release]
65-
$ cd igc && git checkout -b tag igc_release_2019-01-15
66-
```
67-
68-
69-
3. Under workspace create a build folder. For example:
70-
```
71-
$ cd <workspace>
72-
$ mkdir build
73-
```
74-
75-
4. Build IGC using commands:
76-
```
77-
$ cd build
78-
$ cmake ../igc/IGC
79-
$ make -j`nproc`
80-
```
81-
82-
5. Install IGC
83-
```
84-
$ sudo make install
85-
```
35+
* [Ubuntu](https://github.com/intel/intel-graphics-compiler/master/documentation/build_ubuntu.md)
8636

8737
## Supported Platforms
8838

8939
* Intel Core Processors supporting Gen8 graphics devices
9040
* Intel Core Processors supporting Gen9 graphics devices
91-
* Intel Core Processors supporting Gen10 graphics devices
41+
* Intel Core Processors supporting Gen11 graphics devices
9242
* Intel Atom Processors supporting Gen9 graphics devices
9343

9444
## How to provide feedback
@@ -98,4 +48,3 @@ Please submit an issue using native github.com interface: https://github.com/int
9848

9949
Create a pull request on github.com with your patch. Make sure your change is
10050
cleanly building. A maintainer will contact you if there are questions or concerns.
101-

documentation/build_ubuntu.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Intel® Graphics Compiler for OpenCL™
2+
3+
## Ubuntu build section
4+
5+
### 1. Prepare workspace
6+
7+
Building IGC needs flex, bison, libz and cmake version at least 3.4.3. You can install required packages on Ubuntu using this command:
8+
9+
```shell
10+
$ sudo apt-get install flex bison libz-dev cmake
11+
```
12+
13+
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:
14+
```shell
15+
$ git config --global user.name "FirstName LastName"
16+
$ git config --global user.email "[email protected]"
17+
```
18+
19+
### 2. Install LLVM, Clang and OpenCL Clang
20+
21+
> <span style="color: firebrick; font-weight: 600;">Important notice</span>
22+
Every LLVM/Clang version brings some restrictions and in some cases needs different configuration. Please refer to [LLVM/Clang caveats](#LLVM/Clang-version-specific-caveats) section for more information.
23+
24+
In this step you need to prepare LLVM, OpenCL-Clang libraries and Clang for IGC.
25+
It can be done either by using packaged releases or building those yourself:
26+
27+
#### Use preinstalled packages
28+
29+
For **LLVM** and **Clang** packages please visit this [link](https://apt.llvm.org/) to download and install desired version.
30+
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.
31+
32+
Installing these three components (LLVM, Clang, and OpenCL Clang) means you no longer have to download their sources alongside IGC, so the workspace tree in the next step may look like this:
33+
```
34+
<workspace>
35+
|- igc https://github.com/intel/intel-graphics-compiler
36+
```
37+
38+
#### Build from sources
39+
40+
Download all dependencies and create workspace folder as below:
41+
```
42+
<workspace>
43+
|- igc https://github.com/intel/intel-graphics-compiler
44+
|- llvm_patches https://github.com/intel/llvm-patches
45+
|- llvm_source https://github.com/llvm-mirror/llvm
46+
|- projects/opencl-clang https://github.com/intel/opencl-clang
47+
|- projects/llvm-spirv https://github.com/KhronosGroup/SPIRV-LLVM-Translator
48+
|- tools/clang https://github.com/llvm-mirror/clang
49+
```
50+
51+
You can use following commands:
52+
```shell
53+
$ cd <workspace>
54+
$ git clone -b release_80 https://github.com/llvm-mirror/llvm llvm_source
55+
$ git clone -b release_80 https://github.com/llvm-mirror/clang llvm_source/tools/clang
56+
$ git clone -b ocl-open-80 https://github.com/intel/opencl-clang llvm_source/projects/opencl-clang
57+
$ git clone -b llvm_release_80 https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm_source/projects/llvm-spirv
58+
$ git clone https://github.com/intel/llvm-patches llvm_patches
59+
```
60+
61+
Make sure to specify correct branch for desired version. In this example we use LLVM8/Clang8.
62+
All dependencies will be build in the next step.
63+
64+
### 3. Build and install IGC
65+
66+
1. Download sources:
67+
```shell
68+
$ cd <workspace>
69+
$ git clone https://github.com/intel/intel-graphics-compiler igc
70+
[If using specific release]
71+
$ cd igc && git checkout -b tag igc_release_2019-01-15
72+
```
73+
74+
2. Prepare workspace and build
75+
76+
If you are using [Use preinstalled packages](#use-preinstalled-packages) method IGC will link with installed dependencies dynamically.
77+
If you are using [Build from sources](#build-from-sources) method IGC will automatically build all dependencies (provided that the workspace structure is preserved) and link statically to LLVM and OpenCL Clang.
78+
79+
You can use following commands to build IGC:
80+
81+
```shell
82+
$ cd <workspace>
83+
$ mkdir build
84+
$ cd build
85+
$ cmake ../igc/IGC
86+
$ make -j`nproc`
87+
```
88+
89+
3. Install IGC:
90+
```shell
91+
$ sudo make install
92+
```
93+
94+
***
95+
96+
## LLVM/Clang version specific caveats
97+
98+
### LLVM7/Clang7
99+
100+
In the **OpenCL Clang** project there are patches for Clang.
101+
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.
102+
103+
### LLVM8/Clang8
104+
105+
We recommend building LLVM8/Clang8 from sources instead for using prebuilds, because packaged Clang8 is missing these patches:
106+
* [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)
107+
* [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)
108+
* [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)
109+
110+
which are needed for [enqueue_kernel](https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/enqueue_kernel.html).
111+
112+
### LLVM9/Clang9
113+
114+
You can either use prebuilt packages or build from sources:
115+
```shell
116+
$ cd <workspace>
117+
$ git clone -b master https://github.com/llvm-mirror/llvm llvm_source
118+
$ git clone -b master https://github.com/llvm-mirror/clang llvm_source/tools/clang
119+
$ git clone -b master https://github.com/intel/opencl-clang llvm_source/projects/opencl-clang
120+
$ git clone -b master https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm_source/projects/llvm-spirv
121+
$ git clone https://github.com/intel/llvm-patches llvm_patches
122+
$ git clone https://github.com/intel/intel-graphics-compiler igc
123+
```
124+
125+
Keep in mind that this configuration is experimental and problems with compilation and functionality are to be expected.
126+
127+
Latest known configuration that compiles successfully:
128+
129+
```
130+
<workspace>
131+
|- igc (master/8cb64241)
132+
|- llvm_patches (master/cac8d77)
133+
|- llvm_source (master/541ca56bcf2)
134+
|- projects/opencl-clang (master/faa242c)
135+
|- projects/llvm-spirv (master/365675f)
136+
|- tools/clang (master/203bf9fe94)
137+
```
138+
139+
- https://github.com/intel/intel-graphics-compiler/commit/8cb64241
140+
- https://github.com/intel/llvm-patches/commit/cac8d77
141+
- https://github.com/llvm-mirror/llvm/commit/541ca56bcf2
142+
- https://github.com/intel/opencl-clang/commit/faa242c
143+
- https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/365675f
144+
- https://github.com/llvm-mirror/clang/commit/203bf9fe94

0 commit comments

Comments
 (0)