fix cuda version check

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
pull/6141/head
zhoufeng 4 years ago
parent 2f14c40934
commit 5b52a8384f

@ -82,13 +82,13 @@ class GPUEnvChecker(EnvChecker):
f"No such directory: {self.cuda_bin}, please check if cuda is installed correctly.")
def check_version(self):
v = self._read_version(self.cuda_version)
if not Path(self.cuda_version).is_file():
logger.warning("Using custom cuda path, cuda version checking is skiped, please make sure "
"Ascend 910 AI software package version is supported, you can reference to the installation "
"guidelines https://www.mindspore.cn/install")
"cuda version is supported, you can reference to the installation guidelines "
"https://www.mindspore.cn/install")
return
v = self._read_version(self.cuda_version)
v = version.parse(v)
v_str = str(v.major) + "." + str(v.minor)
if v_str not in self.version:

@ -562,7 +562,7 @@ def set_context(**kwargs):
# set device target first
if 'device_target' in kwargs:
ctx.set_device_target(kwargs['device_target'])
device = kwargs['device_target']
device = ctx.get_param(ms_ctx_param.device_target)
if not device.lower() in __device_target__:
raise ValueError(f"Error, package type {__package_name__} support device type {__device_target__}, "
f"but got device target {device}")

Loading…
Cancel
Save