mindspore-ai / mindspore

MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
https://gitee.com/mindspore/mindspore
Apache License 2.0
4.26k stars 705 forks source link

使用用户自定义的目录安装cuda,报环境不匹配的警告 #105

Open yifanfeng97 opened 3 years ago

yifanfeng97 commented 3 years ago

Environment

Hardware Environment(Ascend/GPU/CPU):

/device gpu

Software Environment:

用户自己的home下的.bashrc中的配置: image

系统的CUDA环境: image

Describe the current behavior

import mindspore 报出警告说环境不匹配:[WARNING] ME(39922:140551200737088,MainProcess):2021-01-23-15:05:55.109.91 [mindspore/_check_version.py:96] MindSpore version 1.1.0 and cuda version 9.0 does not match, reference to the match info on: https://www.mindspore.cn/install

Describe the expected behavior

希望mindspore能正确检测系统的cuda环境的版本,从而不报出这种警告。

Steps to reproduce the issue

  1. 系统管理员在系统层面安装了CUDA 9.0
  2. 用户在自己的目录用非root权限安装了CUDA 10.1
  3. 用户通过修改.bashrc文件,将自己安装的CUDA 10.1的环境,放到 LD_LIBRARY_PATH 中,CUDA的bin至于PATH的最前面
  4. 命令行输入python
  5. 输入import mindspore
  6. 报出环境不匹配的警告:[WARNING] ME(39922:140551200737088,MainProcess):2021-01-23-15:05:55.109.91 [mindspore/_check_version.py:96] MindSpore version 1.1.0 and cuda version 9.0 does not match, reference to the match info on: https://www.mindspore.cn/install

Related log / screenshot

image

Special notes for this issue

我简单查阅了一下报错的源码的位置:https://gitee.com/mindspore/mindspore/blob/master/mindspore/_check_version.py#L86 发现该函数依赖写死的cuda路径导致了该警告,也就是在https://gitee.com/mindspore/mindspore/blob/master/mindspore/_check_version.py#L48 image 希望能借鉴pytorch或者tensorflow的check version函数,不依赖写死的cuda安装路径去检查版本。 实际上我的环境下面pytorch和tensorflow都能正常check cuda的版本。

cxl-ll commented 3 years ago

Hello.thank you for your feedback. We plan to solve it in the next version. We will let you know when we finish.

ytgui commented 3 years ago

That because the mindspore boys know nothing about ubuntu x86 and x86_64. Temporary solution: use ln -s command to create a softlink, this could cheat cmake and build mindspore successful without changing original CMakeList.txt