mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix CUDA 8 build on Windows (#11729)
Summary: Tested via https://github.com/pytorch/pytorch/pull/11374. Upstream PR: https://gitlab.kitware.com/cmake/cmake/merge_requests/2391 Pull Request resolved: https://github.com/pytorch/pytorch/pull/11729 Differential Revision: D9847807 Pulled By: orionr fbshipit-source-id: 69af3e6c5bba0abcbc8830495e867a0b1b399c22
This commit is contained in:
committed by
Facebook Github Bot
parent
ca6f08f359
commit
10c29c8970
@ -201,9 +201,8 @@ set DISTUTILS_USE_SDK=1
|
||||
REM The following two lines are needed for Python 2.7, but the support for it is very experimental.
|
||||
set MSSdk=1
|
||||
set FORCE_PY27_BUILD=1
|
||||
REM As for CUDA 8, VS2015 Update 3 is also required to build PyTorch. Use the following two lines.
|
||||
set "PREBUILD_COMMAND=%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||
set PREBUILD_COMMAND_ARGS=x64
|
||||
REM As for CUDA 8, VS2015 Update 3 is also required to build PyTorch. Use the following line.
|
||||
set "CUDA_HOST_COMPILER=%VS140COMNTOOLS%\..\..\VC\bin\amd64\cl.exe"
|
||||
|
||||
call "%VS150COMNTOOLS%\vcvarsall.bat" x64 -vcvars_ver=14.11
|
||||
python setup.py install
|
||||
|
||||
@ -531,7 +531,9 @@ option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON)
|
||||
# Extra user settable flags
|
||||
cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.")
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
if(DEFINED ENV{CUDA_HOST_COMPILER})
|
||||
set(CUDA_HOST_COMPILER "$ENV{CUDA_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC")
|
||||
elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)")
|
||||
if(MSVC_VERSION LESS 1910)
|
||||
set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin")
|
||||
|
||||
Reference in New Issue
Block a user