Install pytorch for CUDA [compute capability] 3.0 on windows? №2

username: PromiX
cooked: <p>Hi Forum!<br>
I decided to build pytorch on GTX660 graphics card (don’t ask why, I don’t know).<br>
I got the idea from the <a href="https://datagraphi.com/blog/post/2021/9/13/building-pytorch-from-source-on-windows-to-work-with-an-old-gpu" rel="noopener nofollow ugc">article</a>.<br>
What I used:<br>
NVIDIA Driver<br>
474.30-desktop-win10-win11-64bit-international-dch-whql<br>
cuda 10.1<br>
cudnn v8.0.5.39<br>
BuildTools 14.29.30133<br>
magma_2.5.4_cuda101_release<br>
mkl_2020.2.254</p>
<p>I reinstalled the system, put CUDA 10.1, put all the other components, but during the build process an error occurs, first it was received for pytorch 1.8.1, then for 1.8.0<br>
In the process, I had to install the latest version of the pybind11 library</p>
<pre><code class="lang-auto">[4499/4612] Building CXX object caffe2\torch\CMakeFiles\torch_python.dir\csrc\Stream.cpp.obj
FAILED: caffe2/torch/CMakeFiles/torch_python.dir/csrc/Stream.cpp.obj
C:\Users\PromiX\scoop\shims\sccache.exe C:\PROGRA~2\MICROS~3\2019\BUILDT~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILDING_TESTS -DFMT_HEADER_ONLY=1 -DIDEEP_USE_MKL -DMAGMA_V2 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTHP_BUILD_MAIN_LIB -DTH_BLAS_MKL -DUSE_C10D -DUSE_C10D_GLOO -DUSE_CUDA -DUSE_CUDNN -DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DUSE_NUMPY -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_OPENMP_NOFORCE_MANIFEST -Dtorch_python_EXPORTS -ID:\pytorch\build\aten\src -ID:\pytorch\aten\src -ID:\pytorch\build -ID:\pytorch -ID:\pytorch\cmake\..\third_party\benchmark\include -ID:\pytorch\build\caffe2\contrib\aten -ID:\pytorch\third_party\onnx -ID:\pytorch\build\third_party\onnx -ID:\pytorch\third_party\foxi -ID:\pytorch\build\third_party\foxi -ID:\pytorch\torch\.. -ID:\pytorch\torch\..\aten\src -ID:\pytorch\torch\..\aten\src\TH -ID:\pytorch\build\caffe2\aten\src -ID:\pytorch\build\third_party -ID:\pytorch\torch\..\third_party\valgrind-headers -ID:\pytorch\torch\..\third_party\gloo -ID:\pytorch\torch\..\third_party\onnx -ID:\pytorch\torch\csrc -ID:\pytorch\torch\csrc\api\include -ID:\pytorch\torch\lib -ID:\pytorch\torch\lib\libshm_windows -ID:\pytorch\torch\csrc\api -ID:\pytorch\c10\.. -ID:\pytorch\build\third_party\ideep\mkl-dnn\include -ID:\pytorch\third_party\ideep\mkl-dnn\src\..\include -ID:\pytorch\c10\cuda\..\.. -ID:\pytorch\third_party\fmt\include -ID:\pytorch\torch\lib\c10d\.. -external:ID:\pytorch\build\third_party\gloo -external:ID:\pytorch\cmake\..\third_party\gloo -external:ID:\pytorch\cmake\..\third_party\googletest\googlemock\include -external:ID:\pytorch\cmake\..\third_party\googletest\googletest\include -external:ID:\pytorch\third_party\protobuf\src -external:I"D:\Pytorch requirements\mkl\include" -external:ID:\pytorch\third_party\XNNPACK\include -external:ID:\pytorch\third_party -external:ID:\pytorch\cmake\..\third_party\eigen -external:ID:\condaEnv\include -external:ID:\condaEnv\Lib\site-packages\numpy\core\include -external:ID:\pytorch\cmake\..\third_party\pybind11\include -external:ID:\pytorch\cmake\..\third_party\cub -external:I"D:\Pytorch requirements\magma\include" -external:I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -external:ID:\pytorch\third_party\ideep\mkl-dnn\include -external:ID:\pytorch\third_party\ideep\include -external:I"C:\Program Files\NVIDIA Corporation\NvToolsExt\include" -external:W0 /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -DNDEBUG -DUSE_FBGEMM -DUSE_XNNPACK -DHAVE_AVX_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION /MD /O2 /Ob2 /DNDEBUG /w /bigobj -DNDEBUG -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DUSE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD /EHsc /DNOMINMAX /wd4267 /wd4251 /wd4522 /wd4838 /wd4305 /wd4244 /wd4190 /wd4101 /wd4996 /wd4275 /bigobj -std:c++14 /showIncludes /Focaffe2\torch\CMakeFiles\torch_python.dir\csrc\Stream.cpp.obj /Fdcaffe2\torch\CMakeFiles\torch_python.dir\ /FS -c D:\pytorch\torch\csrc\Stream.cpp
D:\pytorch\torch\csrc\Stream.cpp(108): error C2106: =: left operand must be a left-handed value

ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "D:\pytorch\setup.py", line 818, in &lt;module&gt;
    build_deps()
  File "D:\pytorch\setup.py", line 315, in build_deps
    build_caffe2(version=version,
  File "D:\pytorch\tools\build_pytorch_libs.py", line 58, in build_caffe2
    cmake.build(my_env)
  File "D:\pytorch\tools\setup_helpers\cmake.py", line 345, in build
    self.run(build_args, my_env)
  File "D:\pytorch\tools\setup_helpers\cmake.py", line 140, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "D:\condaEnv\Lib\subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '1']' returned non-zero exit status 1.
</code></pre>
<p>FULL <a href="https://file.io/MTJBiQgJyoNt" rel="noopener nofollow ugc">log</a></p>

username: PromiX
cooked: <p>The search led me to this great man, it solved my problem and I had no more problems until the end of the build.<br>
<a href="https://github.com/pytorch/pytorch/commit/88a1b57c2464e582933a64e9026f73bfea3caf1c" rel="noopener nofollow ugc">Support python 3.11 changes. · pytorch/pytorch@88a1b57 · GitHub</a></p>