提交 eec8002e authored 作者: Frederic's avatar Frederic

correctly disable the cuda back-end when cuda_ndarray.so is there but not nvcc.

上级 46a7640c
...@@ -127,7 +127,14 @@ compile_cuda_ndarray = True ...@@ -127,7 +127,14 @@ compile_cuda_ndarray = True
if not compile_cuda_ndarray: if not compile_cuda_ndarray:
compile_cuda_ndarray = not try_import() compile_cuda_ndarray = not try_import()
if compile_cuda_ndarray: if not nvcc_compiler.is_nvcc_available():
# It can happen that there the file cuda_ndarray.so is already compiled
# but nvcc is not available. In that case we need to disable the CUDA
# back-end as we won't be able to compile any new op and we can't only
# use already compiled GPU op and not the others.
set_cuda_disabled()
if compile_cuda_ndarray and cuda_available:
get_lock() get_lock()
try: try:
# Retry to load again in case someone else compiled it # Retry to load again in case someone else compiled it
...@@ -163,12 +170,6 @@ if compile_cuda_ndarray: ...@@ -163,12 +170,6 @@ if compile_cuda_ndarray:
set_cuda_disabled() set_cuda_disabled()
finally: finally:
release_lock() release_lock()
elif not nvcc_compiler.is_nvcc_available():
# This can happen if there is cuda_ndarray.so was already compiled
# and then nvcc is removed. In that case we need to disable the CUDA
# back-end as we won't be able to compile any new op and we can't only
# use already compiled GPU op and not the others.
set_cuda_disabled()
del compile_cuda_ndarray del compile_cuda_ndarray
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论