Skip to content

Commit f268319

Browse files
committed
update Driver Compiler doc for linux open source
1 parent 4f89b7c commit f268319

27 files changed

Lines changed: 1589 additions & 548 deletions

CMakePresets.json

Lines changed: 70 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
},
214214

215215
{
216-
"name": "Cid",
216+
"name": "cid",
217217
"hidden": true,
218218
"description": "Cid build necessary options. Please note the path of NPU plugin when use.",
219219
"cacheVariables": {
@@ -233,86 +233,113 @@
233233
}
234234
},
235235
{
236-
"name": "NpuCidRelease",
237-
"description": "Default configuration for NPU Driver Compiler target build. Please note: 1) Please make sure that NPU_PLUGIN_HOME environment variable is set to NPU plugin path. 2) build Cid is a static build which only build related targets and not include other unrelated options and targets to avoid getting big generated files.",
236+
"name": "npuCidReleaseLinux",
237+
"description": "Default configuration for NPU Driver Compiler target build on Linux. Please note: 1) Please make sure that NPU_PLUGIN_HOME environment variable is set to NPU plugin path. 2) build Cid is a static build which only build related targets and not include other unrelated options and targets to avoid getting big generated files.",
238238
"binaryDir": "${sourceDir}/build-x86_64/Release",
239-
"displayName": "NpuCidRelease",
240-
"inherits": ["Cid", "BuildOptimization", "Disabler"],
239+
"displayName": "npuCidRelease",
240+
"inherits": ["cid", "BuildOptimization", "Disabler"],
241241
"cacheVariables": {
242242
"CMAKE_BUILD_TYPE": {
243243
"type": "STRING",
244244
"value": "Release"
245245
},
246246

247-
"ENABLE_MULTI": false,
248-
"ENABLE_AUTO": false,
249-
"ENABLE_AUTO_BATCH": false,
250-
"ENABLE_PROXY": false,
251-
"ENABLE_HETERO": false,
252-
"ENABLE_INTEL_CPU": false,
253-
"ENABLE_INTEL_GPU": false,
254-
"ENABLE_TEMPLATE": false,
247+
"ENABLE_LTO": false,
248+
"ENABLE_FASTER_BUILD": false,
249+
"ENABLE_CPPLINT": false,
250+
251+
"ENABLE_TESTS": false,
252+
"ENABLE_FUNCTIONAL_TESTS": false,
253+
"ENABLE_SAMPLES": false,
254+
255+
"ENABLE_JS": false,
256+
257+
"ENABLE_PYTHON": false,
258+
"ENABLE_PYTHON_PACKAGING": false,
259+
"ENABLE_WHEEL": false,
255260

256261
"ENABLE_OV_ONNX_FRONTEND": false,
257262
"ENABLE_OV_PADDLE_FRONTEND": false,
258263
"ENABLE_OV_PYTORCH_FRONTEND": false,
259264
"ENABLE_OV_TF_FRONTEND": false,
260265
"ENABLE_OV_TF_LITE_FRONTEND": false,
266+
"ENABLE_OV_JAX_FRONTEND": false,
261267

268+
"ENABLE_SYSTEM_TBB": false,
269+
"ENABLE_TBB_RELEASE_ONLY": false,
262270
"ENABLE_OPENCV": false,
263271

264-
"ENABLE_BLOB_DUMP": false,
265-
"ENABLE_TESTS": false,
266-
"ENABLE_FUNCTIONAL_TESTS": false,
272+
"ENABLE_MULTI": false,
273+
"ENABLE_AUTO": false,
274+
"ENABLE_AUTO_BATCH": false,
275+
"ENABLE_PROXY": false,
276+
"ENABLE_HETERO": false,
277+
"ENABLE_INTEL_CPU": false,
278+
"ENABLE_INTEL_GPU": false,
279+
"ENABLE_TEMPLATE": false,
267280

268-
"ENABLE_SYSTEM_TBB": false,
269-
"ENABLE_TBB_RELEASE_ONLY": false,
270-
"ENABLE_JS": false,
271-
"ENABLE_NPU_PROTOPIPE": false
281+
"ENABLE_ZEROAPI_BACKEND": false,
282+
"ENABLE_DRIVER_COMPILER_ADAPTER": false,
283+
"ENABLE_INTEL_NPU_INTERNAL": false,
284+
285+
"ENABLE_NPU_PROTOPIPE": false,
286+
"ENABLE_NPU_LSP_SERVER":false
272287
}
273288
},
274289
{
275-
"name": "ovNpuCidRelease",
276-
"description": "Default configuration for NPU Driver Compiler target build. Please note: 1) it builds NPU plugin in OpenVINO project tree. Please make sure that NPU plugin is located inside OpenVINO repo in modules/vpux folder. 2) build Cid is a static build which only build related targets and not include other unrelated options and targets to avoid getting big generated files.",
290+
"name": "npuCidReleaseWindows",
291+
"description": "Default configuration for NPU Driver Compiler target build on Windows. Please note: 1) Please make sure that NPU_PLUGIN_HOME environment variable is set to NPU plugin path. 2) build Cid is a static build which only build related targets and not include other unrelated options and targets to avoid getting big generated files.",
277292
"binaryDir": "${sourceDir}/build-x86_64/Release",
278-
"displayName": "ovNpuCidRelease",
279-
"inherits": ["Cid", "BuildOptimization", "Disabler"],
293+
"displayName": "npuCidRelease",
294+
"inherits": ["cid", "BuildOptimization", "Disabler"],
280295
"cacheVariables": {
281296
"CMAKE_BUILD_TYPE": {
282297
"type": "STRING",
283298
"value": "Release"
284299
},
285300

286-
"ENABLE_MULTI": false,
287-
"ENABLE_AUTO": false,
288-
"ENABLE_AUTO_BATCH": false,
289-
"ENABLE_PROXY": false,
290-
"ENABLE_HETERO": false,
291-
"ENABLE_INTEL_CPU": false,
292-
"ENABLE_INTEL_GPU": false,
293-
"ENABLE_TEMPLATE": false,
301+
"CMAKE_TOOLCHAIN_FILE":"${sourceDir}\\cmake\\toolchains\\onecoreuap.toolchain.cmake",
302+
303+
"ENABLE_LTO": false,
304+
"ENABLE_FASTER_BUILD": false,
305+
"ENABLE_CPPLINT": false,
306+
307+
"ENABLE_TESTS": false,
308+
"ENABLE_FUNCTIONAL_TESTS": false,
309+
"ENABLE_SAMPLES": false,
310+
311+
"ENABLE_JS": false,
312+
313+
"ENABLE_PYTHON": false,
314+
"ENABLE_PYTHON_PACKAGING": false,
315+
"ENABLE_WHEEL": false,
294316

295317
"ENABLE_OV_ONNX_FRONTEND": false,
296318
"ENABLE_OV_PADDLE_FRONTEND": false,
297319
"ENABLE_OV_PYTORCH_FRONTEND": false,
298320
"ENABLE_OV_TF_FRONTEND": false,
299321
"ENABLE_OV_TF_LITE_FRONTEND": false,
322+
"ENABLE_OV_JAX_FRONTEND": false,
300323

324+
"ENABLE_SYSTEM_TBB": false,
325+
"ENABLE_TBB_RELEASE_ONLY": false,
301326
"ENABLE_OPENCV": false,
302327

303-
"ENABLE_BLOB_DUMP": false,
304-
"ENABLE_TESTS": false,
305-
"ENABLE_FUNCTIONAL_TESTS": false,
328+
"ENABLE_MULTI": false,
329+
"ENABLE_AUTO": false,
330+
"ENABLE_AUTO_BATCH": false,
331+
"ENABLE_PROXY": false,
332+
"ENABLE_HETERO": false,
333+
"ENABLE_INTEL_CPU": false,
334+
"ENABLE_INTEL_GPU": false,
335+
"ENABLE_TEMPLATE": false,
306336

307-
"ENABLE_SYSTEM_TBB": false,
308-
"ENABLE_TBB_RELEASE_ONLY": false,
309-
"ENABLE_JS": false,
310-
"ENABLE_NPU_PROTOPIPE": false,
337+
"ENABLE_ZEROAPI_BACKEND": false,
338+
"ENABLE_DRIVER_COMPILER_ADAPTER": false,
339+
"ENABLE_INTEL_NPU_INTERNAL": false,
311340

312-
"OPENVINO_EXTRA_MODULES": {
313-
"type": "FILEPATH",
314-
"value": "./modules/vpux"
315-
}
341+
"ENABLE_NPU_PROTOPIPE": false,
342+
"ENABLE_NPU_LSP_SERVER":false
316343
}
317344
},
318345
{

src/vpux_compiler/src/frontend/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
# SPDX-License-Identifier: Apache 2.0
44
#
55

6+
if(BUILD_COMPILER_FOR_DRIVER)
7+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
8+
string(REPLACE "/sdl" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
9+
string(REPLACE "/sdl" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
10+
endif()
11+
endif()
12+
613
file(GLOB_RECURSE SRC_FILES *.cpp)
714
set(TARGET_NAME "npu_compiler_frontend")
815
add_mlir_library(${TARGET_NAME}

src/vpux_driver_compiler/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
# SPDX-License-Identifier: Apache 2.0
44
#
55

6+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
7+
string(REPLACE "/sdl" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
8+
string(REPLACE "/sdl" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
9+
endif()
10+
611
set(CID_COMPONENT "CiD")
712
ov_cpack_add_component(${CID_COMPONENT})
813

src/vpux_driver_compiler/README.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,15 @@ vclCompilerDestroy
5959

6060
## How to build related targets locally
6161

62-
Driver Compiler provides npu_driver_compiler, compilerTest, profilingTest and loaderTest to compile network and test. To build Driver Compiler related targets locally, refer to [How to build driver compiler](./docs/how_to_build_driver_compiler.md).
62+
Driver Compiler provides npu_driver_compiler, compilerTest, profilingTest and loaderTest to compile network and test. To build Driver Compiler related targets locally, refer to
6363

64+
- (Recommended) build using CMake Presets, requiring CMake version 3.19 or higher.
65+
- [linux](./docs/how_to_build_driver_compiler_withCmakePresets_on_linux.md)
66+
- [windows](./docs/how_to_build_driver_compiler_withCmakePresets_on_windows.md)
6467

65-
## How to release Driver Compiler package
66-
67-
Unlike local build of Driver Compiler related targets, we need to apply some patches to [OpenVINO Project] and [NPU-Plugin Project] and also pack the elf, pdb and tbb files together to meet driver requirements.
68-
69-
To get more info about Driver Compiler package, refer to [introduction of Driver Compiler package](https://github.com/intel-innersource/applications.ai.vpu-accelerators.flex-cid-tools/blob/develop/docs/introductio-of-driver_compiler_package.md) in [CiD project] repo.
70-
71-
To build Driver Compiler package, refer to [How to Release Driver Compiler package.md](https://github.com/intel-innersource/applications.ai.vpu-accelerators.flex-cid-tools/blob/develop/docs/how-to-release-package.md) in [CiD project] repo.
72-
73-
74-
## How to test
75-
76-
Please refer to [How to test](./docs/how_to_test.md).
77-
78-
79-
## How to debug
80-
81-
Please refer to [How to debug](./docs/how_to_debug.md).
68+
- build with cmake options
69+
- [linux](./docs/how_to_build_driver_compiler_on_linux.md)
70+
- [windows](./docs/how_to_build_driver_compiler_on_windows.md)
8271

8372
[OpenVINO Project]: https://github.com/openvinotoolkit/openvino
8473
[NPU-Plugin Project]: https://github.com/intel-innersource/applications.ai.vpu-accelerators.vpux-plugin
85-
[CiD Project]: https://github.com/intel-innersource/applications.ai.vpu-accelerators.flex-cid-tools
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# How to setup windows environment
2+
3+
This document introduces how to set up windows environment for Driver Compiler package building step by step.
4+
5+
## Contents:
6+
* Step 1: [Install CMake](#Install_CMake)
7+
* Step 2: [Install Git](#Install_Git)
8+
* Step 3: [Install Python](#Install_Python)
9+
* Step 4: [Install Visual Studio 2019 Community](#Install_Visual_Studio_2019_Community)
10+
* Step 5: [Install Windows SDK](#Install_Windows_SDK)
11+
* Step 6: [Install Windows WDK](#Install_Windows_WDK)
12+
13+
> Notice: Please do not forget set their environment variables in system PATH, if needed.
14+
15+
## <span id="Install_CMake">Step 1: Install CMake</span>
16+
17+
1) According to [openvino/install_build_dependencie.sh](https://github.com/openvinotoolkit/openvino/blob/master/install_build_dependencies.sh#L208), the cmake minor version is ‘3.20.0’. Here choose the cmake (version 3.24.0.rc1) in the following link to use. Use the [link](https://github.com/Kitware/CMake/releases/download/v3.24.0-rc1/cmake-3.24.0-rc1-windows-x86_64.msi) to download and turn to the download path.
18+
19+
2) Double click the `.msi` file to start installation, click `Next`.
20+
21+
3) Accept the license and click `Next`.
22+
23+
4) Choose Add CMake to the system PATH for all users and click `Next`.
24+
25+
5) Click `Next` to set the default cmake install path.
26+
27+
6) Click `Install`, wait for the installation.
28+
29+
7) Click `Finish`.
30+
31+
## <span id="Install_Git">Step 2: Install Git</span>
32+
33+
1) Download git for Windows with the [link](https://github.com/git-for-windows/git/releases/download/v2.36.1.windows.1/Git-2.36.1-64-bit.exe)
34+
35+
2) Double click the .exe file to install, click `Yes` to allow the installation.
36+
37+
3) Accept the license and click `Next`.
38+
39+
4) Click `Next` and set the default git install path.
40+
41+
5) Check these components and click `Next`.
42+
43+
<img src=./imgs/git_components.png width=60% />
44+
45+
6) Click `Next` with default option until install.
46+
47+
7) Click `Install` and Wait for installing.
48+
49+
8) Click `Finish`.
50+
51+
52+
## <span id="Install_Python">Step 3: Install Python</span>
53+
54+
1) According to OV/install_build_dependencie.sh and how-to-build.md, the minor python version is `3.9`. Here choose the Python 3.9.10 to use. Download with the [link](https://www.python.org/ftp/python/3.9.10/python-3.9.10-amd64.exe)
55+
56+
2) Double click the .exe file to install Python.
57+
58+
3) Check Add Python 3.9 to PATH, and click `Install Now`.
59+
60+
4) Wait for the installation.
61+
62+
5) Click `Disable path length limit`, click `Yes` for the pop out window.
63+
64+
6) Then click `Close` to finish installation for Python.
65+
66+
67+
## <span id="Install_Visual_Studio_2019_Community">Step 4: Install Visual Studio 2019 Community</span>
68+
69+
Below is an example for Visual Studio2019.
70+
71+
1) According to [OpenVINO Project]/install_build_dependencie.sh, the Visual Studio needed to use is 2019 with version 16.3 or higher. Here choose Visual Studio 2019 community version 16.11 in the [link](https://my.visualstudio.com/Downloads?q=visual%20studio%202019&wt.mc_id=o~msft~vscom~older-downloads). Click the `Download` and then turn to the download path.
72+
73+
<img src=./imgs/VisualStudioDownloadweb.png width=80% />
74+
75+
2) Double click vs_community__xxxxxxxxx.exe to start install.
76+
77+
3) Check the following components `desktop development with c++` and all opetion before `JavaScript diagnostics`.
78+
79+
<img src=./imgs/VisualStudiocomponents1.png width=90% />
80+
81+
To avoid some build issue, we need to install `spectre mitigated libs` as follow step. Go to the `Individual componets` part and search for `spectre mitigated libs`. Then check the corresponding box and click `install while downloading`.
82+
83+
<img src=./imgs/VisualStudiocomponents2.png width=90% />
84+
85+
4) Wait for the installation and then Visual Studio 2019 Community is installed successfully.
86+
87+
5) If you want to build with ninja, please Open Visual Studio Installer, choose the `Modify` and then `Individual components`. Next, search for C++ CMake Tools for Windows and check the box, then click the install in right part and waiting for install. If you can not install by thish way, please refer to the part of "Getting Ninja" section on https://ninja-build.org/.
88+
89+
90+
## <span id="Install_Windows_SDK">Step 5: Install Windows SDK</span>
91+
92+
You can download the windows SDK with the [link](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/). You can choose the one suitable for your windows environment.
93+
94+
1) Here choose the 10.0.22000.194 based on our current system environment, click `Install SDK`.
95+
96+
<img src=./imgs/SDKdownloadweb.png width=90% />
97+
98+
2) After finishing downloading winsdksetup.exe, turn to the download path. Then, double click `winsdks
99+
100+
3) Choose `No` when collect insight for the windows Kits and Click `Next`.
101+
102+
4) Click `Next` to accept the license.
103+
104+
5) Check box for all. Notice: here has installed Application Verifier and WinDbg (windbg also can be installed by this link). Then click `Install`.
105+
106+
<img src=./imgs/SDKcomponents.png width=60% />
107+
108+
6) Wait for the installation and the click `Close` to finish installation.
109+
110+
111+
## <span id="Install_Windows_WDK">Step 6: Install Windows WDK</span>
112+
113+
You can download the windows WDK with the [guide link](https://learn.microsoft.com/en-ie/windows-hardware/drivers/other-wdk-downloads). Go to the `step2: Install the WDK`(or just use this [link](https://learn.microsoft.com/en-us/windows-hardware/drivers/other-wdk-downloads?source=recommendations#step-2-install-the-wdk)) in [guide link](https://learn.microsoft.com/en-ie/windows-hardware/drivers/other-wdk-downloads). Choose a one suitable one for your windows environment to downloading.
114+
115+
1) Here choose the windows 11 with version 21H22 based on current system environment, click `Windows 11, version 21H2 WDK`.
116+
117+
<img src=./imgs/WDKdownloadweb.png width=60% />
118+
119+
2) Double click wdksetup.exe, and click Next with default installer path.
120+
121+
3) Choose `No` when collect insight for the windows Kits and Click `Next`.
122+
123+
4) Click Next and click `Install`.
124+
125+
5) Then maybe get a message box as follow. Choose the `Install Windows Driver Kit Visual Studio extension` and click the `close` button.
126+
127+
<img src=./imgs/WDKinstalled.png width=60% />
128+
129+
6) Prompt a windows to info you the change of installation, click `yes` and trun to install page and click `install`.
130+
131+
<img src=./imgs/WDKextension.png width=60% />
132+
133+
6) Then, waiting for the installation and the final installation result is as follows and click `Close`.
134+
135+
<img src=./imgs/WDKextensioninstalled.png width=60% />
136+
137+
Note: Please note that api validator tool is part of WDK for Windows 10. If you did not special the install path in the beginning of installation WDK, this tool is located in C:\Program Files (x86)\Windows Kits\10\bin. Otherwise, it will be in the path you specified.
138+
139+
[OpenVINO Project]: https://github.com/openvinotoolkit/openvino

0 commit comments

Comments
 (0)