前提:已经在x86的电脑上安装了vmware虚拟机,在虚拟机中安装了ubuntu18的镜像。
useradd -d /home/HwHiAiUser -s /bin/bash -m HwHiAiUser
passwd HwHiAiUser
说明:
-d:指定用户的家目录
-s:用户的登录shell
-m:创建用户家目录
启动镜像,执行下面命令:
./Ascend-cann-toolkit_{version}_linux-x86_64.run --check
./Ascend-cann-toolkit_{version}_linux-aarch64.run --check
./Ascend-cann-toolkit_{version}_linux-x86_64.run --install
./Ascend-cann-toolkit_{version}_linux-aarch64.run --install
sudo apt-get install g++-aarch64-linux-gnu
在该文件“# User privilege specification”下面增加如下内容:
chmod u+w /etc/sudoers
vi /etc/sudoers
username ALL=(ALL:ALL) NOPASSWD:SETENV:/usr/bin/apt-get, /usr/bin/pip, /bin/tar, /bin/mkdir, /bin/rm, /bin/sh, /bin/cp, /bin/bash, /usr/bin/make install, /bin/ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7, /bin/ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7, /bin/ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7.5, /bin/ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7.5, /usr/bin/unzip
备注:这里我后来修改成了如下:
(指该用户是root用户组的)
username ALL=(ALL:ALL) ALL
删除写权限
chmod u-w /etc/sudoers
export install_path=/home/HwHiAiUser/Ascend/ascend-toolkit/latest
export PATH=${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:${install_path}/toolkit/bin:$PATH
export LD_LIBRARY_PATH=${install_path}/acllib/lib64:${install_path}/atc/lib64:$LD_LIBRARY_PATH
export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:${install_path}/toolkit/python/site-packages:${install_path}/pyACL/python/site-packages:$PYTHONPATH
export ASCEND_OPP_PATH=${install_path}/opp
注意:JDK版本很关键,一定要根据mindstudio的版本选择jdk的版本。否则会报错。
sudo apt-get install -y openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
去昇腾社区官网下载安装包。
将MindStudio_{software version}_ubuntu18.04-x86_64.tar.gz软件包上传至MindStudio安装服务器。并解压
启动中如果报如下图所示的错误:
解决办法:
解压jbr至MindStudio安装根目录,jbr下载链接请根据操作系统架构选择。
解压jbr至MindStudio根目录后目录结构如下:
打开软件后,到setting配置CANN的路径
在里面配置MindX sdk