20
20
:: Install compile environment for xly CI.
21
21
::
22
22
:: Include:
23
- :: 1. CMake 3.17 .0
23
+ :: 1. CMake 3.18 .0
24
24
:: 2. Git 2.28.0
25
- :: 3. Python 3.8.3
25
+ :: 3. Python 3.8.3\3.9.7\3.10.0
26
26
:: 4. Visual Studio 2017 Community
27
27
:: 5. CUDA 11.2
28
28
:: 6. java jre
29
29
:: 7. sccache
30
- :: 8. xly agent
30
+ :: 8. TensorRT
31
+ :: 9. xly agent
31
32
32
33
:: Echo command is not required.
33
34
@ echo off
34
35
cd /d %~dp0 %
35
36
37
+ SET INSTALL_FLAG = %1
38
+ :: 0. PR_CI_Windows_OPENBLAS
39
+ :: 1. PR_CI_Windows_Inference,will install VS2019, CUDA11.2
40
+ :: 2. PR_CI_Windows,CUDA10.2
41
+
42
+
36
43
:: ===== start step 0: wget tool =====
37
44
:: Download wget for windows when there is not wget tool.
38
- echo " >>>>>>>> step [0/8 ]: wget tool"
45
+ echo " >>>>>>>> step [0/9 ]: wget tool"
39
46
wget --help > nul 2 > nul || call :install_wget
40
47
goto cmake
41
48
42
49
:install_wget
43
- echo There is not wget in this PC, will download wget 1.20 .
44
- echo Download package from https://eternallybored.org/misc/wget/1.20 /64/wget.exe ...
45
- certutil -urlcache -split -f https://eternallybored.org/misc/wget/1.20 /64/wget.exe > nul 2 > nul
50
+ echo There is not wget in this PC, will download wget 1.21.4 .
51
+ echo Download package from https://eternallybored.org/misc/wget/1.21.4 /64/wget.exe ...
52
+ certutil -urlcache -split -f https://eternallybored.org/misc/wget/1.21.4 /64/wget.exe > nul 2 > nul
46
53
if %errorlevel% == 0 (
47
54
echo Download wget tool into %cd% success.
48
55
) else (
@@ -53,26 +60,26 @@ goto :eof
53
60
:: ===== end step 0: wget tool =====
54
61
55
62
:: ===== start step 1: cmake =====
56
- :: Download CMake-3.17 .0 and add in PATH when it not installed.
57
- :: TODO: limit version >= 3.17 .0
63
+ :: Download CMake-3.18 .0 and add in PATH when it not installed.
64
+ :: TODO: limit version >= 3.18 .0
58
65
:cmake
59
- echo " >>>>>>>> step [1/8 ]: CMake 3.17 .0"
66
+ echo " >>>>>>>> step [1/9 ]: CMake 3.18 .0"
60
67
cmake --help > nul 2 > nul || call :install_cmake
61
68
goto git
62
69
63
70
:install_cmake
64
- echo There is not cmake in this PC, will install cmake-3.17 .0.
65
- echo Download package from https://cmake.org/files/v3.17 /cmake-3.17 .0-win64-x64.msi ...
66
- wget -O cmake-3.17 .0-win64-x64.msi https://cmake.org/files/v3.17 /cmake-3.17 .0-win64-x64.msi
67
- echo Install cmake-3.17 .0 ...
71
+ echo There is not cmake in this PC, will install cmake-3.18 .0.
72
+ echo Download package from https://cmake.org/files/v3.18 /cmake-3.18 .0-win64-x64.msi ...
73
+ wget -O cmake-3.18 .0-win64-x64.msi https://cmake.org/files/v3.18 /cmake-3.18 .0-win64-x64.msi
74
+ echo Install cmake-3.18 .0 ...
68
75
:: /passive [silent installation]
69
76
:: /norestart [do not restart]
70
77
:: ADD_CMAKE_TO_PATH = System [add CMake to the system PATH for all users]
71
- start /wait cmake-3.17 .0-win64-x64.msi /passive /norestart ADD_CMAKE_TO_PATH=System
78
+ start /wait cmake-3.18 .0-win64-x64.msi /passive /norestart ADD_CMAKE_TO_PATH=System
72
79
if %errorlevel% == 0 (
73
- echo Install CMake-3.17 .0 success!
80
+ echo Install CMake-3.18 .0 success!
74
81
) else (
75
- echo Error***** Install Cmake-3.17 .0 failed, please re-install it manually.
82
+ echo Error***** Install Cmake-3.18 .0 failed, please re-install it manually.
76
83
)
77
84
goto :eof
78
85
:: ===== end step 1: cmake =====
@@ -81,7 +88,7 @@ goto :eof
81
88
:: Download Git-2.28.0 and add in PATH when it not installed.
82
89
:: TODO: limit version >= 2.28.0
83
90
:git
84
- echo " >>>>>>>> step [2/8 ]: Git 2.28.0"
91
+ echo " >>>>>>>> step [2/9 ]: Git 2.28.0"
85
92
git --help > nul 2 > nul || call :install_git
86
93
goto python
87
94
@@ -103,17 +110,19 @@ goto :eof
103
110
:: ===== end step 2: Git =====
104
111
105
112
:: ===== start step 3: Python =====
106
- :: Download Python-3.8.3 and add in PATH when it not installed.
113
+ :: Download Python and add in PATH when it not installed.
107
114
:: TODO: limit version >= 3.8.3
108
115
:python
109
- echo " >>>>>>>> step [3/8]: Python 3.8.3"
110
- python -V 2 >& 1 | findstr /C:" Python 3.8.3" > nul 2 > nul || call :install_python
116
+ echo " >>>>>>>> step [3/9]: Python"
117
+ where python 2 >& 1 | findstr /C:" Python38" > nul 2 > nul || call :install_python3.8.3
118
+ where python 2 >& 1 | findstr /C:" Python39" > nul 2 > nul || call :install_python3.9.7
119
+ where python 2 >& 1 | findstr /C:" Python310" > nul 2 > nul || call :install_python3.10.0
111
120
goto vs
112
121
113
- :install_python
122
+ :install_python3.8.3
114
123
echo There is not Python in this PC, will install Python-3.8.3
115
- echo Download package from https://paddle-ci.gz.bcebos.com/window_requirement /python-3.8.3-amd64.exe ...
116
- wget -O python-3.8.3-amd64.exe https://paddle-ci.gz.bcebos.com/window_requirement /python-3.8.3-amd64.exe
124
+ echo Download package from https://www.python.org/ftp/python/3.8.3 /python-3.8.3-amd64.exe ...
125
+ wget -O python-3.8.3-amd64.exe https://www.python.org/ftp/python/3.8.3 /python-3.8.3-amd64.exe
117
126
echo Install Python-3.8.3 ...
118
127
:: /passive [silent install]
119
128
:: InstallAllUsers [add path for all users]
@@ -126,16 +135,46 @@ if %errorlevel% == 0 (
126
135
echo Error***** Install python-3.8.3 failed, please re-install it manually.
127
136
)
128
137
goto :eof
138
+
139
+ :install_python3.9.7
140
+ echo There is not Python in this PC, will install Python-3.9.7
141
+ echo Download package from https://www.python.org/ftp/python/3.9.7/python-3.9.7-amd64.exe ...
142
+ wget -O python-3.9.7-amd64.exe https://www.python.org/ftp/python/3.9.7/python-3.9.7-amd64.exe
143
+ echo Install Python-3.9.7 ...
144
+ start /wait python-3.9.7-amd64.exe /passive InstallAllUsers=1 PrependPath=1 TargetDir=C:\Python39
145
+ if %errorlevel% == 0 (
146
+ echo Install python-3.9.7 success!
147
+ ) else (
148
+ echo Error***** Install python-3.9.7 failed, please re-install it manually.
149
+ )
150
+ goto :eof
151
+
152
+ :install_python3.10.0
153
+ echo There is not Python in this PC, will install Python-3.10.0
154
+ echo Download package from https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe ...
155
+ wget -O python-3.10.0-amd64.exe https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe
156
+ echo Install Python-3.10.0 ...
157
+ start /wait python-3.10.0-amd64.exe /passive InstallAllUsers=1 PrependPath=1 TargetDir=C:\Python310
158
+ if %errorlevel% == 0 (
159
+ echo Install python-3.10.0 success!
160
+ ) else (
161
+ echo Error***** Install python-3.10.0 failed, please re-install it manually.
162
+ )
163
+ goto :eof
129
164
:: ===== end step 3: Python =====
130
165
131
- :: ===== start step 4: Visual Studio 2017 Community =====
166
+ :: ===== start step 4: Visual Studio Community =====
132
167
:: Download Visual Studio 2017 when it not installed.
133
168
:vs
134
- echo " >>>>>>>> step [4/8]: Visual Studio 2017 "
135
- cmd /C " C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" > nul 2 > nul || call :install_visual_studio
169
+ echo " >>>>>>>> step [4/9]: Visual Studio"
170
+ if %INSTALL_FLAG% == 1 (
171
+ cmd /C " C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" > nul 2 > nul || call :install_visual_studio2019
172
+ ) else (
173
+ cmd /C " C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" > nul 2 > nul || call :install_visual_studio2017
174
+ )
136
175
goto :cuda
137
176
138
- :install_visual_studio
177
+ :install_visual_studio2017
139
178
echo There is not Visual Studio in this PC, will install VS2017.
140
179
echo Download package from " https://paddle-ci.gz.bcebos.com/window_requirement/VS2017/vs_Community.exe"
141
180
wget -O vs_Community.exe " https://paddle-ci.gz.bcebos.com/window_requirement/VS2017/vs_Community.exe"
@@ -151,15 +190,57 @@ if %errorlevel% == 0 (
151
190
echo Error***** Install Visual Studio 2017 failed, please re-install it manually.
152
191
)
153
192
goto :eof
154
- :: ===== end step 4: Visual Studio 2017 =====
155
193
156
- :: ===== start step 5: CUDA 11 =====
194
+ :install_visual_studio2019
195
+ echo There is not Visual Studio in this PC, will install VS2019.
196
+ echo Download package from " https://paddle-ci.gz.bcebos.com/window_requirement/vs_community_2019.exe"
197
+ wget -O vs_community_2019.exe " https://paddle-ci.gz.bcebos.com/window_requirement/vs_community_2019.exe"
198
+ echo Install Visual Studio 2019 ...
199
+ start /wait vs_community_2019.exe --passive --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.Universal --includeRecommended
200
+ if %errorlevel% == 0 (
201
+ echo Install Visual Studio 2019 success!
202
+ ) else (
203
+ echo Error***** Install Visual Studio 2019 failed, please re-install it manually.
204
+ )
205
+ goto :eof
206
+ :: ===== end step 4: Visual Studio Community =====
207
+
208
+ :: ===== start step 5: CUDA =====
157
209
:cuda
158
- echo " >>>>>>>> step [5/8]: CUDA 11.2"
159
- cmd /C nvcc --version 2 > nul | findstr /C:" 11.2" > nul 2 > nul || call :install_cuda
210
+ echo " >>>>>>>> step [5/9]: CUDA "
211
+ if %INSTALL_FLAG% == 1 (
212
+ cmd /C nvcc --version 2 > nul | findstr /C:" 11.2" > nul 2 > nul || call :install_cuda112
213
+ )
214
+ if %INSTALL_FLAG% == 2 (
215
+ cmd /C nvcc --version 2 > nul | findstr /C:" 10.2" > nul 2 > nul || call :install_cuda102
216
+ )
160
217
goto java-jre
161
218
162
- :install_cuda
219
+ :install_cuda102
220
+ echo There is not CUDA in this PC, will install CUDA-10.2.
221
+ echo Download package from " https://paddle-ci.gz.bcebos.com/window_requirement/cuda_10.2.89_441.22_win10.exe"
222
+ wget -O cuda_installer.exe " https://paddle-ci.gz.bcebos.com/window_requirement/cuda_10.2.89_441.22_win10.exe"
223
+ echo Install CUDA-10.2 ...
224
+ :: -s [silent install]
225
+ start /wait cuda_installer.exe -s
226
+ if %errorlevel% == 0 (
227
+ echo Install CUDA-10.2 success!
228
+ ) else (
229
+ echo Error***** Install CUDA-10.2 failed, please re-install it manually.
230
+ goto :eof
231
+ )
232
+ del cuda_installer.exe
233
+
234
+ echo Download cudnn from " https://paddle-ci.gz.bcebos.com/window_requirement/cudnn-10.2-windows10-x64-v7.6.5.32.zip"
235
+ wget -O cudnn-10.2-windows10-x64-v7.6.5.32.zip " https://paddle-ci.gz.bcebos.com/window_requirement/cudnn-10.2-windows10-x64-v7.6.5.32.zip"
236
+ tar xf cudnn-10.2-windows10-x64-v7.6.5.32.zip
237
+ xcopy /E /Y /R " cuda\bin\*" " C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin"
238
+ xcopy /E /Y /R " cuda\include\*" " C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include"
239
+ xcopy /E /Y /R " cuda\lib\*" " C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib"
240
+ rd /s /q cuda
241
+ goto :eof
242
+
243
+ :install_cuda112
163
244
echo There is not CUDA in this PC, will install CUDA-11.2.
164
245
echo Download package from " https://paddle-ci.gz.bcebos.com/window_requirement/cuda_11.2.0_460.89_win10.exe"
165
246
wget -O cuda_installer.exe " https://paddle-ci.gz.bcebos.com/window_requirement/cuda_11.2.0_460.89_win10.exe"
@@ -173,7 +254,6 @@ if %errorlevel% == 0 (
173
254
goto :eof
174
255
)
175
256
del cuda_installer.exe
176
-
177
257
echo Download cudnn from " https://paddle-ci.gz.bcebos.com/window_requirement/cudnn-11.2-windows-x64-v8.1.0.77.zip"
178
258
wget -O cudnn-11.2-windows-x64-v8.1.0.77.zip " https://paddle-ci.gz.bcebos.com/window_requirement/cudnn-11.2-windows-x64-v8.1.0.77.zip"
179
259
tar xf cudnn-11.2-windows-x64-v8.1.0.77.zip
@@ -182,11 +262,11 @@ xcopy /E /Y /R "cuda\include\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\C
182
262
xcopy /E /Y /R " cuda\lib\*" " C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\lib"
183
263
rd /s /q cuda
184
264
goto :eof
185
- :: ===== end step 5: CUDA 10 =====
265
+ :: ===== end step 5: CUDA =====
186
266
187
267
:: ===== start step 6: java jre =====
188
268
:java-jre
189
- echo " >>>>>>>> step [6/8 ]: java jre"
269
+ echo " >>>>>>>> step [6/9 ]: java jre"
190
270
cmd /C java -version > nul 2 > nul || call :install_java
191
271
goto sccache
192
272
@@ -208,21 +288,44 @@ goto :eof
208
288
209
289
:: ===== start step 7: sccache on windowss =====
210
290
:sccache
211
- echo " >>>>>>>> step [7/8 ]: sccache"
291
+ echo " >>>>>>>> step [7/9 ]: sccache"
212
292
cmd /C sccache -V > nul 2 > nul || call :download_sccache
213
- goto xly-agent
293
+ goto tensorrt
214
294
215
295
:download_sccache
216
296
echo There is not sccache in this PC, will install sccache.
217
297
echo Download package from https://paddle-ci.gz.bcebos.com/window_requirement/sccache.exe
218
298
wget -O sccache.exe " https://paddle-ci.gz.bcebos.com/window_requirement/sccache.exe"
219
299
copy sccache.exe C:\Python38 /Y
300
+ goto :eof
220
301
:: ===== end step 7: sccache on windows =====
221
302
222
- :: ===== start step 8: xly agent =====
303
+ :: ===== start step 8: TensorRT =====
304
+ :tensorrt
305
+ echo " >>>>>>>> step [8/9]: TensorRT"
306
+ if %INSTALL_FLAG% == 2 (
307
+ call :download_TensorRT_7_0_0_11
308
+ )
309
+ if %INSTALL_FLAG% == 1 (
310
+ call :download_TensorRT_8_0_1_6
311
+ )
312
+ goto xly-agent
313
+
314
+ :download_TensorRT_7_0_0_11
315
+ if not exist TensorRT-7.0.0.11.Windows10.x86_64.cuda-10.2.cudnn7.6.zip wget -O TensorRT-7.0.0.11.Windows10.x86_64.cuda-10.2.cudnn7.6.zip ^
316
+ " https://paddle-ci.gz.bcebos.com/window_requirement/TensorRT-7.0.0.11.Windows10.x86_64.cuda-10.2.cudnn7.6.zip"
317
+ goto :eof
318
+
319
+ :download_TensorRT_8_0_1_6
320
+ if not exist TTensorRT-8.0.1.6.Windows10.x86_64.cuda-11.3.cudnn8.2.zip wget -O TensorRT-8.0.1.6.Windows10.x86_64.cuda-11.3.cudnn8.2.zip ^
321
+ " https://paddle-ci.gz.bcebos.com/window_requirement/TensorRT-8.0.1.6.Windows10.x86_64.cuda-11.3.cudnn8.2.zip"
322
+ goto :eof
323
+ :: ===== end step 8: TensorRT =====
324
+
325
+ :: ===== start step 9: xly agent =====
223
326
:xly-agent
224
- echo " >>>>>>>> step [8/8 ]: xly agent"
225
- wget -O agent.jar " https://xly.bce.baidu.com/sa_server/agent/v1/download?version=1.2.8"
226
- :: ===== end step 8 : xly agent =====
327
+ echo " >>>>>>>> step [9/9 ]: xly agent"
328
+ if not exist agent.jar wget -O agent.jar " https://xly.bce.baidu.com/sa_server/agent/v1/download?version=1.2.8"
329
+ :: ===== end step 9 : xly agent =====
227
330
228
331
pause
0 commit comments