提交 ad6f88f6 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Added the option to hide warnings about cuda not being found by setting…

Added the option to hide warnings about cuda not being found by setting config.cuda.root to an empty string
上级 126b7b6c
......@@ -252,6 +252,9 @@ import theano and print the config variable, as in:
Default: $CUDA_ROOT or failing that, "/usr/local/cuda"
A directory with bin/, lib/, include/ folders containing cuda utilities.
If set to an empty string (e.g. with ``root=`` in the ``[cuda]`` section
of your .theanorc file), then it will disable warnings about cuda not
being found.
.. attribute:: config.gcc.cxxflags
......
......@@ -48,7 +48,9 @@ def set_cuda_disabled():
"""
global cuda_available, cuda_warning_is_displayed
cuda_available = False
if not cuda_warning_is_displayed:
# Note that we do not display this warning when the user manually unset the
# config.cuda.root configuration variable.
if not cuda_warning_is_displayed and config.cuda.root:
cuda_warning_is_displayed = True
warning('Cuda is disabled, cuda-based code will thus not be '
'working properly')
......@@ -81,8 +83,11 @@ try:
if compile_cuda_ndarray:
import nvcc_compiler
if not nvcc_compiler.is_nvcc_available():
error('nvcc compiler not found on $PATH.'
' Check your nvcc installation and try again')
# Hide the error message if the user manually unset the
# config.cuda.root configuration variable.
if config.cuda.root:
error('nvcc compiler not found on $PATH.'
' Check your nvcc installation and try again.')
set_cuda_disabled()
if cuda_available:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论