Delete CUDA build rules from MacOS build (#47277)

Summary:
Also remove MAX_JOBS constraint, since OOM warning was about nvcc rather than clang

Pull Request resolved: https://github.com/pytorch/pytorch/pull/47277

Reviewed By: walterddr

Differential Revision: D24705180

Pulled By: malfet

fbshipit-source-id: 25fd0161de3f7e14a2a4db86cbea8357cdc69e06
This commit is contained in:
Nikita Shulga
2020-11-03 08:57:10 -08:00
committed by Facebook GitHub Bot
parent c05ee86edd
commit 5c8896f8ad

View File

@ -8,23 +8,8 @@ git submodule update --init --recursive
export CMAKE_PREFIX_PATH=${WORKSPACE_DIR}/miniconda3/
# Build PyTorch
if [[ "${BUILD_ENVIRONMENT}" == *cuda9.2* ]]; then
export CUDA_VERSION=9.2
export TORCH_CUDA_ARCH_LIST=5.2
export PATH=/Developer/NVIDIA/CUDA-${CUDA_VERSION}/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-${CUDA_VERSION}/lib${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
export CUDA_HOME=/Developer/NVIDIA/CUDA-${CUDA_VERSION}
export USE_CUDA=1
if [ -z "${IN_CI}" ]; then
# Eigen gives "explicit specialization of class must precede its first use" error
# when compiling with Xcode 9.1 toolchain, so we have to use Xcode 8.2 toolchain instead.
export DEVELOPER_DIR=/Library/Developer/CommandLineTools
fi
else
if [ -z "${IN_CI}" ]; then
export DEVELOPER_DIR=/Applications/Xcode9.app/Contents/Developer
fi
if [ -z "${IN_CI}" ]; then
export DEVELOPER_DIR=/Applications/Xcode9.app/Contents/Developer
fi
if which sccache > /dev/null; then
@ -34,17 +19,10 @@ if which sccache > /dev/null; then
printf "#!/bin/sh\nexec sccache $(which clang) \$*" > "${WORKSPACE_DIR}/clang"
chmod a+x "${WORKSPACE_DIR}/clang"
if [[ "${BUILD_ENVIRONMENT}" == *cuda* ]]; then
printf "#!/bin/sh\nexec sccache $(which nvcc) \$*" > "${WORKSPACE_DIR}/nvcc"
chmod a+x "${WORKSPACE_DIR}/nvcc"
export CUDA_NVCC_EXECUTABLE="${WORKSPACE_DIR}/nvcc"
fi
export PATH="${WORKSPACE_DIR}:$PATH"
fi
# If we run too many parallel jobs, we will OOM
MAX_JOBS=2 USE_DISTRIBUTED=1 python setup.py install
USE_DISTRIBUTED=1 python setup.py install
assert_git_not_dirty