|
| 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.4\bin\nvcc.exe" ( |
| 32 | + set "CUDA_PATH_V124=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" |
| 33 | + ) ELSE ( |
| 34 | + echo CUDA 12.4 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_V124%" |
| 47 | +set "PATH=%CUDA_PATH_V124%\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 |
0 commit comments