@@ -9,6 +9,13 @@ set SRC_DIR=%~dp0\..
99
1010if not exist " %SRC_DIR% \temp_build" mkdir " %SRC_DIR% \temp_build"
1111
12+ rem in unit test workflow, we get CUDA_VERSION, for example 11.1
13+ if defined CUDA_VERSION (
14+ set CUDA_VER = %CUDA_VERSION:. =%
15+ ) else (
16+ set CUDA_VER = %CU_VERSION:cu =%
17+ )
18+
1219set /a CUDA_VER = %CU_VERSION:cu = %
1320set CUDA_VER_MAJOR = %CUDA_VER:~0 ,-1 %
1421set CUDA_VER_MINOR = %CUDA_VER:~-1 ,1 %
@@ -91,6 +98,14 @@ if not exist "%SRC_DIR%\temp_build\cudnn-10.2-windows10-x64-v7.6.5.32.zip" (
9198 set " CUDNN_SETUP_FILE = %SRC_DIR% \temp_build\cudnn-10.2-windows10-x64-v7.6.5.32.zip"
9299)
93100
101+ if not exist " %SRC_DIR% \temp_build\gpu_driver_dlls.7z" (
102+ curl -k -L " https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output " %SRC_DIR% \temp_build\gpu_driver_dlls.zip"
103+ if errorlevel 1 exit /b 1
104+ )
105+
106+ echo Installing GPU driver DLLs
107+ 7z x %SRC_DIR% \temp_build\gpu_driver_dlls.zip -aoa -o" C:\Windows\System32"
108+
94109goto cuda_common
95110
96111:cuda110
@@ -175,19 +190,20 @@ if not exist "%SRC_DIR%\temp_build\NvToolsExt.7z" (
175190 if errorlevel 1 exit /b 1
176191)
177192
178- if not exist " %SRC_DIR% \temp_build\gpu_driver_dlls.7z" (
179- curl -k -L " https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output " %SRC_DIR% \temp_build\gpu_driver_dlls.zip"
180- if errorlevel 1 exit /b 1
181- )
182-
183193echo Installing CUDA toolkit...
1841947z x %CUDA_SETUP_FILE% -o" %SRC_DIR% \temp_build\cuda"
185195pushd " %SRC_DIR% \temp_build\cuda"
186196start /wait setup.exe -s %ARGS%
187197popd
188198
189199echo Installing VS integration...
190- xcopy /Y " %SRC_DIR% \temp_build\cuda\CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions\*.*" " C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\BuildCustomizations"
200+ rem It's for VS 2019
201+ if " %CUDA_VER_MAJOR% " == " 10" (
202+ xcopy /Y " %SRC_DIR% \temp_build\cuda\CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions\*.*" " C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations"
203+ )
204+ if " %CUDA_VER_MAJOR% " == " 11" (
205+ xcopy /Y " %SRC_DIR% \temp_build\cuda\visual_studio_integration\CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions\*.*" " C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations"
206+ )
191207
192208echo Installing NvToolsExt...
1932097z x %SRC_DIR% \temp_build\NvToolsExt.7z -o" %SRC_DIR% \temp_build\NvToolsExt"
@@ -215,8 +231,5 @@ xcopy /Y "%SRC_DIR%\temp_build\cudnn\cuda\bin\*.*" "%ProgramFiles%\NVIDIA GPU Co
215231xcopy /Y " %SRC_DIR% \temp_build\cudnn\cuda\lib\x64\*.*" " %ProgramFiles% \NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR% \lib\x64"
216232xcopy /Y " %SRC_DIR% \temp_build\cudnn\cuda\include\*.*" " %ProgramFiles% \NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR% \include"
217233
218- echo Installing GPU driver DLLs
219- 7z x %SRC_DIR% \temp_build\gpu_driver_dlls.zip -o" C:\Windows\System32"
220-
221234echo Cleaning temp files
222235rd /s /q " %SRC_DIR% \temp_build" || ver > nul
0 commit comments