Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
apex
Commits
5dfa4c37
Commit
5dfa4c37
authored
May 02, 2018
by
Michael Carilli
Browse files
Editing setup.py to locate nvcc and detect cuda major version more strictly
parent
b0d7d60d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
setup.py
setup.py
+10
-3
No files found.
setup.py
View file @
5dfa4c37
...
@@ -71,11 +71,18 @@ def findcuda():
...
@@ -71,11 +71,18 @@ def findcuda():
raise
RuntimeError
(
"Error: Could not find cuda on this system."
+
raise
RuntimeError
(
"Error: Could not find cuda on this system."
+
" Please set your CUDA_HOME enviornment variable to the CUDA base directory."
)
" Please set your CUDA_HOME enviornment variable to the CUDA base directory."
)
NVCC
=
find
(
CUDA_HOME
,
re
.
compile
(
'nvcc'
).
search
)
NVCC
=
find
(
CUDA_HOME
+
os
.
sep
+
"bin"
,
CUDA_LIB
=
find
(
CUDA_HOME
,
re
.
compile
(
'libcudart.so.*.*.*'
).
search
)
re
.
compile
(
'nvcc$'
).
search
)
print
(
"Found NVCC = "
,
NVCC
)
# Parse output of nvcc to get cuda major version
nvcc_output
=
subprocess
.
check_output
([
NVCC
,
'--version'
]).
decode
(
"utf-8"
)
CUDA_LIB
=
re
.
compile
(
', V[0-9]+\.[0-9]+\.[0-9]+'
).
search
(
nvcc_output
).
group
(
0
).
split
(
'V'
)[
1
]
print
(
"Found CUDA_LIB = "
,
CUDA_LIB
)
if
CUDA_LIB
:
if
CUDA_LIB
:
try
:
try
:
CUDA_VERSION
=
int
(
CUDA_LIB
.
split
(
'.'
)[
2
])
CUDA_VERSION
=
int
(
CUDA_LIB
.
split
(
'.'
)[
0
])
except
(
ValueError
,
TypeError
):
except
(
ValueError
,
TypeError
):
CUDA_VERSION
=
9
CUDA_VERSION
=
9
else
:
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment