Hello, I’m trying to build PyTorch from source on Windows, since my video card has Compute Capability 3.0. I have installed all the prerequisites and I have tried the procedure outlined here 8, but it failed. I came across this thread and attempted the same steps but I’m still unable to install PyTorch. Here is the error:
Microsoft Windows [versão 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Todos os direitos reservados.

C:\Users\César>cd ..

C:\Users> cd ..

C:\>cd pytorch

C:\pytorch>set CMAKE_GENERATOR=Ninja

C:\pytorch>set CC=cl.exe

C:\pytorch>set CXX=cl.exe

C:\pytorch>set CUDAHOSTCXX=

C:\pytorch>set DISTUTILS_USE_SDK=1

C:\pytorch>for /f "usebackq tokens=*" %i in (`"%ProgramFiles(x86)%\Microsoft Vis
ual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -proper
ty installationPath`) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_
ver=14.11

C:\pytorch>call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\
VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\pytorch>python setup.py build --cmake
Building wheel torch-1.6.0a0+5e0a24f
-- Building version 1.6.0a0+5e0a24f
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -
DCMAKE_GENERATOR=Ninja -DCMAKE_INSTALL_PREFIX=C:\pytorch\torch -DCMAKE_PREFIX_PA
TH=C:\ProgramData\Miniconda3\Lib\site-packages -DJAVA_HOME=C:\Program Files\Java
\jdk1.8.0_181 -DNUMPY_INCLUDE_DIR=C:\ProgramData\Miniconda3\lib\site-packages\nu
mpy\core\include -DPYTHON_EXECUTABLE=C:\ProgramData\Miniconda3\python.exe -DPYTH
ON_INCLUDE_DIR=C:\ProgramData\Miniconda3\include -DPYTHON_LIBRARY=C:\ProgramData
\Miniconda3/libs/python37.lib -DTORCH_BUILD_VERSION=1.6.0a0+5e0a24f -DUSE_NUMPY=
True C:\pytorch
-- The CXX compiler identification is MSVC 19.11.25548.2
-- The C compiler identification is MSVC 19.11.25548.2
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o/2017/BuildTools/VC/Tools/MSVC/14.11.25503/bin/HostX64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o/2017/BuildTools/VC/Tools/MSVC/14.11.25503/bin/HostX64/x64/cl.exe - broken
CMake Error at C:/ProgramData/Miniconda3/Library/share/cmake-3.17/Modules/CMakeT
estCXXCompiler.cmake:53 (message):
  The C++ compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSV
C/14.11.25503/bin/HostX64/x64/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/pytorch/build/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/ProgramData/Miniconda3/Library/bin/ninja.exe cmTC_f0
8a4 && [1/2] Building CXX object CMakeFiles\cmTC_f08a4.dir\testCXXCompiler.cxx.o
bj
    FAILED: CMakeFiles/cmTC_f08a4.dir/testCXXCompiler.cxx.obj
    C:\PROGRA~2\MIB055~1\2017\BUILDT~1\VC\Tools\MSVC\1411~1.255\bin\HostX64\x64\
cl.exe  /nologo /TP   "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\
include"  /DWIN32 /D_WINDOWS /GR /EHsc  /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /F
oCMakeFiles\cmTC_f08a4.dir\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_f08a4.dir\
 /FS -c testCXXCompiler.cxx
    include
    c1xx: fatal error C1083: Não é possível abrir arquivo fonte: 'C:\Program Fil
es\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include': No such file or directory
    Gerando Código...
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:23 (project)


-- Configuring incomplete, errors occurred!
See also "C:/pytorch/build/CMakeFiles/CMakeOutput.log".
See also "C:/pytorch/build/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "setup.py", line 740, in <module>
    build_deps()
  File "setup.py", line 323, in build_deps
    cmake=cmake)
  File "C:\pytorch\tools\build_pytorch_libs.py", line 59, in build_caffe2
    rerun_cmake)
  File "C:\pytorch\tools\setup_helpers\cmake.py", line 324, in generate
    self.run(args, env=my_env)
  File "C:\pytorch\tools\setup_helpers\cmake.py", line 141, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "C:\ProgramData\Miniconda3\lib\subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '-GNinja', '-DBUILD_PYTHON=Tru
e', '-DBUILD_TEST=True', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_GENERATOR=Ninja'
, '-DCMAKE_INSTALL_PREFIX=C:\\pytorch\\torch', '-DCMAKE_PREFIX_PATH=C:\\ProgramD
ata\\Miniconda3\\Lib\\site-packages', '-DJAVA_HOME=C:\\Program Files\\Java\\jdk1
.8.0_181', '-DNUMPY_INCLUDE_DIR=C:\\ProgramData\\Miniconda3\\lib\\site-packages\
\numpy\\core\\include', '-DPYTHON_EXECUTABLE=C:\\ProgramData\\Miniconda3\\python
.exe', '-DPYTHON_INCLUDE_DIR=C:\\ProgramData\\Miniconda3\\include', '-DPYTHON_LI
BRARY=C:\\ProgramData\\Miniconda3/libs/python37.lib', '-DTORCH_BUILD_VERSION=1.6
.0a0+5e0a24f', '-DUSE_NUMPY=True', 'C:\\pytorch']' returned non-zero exit status
 1.

C:\pytorch>

I am pretty sure everything is correctly installed. The folder “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” exists. I have tried reinstalling the CUDA drivers with all the extensions twice and it still does not work.