提交 b922d88c authored 作者: Frederic Bastien's avatar Frederic Bastien

Warn if cudnn version is too recent. fix gh-3996

上级 9f691454
......@@ -593,9 +593,15 @@ def use(device,
if config.print_active_device:
cnmem_enabled = "enabled" if config.lib.cnmem else "disabled"
cudnn_version = "not available"
warn = None
try:
(hdr_v, runtime_v) = dnn_version()
cudnn_version = "%i" % (runtime_v)
cudnn_version = runtime_v
# 4100 should not print warning with cudnn 4 final.
if cudnn_version > 4100:
warn = ("Your CuDNN version is more recent then Theano."
" If you see problems, try updating Theano or"
" downgrading CuDNN to version 4.")
except Exception, e:
pass
print("Using gpu device %d: %s (CNMeM is %s, CuDNN %s)" % (
......@@ -604,6 +610,10 @@ def use(device,
cnmem_enabled,
cudnn_version,),
file=sys.stderr)
if warn:
import warnings
warnings.warn(warn)
if device_properties(use.device_number)['regsPerBlock'] < 16384:
# We will try to use too much register per bloc at many places
# when there is only 8k register per multi-processor.
......
from __future__ import print_function
import sys
import logging
import sys
import warnings
import theano
from theano.configparser import config, AddConfigVar, BoolParam
......@@ -65,13 +66,22 @@ def init_dev(dev, name=None):
pygpu_activated = True
if config.print_active_device:
cudnn_version = "not available"
warn = None
try:
cudnn_version = dnn.version()
# 4100 should not print warning with cudnn 4 final.
if cudnn_version > 4100:
warn = ("Your CuDNN version is more recent then Theano."
" If you see problems, try updating Theano or"
" downgrading CuDNN to version 4.")
except Exception:
pass
print("Mapped name %s to device %s: %s (CuDNN version %s)" % (
name, dev, context.devname, cudnn_version),
file=sys.stderr)
if warn:
warnings.warn(warn)
# This maps things like 'cuda0' to the context object on that device.
init_dev.devmap = {}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论