Skip to content

Commit 1c8a089

Browse files
committed
fix windows
1 parent feb2a13 commit 1c8a089

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

script/cuda.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ else
6464
export FORCE_CUDA=1
6565
fi
6666

67+
if [ "${IDX}" == "cu100" ] || [ "${IDX}" == "cu101" ]; then
68+
export NVCC_FLAGS="-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50"
69+
fi
70+
71+
if [ "${IDX}" == "cu92" ]; then
72+
export NVCC_FLAGS="-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_50,code=compute_50"
73+
fi
74+
6775
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${IDX}" != "cpu" ]; then
6876
INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb
6977
wget -nv "http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER}"
@@ -82,10 +90,15 @@ fi
8290
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
8391
wget -nv "${CUDA_URL}/${CUDA_FILE}"
8492
PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT}\" -Wait -NoNewWindow"
85-
ls /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Tools/MSVC
8693
CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v${CUDA_SHORT}
8794
PATH=${CUDA_HOME}/bin:$PATH
8895
PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH
8996
nvcc --version
90-
cat -n /c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v${CUDA_SHORT}/include/crt/host_config.h
97+
fi
98+
99+
# Fix Cuda9.2 on Windows: https://github.com/pytorch/pytorch/issues/6109
100+
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" = "cu92" ]; then
101+
cat -n "${CUDA_PATH}/include/crt/host_config.h"
102+
sed -i.bak -e '129,141d' "${CUDA_PATH}/include/crt/host_config.h"
103+
cat -n "${CUDA_PATH}/include/crt/host_config.h"
91104
fi

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_extensions():
2626
define_macros += [('WITH_CUDA', None)]
2727
nvcc_flags = os.getenv('NVCC_FLAGS', '')
2828
nvcc_flags = [] if nvcc_flags == '' else nvcc_flags.split(' ')
29-
nvcc_flags += ['-arch=sm_35', '--expt-relaxed-constexpr']
29+
nvcc_flags += ['--expt-relaxed-constexpr']
3030
extra_compile_args['nvcc'] = nvcc_flags
3131

3232
extensions_dir = osp.join(osp.dirname(osp.abspath(__file__)), 'csrc')

0 commit comments

Comments
 (0)