Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

昇腾虚拟机固件与驱动安装 #1

Open
Yikun opened this issue Jul 20, 2023 · 0 comments
Open

昇腾虚拟机固件与驱动安装 #1

Yikun opened this issue Jul 20, 2023 · 0 comments
Labels
Ascend Something isn't working publish New feature or request

Comments

@Yikun
Copy link
Contributor

Yikun commented Jul 20, 2023

作者:@wangxiyuan

华为云目前提供了基于Ascend 310的虚拟机,实例类型为Ai1,支持的OS为ubuntu 18.04和centos 7.6。本文以ubuntu 18.04的4U16G并搭载两块ascend 310的VM为例,说明如何初始化开发环境。

  1. 卸载旧版固件

    华为云的Ai1实例默认已经安装了Ascend的驱动和lib库,但版本可能已过时,如果想使用新版的开发环境,则需要先删除旧版固件。

    # 进入/usr/local/Ascend,
    cd /usr/local/Ascend
    #按照opp、ascend-tookit、driver的顺序,依次进入相关目录的script目录中,执行uninstall.sh文件

    卸载完成后,需要重启VM

  2. 安装驱动和开发库

    从昇腾官方下载最新的驱动和开发包

    下载对应的.run包,拷贝到VM中,赋予执行权限,按照driver、nnrt、toolkit的顺序依此安装。

    # 安装driver
    ./A300-3010-npu-driver_21.0.4_linux-x86_64.run --full
    # 检查安装结果,显示两块OK的ascend 310卡
    npu-smi info
    # 安装nnrt
    ./Ascend-cann-nnrt_5.1.RC2.alpha002_linux-x86_64.run --install:
    # 安装依赖
    apt-get install -y gcc g++ make cmake zlib1g zlib1g-dev openssl libsqlite3-dev libssl-dev libffi-dev unzip pciutils net-tools libblas-dev gfortran libblas3 libopenblas-dev
    # 升级pip
    pip3 install --upgrade pip
    # 安装pip依赖
    pip3 install attrs numpy decorator sympy cffi pyyaml pathlib2 psutil protobuf scipy requests
    # 安装toolkit
    ./Ascend-cann-toolkit_5.1.RC2.alpha002_linux-x86_64.run --install
  3. 测试

    按照官方指导,下载example工程并编译执行即可。

@Yikun Yikun added Ascend Something isn't working publish New feature or request and removed publish New feature or request labels Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ascend Something isn't working publish New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant