Skip to content

Commit 191b23d

Browse files
authored
Add randomtemp to build scripts (#448)
1 parent ef8db5d commit 191b23d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

conda/pytorch-nightly/bld.bat

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@ if "%CUDA_VERSION%" == "80" (
6565
set "CUDAHOSTCXX=%VS140COMNTOOLS%\..\..\VC\bin\amd64\cl.exe"
6666
)
6767

68+
:: randomtemp is used to resolve the intermittent build error related to CUDA.
69+
:: code: https://github.com/peterjc123/randomtemp
70+
:: issue: https://github.com/pytorch/pytorch/issues/25393
71+
::
72+
:: Previously, CMake uses CUDA_NVCC_EXECUTABLE for finding nvcc and then
73+
:: the calls are redirected to sccache. sccache looks for the actual nvcc
74+
:: in PATH, and then pass the arguments to it.
75+
:: Currently, randomtemp is placed before sccache (%TMP_DIR_WIN%\bin\nvcc)
76+
:: so we are actually pretending sccache instead of nvcc itself.
77+
curl -kL https://github.com/peterjc123/randomtemp/releases/download/v0.3/randomtemp.exe --output %SRC_DIR%\tmp_bin\randomtemp.exe
78+
set RANDOMTEMP_EXECUTABLE=%SRC_DIR%\tmp_bin\nvcc.exe
79+
set CUDA_NVCC_EXECUTABLE=%SRC_DIR%\tmp_bin\randomtemp.exe
80+
set RANDOMTEMP_BASEDIR=%SRC_DIR%\tmp_bin
81+
6882
:cuda_end
6983

7084
set CMAKE_GENERATOR=Ninja

windows/build_pytorch.bat

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ if "%USE_SCCACHE%" == "1" (
101101
set CUDA_NVCC_EXECUTABLE=%CD%\tmp_bin\nvcc
102102
set ADDITIONAL_PATH=%CD%\tmp_bin
103103
set SCCACHE_IDLE_TIMEOUT=1500
104+
105+
:: randomtemp is used to resolve the intermittent build error related to CUDA.
106+
:: code: https://github.com/peterjc123/randomtemp
107+
:: issue: https://github.com/pytorch/pytorch/issues/25393
108+
::
109+
:: Previously, CMake uses CUDA_NVCC_EXECUTABLE for finding nvcc and then
110+
:: the calls are redirected to sccache. sccache looks for the actual nvcc
111+
:: in PATH, and then pass the arguments to it.
112+
:: Currently, randomtemp is placed before sccache (%TMP_DIR_WIN%\bin\nvcc)
113+
:: so we are actually pretending sccache instead of nvcc itself.
114+
curl -kL https://github.com/peterjc123/randomtemp/releases/download/v0.3/randomtemp.exe --output %CD%\tmp_bin\randomtemp.exe
115+
set RANDOMTEMP_EXECUTABLE=%CD%\tmp_bin\nvcc.exe
116+
set CUDA_NVCC_EXECUTABLE=%CD%\tmp_bin\randomtemp.exe
117+
set RANDOMTEMP_BASEDIR=%CD%\tmp_bin
104118
)
105119
)
106120

0 commit comments

Comments
 (0)