#error: STL1001: Unexpected compiler version, expected MSVC 19.28 or newer

username: PlsHelp
cooked: <p>Hi,</p>
<p>as my graphic card is rather old (GeForce 920M, compute capability=3.5), I need to install Pytorch(version 1.7.0) from source. I am using Windows10, CUDA10.1, cuDNN 8.0.5 and Visual Studio 2019 16.9.4. Following the tutorial on Github.<br>
my input was the following:</p>
<blockquote>
<p>conda create --name torchbase<br>
activate torchbase<br>
cd C:\Users\gooog\Downloads\Pytorch<br>
conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing<br>
git clone --recursive <a href="https://github.com/pytorch/pytorch" class="inline-onebox" rel="noopener nofollow ugc">GitHub - pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration</a><br>
git clone --branch v1.7.0 <a href="https://github.com/pytorch/pytorch.git" class="inline-onebox" rel="noopener nofollow ugc">GitHub - pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration</a> pytorch-1.7.0<br>
cd pytorch-1.7.0<br>
git submodule sync<br>
set CUDA_PREFIX=cuda101<br>
set CONFIG=release<br>
curl -k <a href="https://s3.amazonaws.com/ossci-windows/magma_2.5.4_%25CUDA_PREFIX%25_%25CONFIG%25.7z" rel="noopener nofollow ugc">https://s3.amazonaws.com/ossci-windows/magma_2.5.4_%CUDA_PREFIX%_%CONFIG%.7z</a> -o magma.7z<br>
7z x -aoa magma.7z -omagma<br>
cmd<br>
set CMAKE_GENERATOR=Visual Studio 16 2019<br>
set DISTUTILS_USE_SDK=1<br>
for /f “usebackq tokens=*” %i in (<code>"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath</code>) do call “%i\VC\Auxiliary\Build\vcvarsall.bat” x64 -vcvars_ver=%CMAKE_GENERATOR_TOOLSET_VERSION%<br>
set CUDAHOSTCXX=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.exe<br>
git submodule update --init --recursive<br>
set “CMAKE_INCLUDE_PATH=%cd%\mkl\include”<br>
set “LIB=%cd%\mkl\lib;%LIB%”<br>
set “MAGMA_HOME=%cd%\magma”<br>
set USE_NINJA=OFF<br>
python setup.py install</p>
</blockquote>
<p>It starts to compile for 1-2 hours, and then ends with:</p>
<p>Building Custom Rule C:/Users/gooog/Downloads/Pytorch/pytorch-1.7.0/caffe2/CMakeLists.txt<br>
Traceback (most recent call last):<br>
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\setup.py”, line 717, in <br>
build_deps()<br>
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\setup.py”, line 308, in build_deps<br>
build_caffe2(version=version,<br>
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\tools\build_pytorch_libs.py”, line 62, in build_caffe2<br>
cmake.build(my_env)<br>
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\tools\setup_helpers\cmake.py”, line 345, in build<br>
self.run(build_args, my_env)<br>
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\tools\setup_helpers\cmake.py”, line 141, in run<br>
check_call(command, cwd=self.build_dir, env=env)<br>
File “C:\Users\gooog\anaconda3\envs\torchbase\lib\subprocess.py”, line 373, in check_call<br>
raise CalledProcessError(retcode, cmd)<br>
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘–target’, ‘install’, ‘–config’, ‘Release’, ‘–’, ‘/p:CL_MPCount=4’]’ returned non-zero exit status 1.</p>
<p>edit:<br>
I think the following error message is my problem, but i don’t understand how to get a compiler version 19.29… Any help would be much appreciated.</p>
<p>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\yvals_core.h(524): f<br>
atal error C1189: <span class="hashtag-raw">#error:</span>  STL1001: Unexpected compiler version, expected MSVC 19.28 or newer. [C:\Users\gooog\Downl<br>
oads\Pytorch\pytorch-1.7.0\build\third_party\gloo\gloo\gloo_cuda.vcxproj]</p>