Skip to content

Commit cea2213

Browse files
authored
Adding windows cuda 11.6 changes (#999)
1 parent e1876ec commit cea2213

File tree

6 files changed

+95
-14
lines changed

6 files changed

+95
-14
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: windows-2019
1616
strategy:
1717
matrix:
18-
cuda_version: ["115"]
18+
cuda_version: ["116", "115"]
1919
config: ["Release", "Debug"]
2020
env:
2121
CUDA_VERSION: ${{ matrix.cuda_version }}

conda/pytorch-nightly/bld.bat

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ if "%desired_cuda%" == "11.5" (
3030
set TORCH_CUDA_ARCH_LIST=%TORCH_CUDA_ARCH_LIST%;6.0;6.1;7.0;7.5;8.0;8.6
3131
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all --threads 2
3232
)
33+
if "%desired_cuda%" == "11.6" (
34+
set TORCH_CUDA_ARCH_LIST=%TORCH_CUDA_ARCH_LIST%;6.0;6.1;7.0;7.5;8.0;8.6
35+
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all --threads 2
36+
)
3337

3438
:cuda_flags_end
3539

windows/cuda116.bat

+58
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_V116%"=="" (
31+
IF EXIST "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe" (
32+
set "CUDA_PATH_V115=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6"
33+
) ELSE (
34+
echo CUDA 11.6 not found, failing
35+
exit /b 1
36+
)
37+
)
38+
39+
IF "%BUILD_VISION%" == "" (
40+
set TORCH_CUDA_ARCH_LIST=3.7+PTX;5.0;6.0;6.1;7.0;7.5;8.0;8.6
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_35,code=sm_35 -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
44+
)
45+
46+
set "CUDA_PATH=%CUDA_PATH_V116%"
47+
set "PATH=%CUDA_PATH_V116%\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

+1-12
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,7 @@ mkdir build && cd build
3636

3737
set GPU_TARGET=All
3838
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
39-
40-
IF "%CUVER_NODOT%" == "110" (
41-
set "CUDA_ARCH_LIST=%CUDA_ARCH_LIST% -gencode arch=compute_80,code=sm_80"
42-
)
43-
44-
IF "%CUVER_NODOT%" == "113" (
45-
set "CUDA_ARCH_LIST=%CUDA_ARCH_LIST% -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86"
46-
)
47-
48-
IF "%CUVER_NODOT%" == "115" (
49-
set "CUDA_ARCH_LIST=%CUDA_ARCH_LIST% -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86"
50-
)
39+
set "CUDA_ARCH_LIST=%CUDA_ARCH_LIST% -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86"
5140

5241
set CC=cl.exe
5342
set CXX=cl.exe

windows/internal/cuda_install.bat

+28
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if exist "C:\\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR
2222
if %CUDA_VER% EQU 102 goto cuda102
2323
if %CUDA_VER% EQU 113 goto cuda113
2424
if %CUDA_VER% EQU 115 goto cuda115
25+
if %CUDA_VER% EQU 116 goto cuda116
2526

2627
echo CUDA %CUDA_VERSION_STR% is not supported
2728
exit /b 1
@@ -97,6 +98,33 @@ xcopy /Y "%SRC_DIR%\temp_build\zlib\dll_x64\*.dll" "C:\Windows\System32"
9798

9899
goto cuda_common
99100

101+
:cuda116
102+
103+
set CUDA_INSTALL_EXE=cuda_11.6.0_511.23_windows.exe
104+
if not exist "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%" (
105+
curl -k -L "https://ossci-windows.s3.amazonaws.com/%CUDA_INSTALL_EXE%" --output "%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%"
106+
if errorlevel 1 exit /b 1
107+
set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\%CUDA_INSTALL_EXE%"
108+
set "ARGS=thrust_11.6 nvcc_11.6 cuobjdump_11.6 nvprune_11.6 nvprof_11.6 cupti_11.6 cublas_11.6 cublas_dev_11.6 cudart_11.6 cufft_11.6 cufft_dev_11.6 curand_11.6 curand_dev_11.6 cusolver_11.6 cusolver_dev_11.6 cusparse_11.6 cusparse_dev_11.6 npp_11.6 npp_dev_11.6 nvrtc_11.6 nvrtc_dev_11.6 nvml_dev_11.6"
109+
)
110+
111+
set CUDNN_FOLDER=cudnn-windows-x86_64-8.3.2.44_cuda11.5-archive
112+
set CUDNN_LIB_FOLDER="lib"
113+
set "CUDNN_INSTALL_ZIP=%CUDNN_FOLDER%.zip"
114+
if not exist "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%" (
115+
curl -k -L "http://s3.amazonaws.com/ossci-windows/%CUDNN_INSTALL_ZIP%" --output "%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%"
116+
if errorlevel 1 exit /b 1
117+
set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\%CUDNN_INSTALL_ZIP%"
118+
)
119+
120+
@REM Cuda 8.3+ required zlib to be installed on the path
121+
echo Installing ZLIB dlls
122+
curl -k -L "http://s3.amazonaws.com/ossci-windows/zlib123dllx64.zip" --output "%SRC_DIR%\temp_build\zlib123dllx64.zip"
123+
7z x "%SRC_DIR%\temp_build\zlib123dllx64.zip" -o"%SRC_DIR%\temp_build\zlib"
124+
xcopy /Y "%SRC_DIR%\temp_build\zlib\dll_x64\*.dll" "C:\Windows\System32"
125+
126+
goto cuda_common
127+
100128
:cuda_common
101129
:: NOTE: We only install CUDA if we don't have it installed already.
102130
:: With GHA runners these should be pre-installed as part of our AMI process

windows/internal/smoke_test.bat

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ set "CONDA_EXTRA_ARGS="
7272
if "%CUDA_VERSION%" == "115" (
7373
set "CONDA_EXTRA_ARGS=-c=nvidia"
7474
)
75-
75+
if "%CUDA_VERSION%" == "116" (
76+
set "CONDA_EXTRA_ARGS=-c=nvidia"
77+
)
7678

7779
rmdir /s /q conda
7880
del miniconda.exe

0 commit comments

Comments
 (0)