Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit c9aac65

Browse files
tinglvvatalman
andauthored
CUDA 12.6.2 windows build (#2023)
* cuda 126 windows build and driver update * refactor code * unblock the pipeline * correct syntax * test overwrite:true Co-authored-by: Andrey Talman <[email protected]> --------- Co-authored-by: Andrey Talman <[email protected]>
1 parent a1b372d commit c9aac65

File tree

7 files changed

+99
-14
lines changed

7 files changed

+99
-14
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: windows-2019
1818
strategy:
1919
matrix:
20-
cuda_version: ["124", "121", "118"]
20+
cuda_version: ["126", "124", "118"]
2121
config: ["Release", "Debug"]
2222
env:
2323
CUDA_VERSION: ${{ matrix.cuda_version }}
@@ -32,9 +32,10 @@ jobs:
3232
- name: Build MAGMA and push to S3
3333
run: windows/internal/build_magma.bat
3434
- name: Save as artifact
35-
uses: actions/upload-artifact@v2
35+
uses: actions/upload-artifact@v4
3636
with:
3737
path: magma_*_cuda*_*.7z
38+
overwrite: true
3839
push-windows-magma:
3940
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
4041
environment: magma

conda/pytorch-nightly/bld.bat

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ if "%desired_cuda%" == "11.8" (
2525
set TORCH_CUDA_ARCH_LIST=%TORCH_CUDA_ARCH_LIST%;3.7+PTX
2626
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all --threads 2
2727
)
28-
if "%desired_cuda%" == "12.1" (
29-
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all --threads 2
30-
)
31-
if "%desired_cuda%" == "12.4" (
28+
if "%desired_cuda:~0,3%" == "12." (
3229
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all --threads 2
3330
)
3431

windows/cuda126.bat

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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 ..
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_V124%"=="" (
31+
IF EXIST "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin\nvcc.exe" (
32+
set "CUDA_PATH_V124=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6"
33+
) ELSE (
34+
echo CUDA 12.6 not found, failing
35+
exit /b 1
36+
)
37+
)
38+
39+
IF "%BUILD_VISION%" == "" (
40+
set TORCH_CUDA_ARCH_LIST=5.0;6.0;6.1;7.0;7.5;8.0;8.6;9.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_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -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
44+
)
45+
46+
set "CUDA_PATH=%CUDA_PATH_V126%"
47+
set "PATH=%CUDA_PATH_V126%\bin;%PATH%"
48+
49+
:optcheck
50+
51+
call internal\check_opts.bat
52+
IF ERRORLEVEL 1 goto :eof
53+
54+
call internal\copy.bat
55+
IF ERRORLEVEL 1 goto :eof
56+
57+
call internal\setup.bat
58+
IF ERRORLEVEL 1 goto :eof

windows/internal/build_magma.bat

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ cd magma
3535
mkdir build && cd build
3636

3737
set GPU_TARGET=All
38-
if "%CUVER_NODOT%" == "124" (
39-
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
40-
)
41-
if "%CUVER_NODOT%" == "121" (
38+
if "%CUVER_NODOT:~0,2%" == "12" (
4239
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
4340
)
4441
if "%CUVER_NODOT%" == "118" (

windows/internal/cuda_install.bat

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if exist "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%
2626
if %CUDA_VER% EQU 118 goto cuda118
2727
if %CUDA_VER% EQU 121 goto cuda121
2828
if %CUDA_VER% EQU 124 goto cuda124
29+
if %CUDA_VER% EQU 126 goto cuda126
2930

3031
echo CUDA %CUDA_VERSION_STR% is not supported
3132
exit /b 1
@@ -111,6 +112,33 @@ xcopy /Y "%SRC_DIR%\temp_build\zlib\dll_x64\*.dll" "C:\Windows\System32"
111112

112113
goto cuda_common
113114

115+
:cuda126
116+
117+
set CUDA_INSTALL_EXE=cuda_12.6.2_560.94_windows.exe
118+
if not exist "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" (
119+
curl -k -L "https://ossci-windows.s3.amazonaws.com/%CUDA_INSTALL_EXE%" --output "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%"
120+
if errorlevel 1 exit /b 1
121+
set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%"
122+
set "ARGS=cuda_profiler_api_12.6 thrust_12.6 nvcc_12.6 cuobjdump_12.6 nvprune_12.6 nvprof_12.6 cupti_12.6 cublas_12.6 cublas_dev_12.6 cudart_12.6 cufft_12.6 cufft_dev_12.6 curand_12.6 curand_dev_12.6 cusolver_12.6 cusolver_dev_12.6 cusparse_12.6 cusparse_dev_12.6 npp_12.6 npp_dev_12.6 nvrtc_12.6 nvrtc_dev_12.6 nvml_dev_12.6 nvjitlink_12.6 nvtx_12.6"
123+
)
124+
125+
set CUDNN_FOLDER=cudnn-windows-x86_64-9.5.0.50_cuda12-archive
126+
set CUDNN_LIB_FOLDER="lib"
127+
set "CUDNN_INSTALL_ZIP=%CUDNN_FOLDER%.zip"
128+
if not exist "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" (
129+
curl -k -L "http://s3.amazonaws.com/ossci-windows/%CUDNN_INSTALL_ZIP%" --output "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%"
130+
if errorlevel 1 exit /b 1
131+
set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%"
132+
)
133+
134+
@REM cuDNN 8.3+ required zlib to be installed on the path
135+
echo Installing ZLIB dlls
136+
curl -k -L "http://s3.amazonaws.com/ossci-windows/zlib123dllx64.zip" --output "%SRC_DIR%\temp_build\zlib123dllx64.zip"
137+
7z x "%SRC_DIR%\temp_build\zlib123dllx64.zip" -o"%SRC_DIR%\temp_build\zlib"
138+
xcopy /Y "%SRC_DIR%\temp_build\zlib\dll_x64\*.dll" "C:\Windows\System32"
139+
140+
goto cuda_common
141+
114142
:cuda_common
115143
:: NOTE: We only install CUDA if we don't have it installed already.
116144
:: With GHA runners these should be pre-installed as part of our AMI process

windows/internal/driver_update.bat

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
set "DRIVER_DOWNLOAD_LINK=https://ossci-windows.s3.amazonaws.com/528.89-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe"
2-
curl --retry 3 -kL %DRIVER_DOWNLOAD_LINK% --output 528.89-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe
1+
set WIN_DRIVER_VN=528.89
2+
set "DRIVER_DOWNLOAD_LINK=https://ossci-windows.s3.amazonaws.com/%WIN_DRIVER_VN%-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe"
3+
curl --retry 3 -kL %DRIVER_DOWNLOAD_LINK% --output %WIN_DRIVER_VN%-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe
34
if errorlevel 1 exit /b 1
45

5-
start /wait 528.89-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe -s -noreboot
6+
start /wait %WIN_DRIVER_VN%-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe -s -noreboot
67
if errorlevel 1 exit /b 1
78

8-
del 528.89-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe || ver > NUL
9+
del %WIN_DRIVER_VN%-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe || ver > NUL

windows/internal/smoke_test.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ if "%CUDA_VERSION%" == "121" (
9191
if "%CUDA_VERSION%" == "124" (
9292
set "CONDA_EXTRA_ARGS=pytorch-cuda=12.4 -c nvidia -c pytorch-nightly"
9393
)
94+
if "%CUDA_VERSION%" == "126" (
95+
set "CONDA_EXTRA_ARGS=pytorch-cuda=12.6 -c nvidia -c pytorch-nightly"
96+
)
9497

9598
rmdir /s /q conda
9699
del miniconda.exe

0 commit comments

Comments
 (0)