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

Hi,

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.
my input was the following:

conda create --name torchbase
activate torchbase
cd C:\Users\gooog\Downloads\Pytorch
conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing
git clone --recursive GitHub - pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration
git clone --branch v1.7.0 GitHub - pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration pytorch-1.7.0
cd pytorch-1.7.0
git submodule sync
set CUDA_PREFIX=cuda101
set CONFIG=release
curl -k https://s3.amazonaws.com/ossci-windows/magma_2.5.4_%CUDA_PREFIX%_%CONFIG%.7z -o magma.7z
7z x -aoa magma.7z -omagma
cmd
set CMAKE_GENERATOR=Visual Studio 16 2019
set DISTUTILS_USE_SDK=1
for /f “usebackq tokens=*” %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath) do call “%i\VC\Auxiliary\Build\vcvarsall.bat” x64 -vcvars_ver=%CMAKE_GENERATOR_TOOLSET_VERSION%
set CUDAHOSTCXX=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.exe
git submodule update --init --recursive
set “CMAKE_INCLUDE_PATH=%cd%\mkl\include”
set “LIB=%cd%\mkl\lib;%LIB%”
set “MAGMA_HOME=%cd%\magma”
set USE_NINJA=OFF
python setup.py install

It starts to compile for 1-2 hours, and then ends with:

Building Custom Rule C:/Users/gooog/Downloads/Pytorch/pytorch-1.7.0/caffe2/CMakeLists.txt
Traceback (most recent call last):
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\setup.py”, line 717, in
build_deps()
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\setup.py”, line 308, in build_deps
build_caffe2(version=version,
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\tools\build_pytorch_libs.py”, line 62, in build_caffe2
cmake.build(my_env)
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\tools\setup_helpers\cmake.py”, line 345, in build
self.run(build_args, my_env)
File “C:\Users\gooog\Downloads\Pytorch\pytorch-1.7.0\tools\setup_helpers\cmake.py”, line 141, in run
check_call(command, cwd=self.build_dir, env=env)
File “C:\Users\gooog\anaconda3\envs\torchbase\lib\subprocess.py”, line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘–target’, ‘install’, ‘–config’, ‘Release’, ‘–’, ‘/p:CL_MPCount=4’]’ returned non-zero exit status 1.

edit:
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.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\yvals_core.h(524): f
atal error C1189: #error: STL1001: Unexpected compiler version, expected MSVC 19.28 or newer. [C:\Users\gooog\Downl
oads\Pytorch\pytorch-1.7.0\build\third_party\gloo\gloo\gloo_cuda.vcxproj]