MindSpore源码安装编译报错大合集(GPU)
【摘要】 MindSpor e1.7 源码安装编译报错大合集(GPU)
编译报错大合集
Required package gmp not found, please install gmp and try building
# 安装GCC
sudo apt-get install gcc-7 git automake autoconf libtool libgmp-dev tcl patch libnuma-dev flex -y
- The C compiler identification is unknown. 未配置环境变量。GCC版本不对。可能gcc、g++的路径和cmake中使用的gcc、g++路径不一致
apt-get install build-essential
gcc -v
# 怎么是9
# 切换GCC到7
rm -fr /usr/bin/gcc
rm -fr /usr/bin/g++
sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc
sudo ln -s /usr/bin/g++-7 /usr/bin/g++
The CUDA compiler identification is unknown
– Found CUDA: /usr (found version “10.1”)
# nvcc 的原因 多版本CUda? nvcc -V
export PATH=/usr/local/cuda-10.1/bin/:$PATH
# 发现有个配置出现问题,改正如下
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-10.1/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH
# 问题还是cuda和cudnn版本不对应。安装对应Cuda10.1的CuDNN https://developer.nvidia.com/rdp/cudnn-archive
# Cudnn 10.1
sudo tar xvf cudnn-10.1-linux-x64-v7.6.0.64.tgz
sudo mv cuda/include/cudnn.h /usr/local/cuda-10.1/include
sudo mv cuda/lib64/libcudnn* /usr/local/cuda-10.1/lib64
sudo chmod a+r /usr/local/cuda-10.1/include/cudnn.h /usr/local/cuda-10.1/lib64/libcudnn*
- 最后修改 CMakeFile ,搞定
vim CMakeLists.txt
# 在开始增加如下
set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc")
重新编译
source activate py39_ms17
rm -fr build
bash build.sh -e gpu -S on
Pip安装本地生成的MindSpore
source activate py39_ms17
pip install output/mindspore_gpu-*.whl -i https://pypi.tuna.tsinghua.edu.cn/simple
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)