Skip to content

Commit 0d3d84d

Browse files
atalmanpytorchmergebot
authored andcommitted
[CD] Windows Magma build 12.9 and cuda scripts (#155799)
Scripts needed to build Magma and CUDA on windows Same as #146653 Pull Request resolved: #155799 Approved by: https://github.com/jeanschmidt
1 parent 430cc1c commit 0d3d84d

File tree

4 files changed

+91
-5
lines changed

4 files changed

+91
-5
lines changed

.ci/pytorch/windows/cuda129.bat

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
@echo off
2+
3+
set MODULE_NAME=pytorch
4+
5+
IF NOT EXIST "setup.py" IF NOT EXIST "%MODULE_NAME%" (
6+
call internal\clone.bat
7+
cd %~dp0
8+
) ELSE (
9+
call internal\clean.bat
10+
)
11+
IF ERRORLEVEL 1 goto :eof
12+
13+
call internal\check_deps.bat
14+
IF ERRORLEVEL 1 goto :eof
15+
16+
REM Check for optional components
17+
18+
set USE_CUDA=
19+
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
20+
21+
IF "%NVTOOLSEXT_PATH%"=="" (
22+
IF EXIST "C:\Program Files\NVIDIA Corporation\NvToolsExt\lib\x64\nvToolsExt64_1.lib" (
23+
set NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt
24+
) ELSE (
25+
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, failing
26+
exit /b 1
27+
)
28+
)
29+
30+
IF "%CUDA_PATH_V129%"=="" (
31+
IF EXIST "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9\bin\nvcc.exe" (
32+
set "CUDA_PATH_V128=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9"
33+
) ELSE (
34+
echo CUDA 12.9 not found, failing
35+
exit /b 1
36+
)
37+
)
38+
39+
IF "%BUILD_VISION%" == "" (
40+
set TORCH_CUDA_ARCH_LIST=7.5;8.0;8.6;9.0;10.0;12.0
41+
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all
42+
) ELSE (
43+
set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=compute_80 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_90,code=compute_90 -gencode=arch=compute_100,code=compute_100 -gencode=arch=compute_120,code=compute_120
44+
)
45+
46+
set "CUDA_PATH=%CUDA_PATH_V129%"
47+
set "PATH=%CUDA_PATH_V129%\bin;%PATH%"
48+
49+
:optcheck
50+
51+
call internal\check_opts.bat
52+
IF ERRORLEVEL 1 goto :eof
53+
54+
if exist "%NIGHTLIES_PYTORCH_ROOT%" cd %NIGHTLIES_PYTORCH_ROOT%\..
55+
call %~dp0\internal\copy.bat
56+
IF ERRORLEVEL 1 goto :eof
57+
58+
call %~dp0\internal\setup.bat
59+
IF ERRORLEVEL 1 goto :eof

.ci/pytorch/windows/internal/cuda_install.bat

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ set CUDNN_LIB_FOLDER="lib\x64"
2323
:: Skip all of this if we already have cuda installed
2424
if exist "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\bin\nvcc.exe" goto set_cuda_env_vars
2525

26-
if %CUDA_VER% EQU 124 goto cuda124
2726
if %CUDA_VER% EQU 126 goto cuda126
2827
if %CUDA_VER% EQU 128 goto cuda128
28+
if %CUDA_VER% EQU 129 goto cuda129
2929

3030
echo CUDA %CUDA_VERSION_STR% is not supported
3131
exit /b 1
@@ -86,6 +86,33 @@ xcopy /Y "%SRC_DIR%\temp_build\zlib\dll_x64\*.dll" "C:\Windows\System32"
8686

8787
goto cuda_common
8888

89+
:cuda129
90+
91+
set CUDA_INSTALL_EXE=cuda_12.9.1_576.57_windows.exe
92+
if not exist "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" (
93+
curl -k -L "https://ossci-windows.s3.amazonaws.com/%CUDA_INSTALL_EXE%" --output "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" & REM @lint-ignore
94+
if errorlevel 1 exit /b 1
95+
set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%"
96+
set "ARGS=cuda_profiler_api_12.9 thrust_12.9 nvcc_12.9 cuobjdump_12.9 nvprune_12.9 nvprof_12.9 cupti_12.9 cublas_12.9 cublas_dev_12.9 cudart_12.9 cufft_12.9 cufft_dev_12.9 curand_12.9 curand_dev_12.9 cusolver_12.9 cusolver_dev_12.9 cusparse_12.9 cusparse_dev_12.9 npp_12.9 npp_dev_12.9 nvrtc_12.9 nvrtc_dev_12.9 nvml_dev_12.9 nvjitlink_12.9 nvtx_12.9"
97+
)
98+
99+
set CUDNN_FOLDER=cudnn-windows-x86_64-9.10.2.21_cuda12-archive
100+
set CUDNN_LIB_FOLDER="lib"
101+
set "CUDNN_INSTALL_ZIP=%CUDNN_FOLDER%.zip"
102+
if not exist "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" (
103+
curl -k -L "http://s3.amazonaws.com/ossci-windows/%CUDNN_INSTALL_ZIP%" --output "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" & REM @lint-ignore
104+
if errorlevel 1 exit /b 1
105+
set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%"
106+
)
107+
108+
@REM cuDNN 8.3+ required zlib to be installed on the path
109+
echo Installing ZLIB dlls
110+
curl -k -L "http://s3.amazonaws.com/ossci-windows/zlib123dllx64.zip" --output "%SRC_DIR%\temp_build\zlib123dllx64.zip"
111+
7z x "%SRC_DIR%\temp_build\zlib123dllx64.zip" -o"%SRC_DIR%\temp_build\zlib"
112+
xcopy /Y "%SRC_DIR%\temp_build\zlib\dll_x64\*.dll" "C:\Windows\System32"
113+
114+
goto cuda_common
115+
89116
:cuda_common
90117
:: NOTE: We only install CUDA if we don't have it installed already.
91118
:: With GHA runners these should be pre-installed as part of our AMI process

.github/scripts/windows/build_magma.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ cd magma
3535
mkdir build && cd build
3636

3737
set GPU_TARGET=All
38+
if "%CUVER_NODOT%" == "129" (
39+
set CUDA_ARCH_LIST=-gencode=arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_100,code=sm_100 -gencode arch=compute_120,code=sm_120
40+
)
3841
if "%CUVER_NODOT%" == "128" (
3942
set CUDA_ARCH_LIST=-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_100,code=sm_100 -gencode arch=compute_120,code=sm_120
4043
)
4144
if "%CUVER_NODOT:~0,2%" == "12" if NOT "%CUVER_NODOT%" == "128" (
4245
set CUDA_ARCH_LIST=-gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90
4346
)
44-
if "%CUVER_NODOT%" == "118" (
45-
set CUDA_ARCH_LIST= -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90
46-
)
4747

4848
set CC=cl.exe
4949
set CXX=cl.exe

.github/workflows/build-magma-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: windows-2022
2323
strategy:
2424
matrix:
25-
cuda_version: ["128", "126"]
25+
cuda_version: ["129", "128", "126"]
2626
config: ["Release", "Debug"]
2727
env:
2828
CUDA_VERSION: ${{ matrix.cuda_version }}

0 commit comments

Comments
 (0)