Skip to content

Commit 3f94b5d

Browse files
peterjc123Rob Kunkle
authored and
Rob Kunkle
committed
Fix the logic for PATH guess on Windows
Summary: Pull Request resolved: pytorch#10372 Differential Revision: D9240207 Pulled By: soumith fbshipit-source-id: 0933f6fde19536c7da7d45044efbdcfe8ea40e1f
1 parent f567866 commit 3f94b5d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

torch/utils/cpp_extension.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ def _find_cuda_home():
2323
if cuda_home is None:
2424
# Guess #2
2525
if sys.platform == 'win32':
26-
cuda_home = glob.glob(
26+
cuda_homes = glob.glob(
2727
'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v*.*')
28+
if len(cuda_homes) == 0:
29+
cuda_home = ''
30+
else:
31+
cuda_home = cuda_homes[0]
2832
else:
2933
cuda_home = '/usr/local/cuda'
3034
if not os.path.exists(cuda_home):

0 commit comments

Comments
 (0)