Browse Source

!6141 Fix cuda version check

Merge pull request !6141 from zhoufeng/fix-cuda-version-check
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
e89dc444e9
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      mindspore/_version_check.py
  2. +1
    -1
      mindspore/context.py

+ 3
- 3
mindspore/_version_check.py View File

@@ -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:


+ 1
- 1
mindspore/context.py View File

@@ -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