赞
踩
在gitee ascend/samples wiki找合设环境、下载最新版本进行sd卡烧录
预先安装vmware和ubuntu
用usb线将200dk和电脑连接,在vm上
player->可移动设备->Huawei。。。。。。->连接
ubuntu虚拟机
sudo passwd root
修改密码
su root
安装完整版vim
sudo apt-get install vim
vi /etc/default/grub
修改下面内容:
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
保存退出
输入
update-grub
重启虚拟机
安装网络工具
apt install net-tools
输入
ifconfig -a
查看网卡名
vi /etc/netplan/01-netcfg.yaml
输入以下内容,usb0就是200dk的网卡名,addresses可以自己选择,输入完毕,保存退出
network:
version: 2
renderer: NetworkManager
ethernets:
usb0:
dhcp4: no
addresses: [192.168.1.223/8]
gateway4: 255.255.255.0
nameservers:
addresses: [114.114.114.114]
应用配置:
netplan apply
连接200dk:
ssh HwHiAiUser@192.168.1.2
密码默认为
Mind@123
中途有问题就重启虚拟机
200dk通过usb临时联网的方式,如果重启虚拟机或者200dk,需要重新配置
#虚拟机端进入root
#允许报文交换
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -j MASQUERADE
iptables -A FORWARD -i usb0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT
#200dk端
route add default gw 192.168.1.223 dev usb0
#进入文件修改 DNS=114.114.114.114
vi /etc/systemd/resolved.conf
#重启服务
systemctl restart systemd-resolved.service
#测试
ping e.huawei.com
sudo apt-get install -y ntpdate # 安装ntpdate
sudo vim /etc/cron.daily/ntpdate #用vim打开此文件添加内容
sudo ntpdate ntp.ubuntu.com cn.pool.ntp.org #输入这行内容 保存退出
sudo chmod 755 /etc/cron.daily/ntpdate #进行文件权限修改
sudo ntpdate -d cn.pool.ntp.org #同步时间
#修改时区
timedatectl set-timezone Asia/Shanghai
### 华为200dk没有时钟RTC模块,无法写入时间,如果需要从网上下载或安装东西,需要重新配置时间!!!!!!!!!!!!!!!!!!!!!!!!!
Ubuntu22自带python3.10
根据运行端配置:需要下载python3.7.5
# 检查当前系统依赖包 gcc --version g++ --version make --version cmake --version dpkg -l zlib1g-dev| grep zlib1g-dev| grep ii dpkg -l libbz2-dev| grep libbz2-dev| grep ii dpkg -l libsqlite3-dev| grep libsqlite3-dev| grep ii dpkg -l libssl-dev| grep libssl-dev| grep ii dpkg -l libffi-dev| grep libffi-dev| grep ii dpkg -l liblzma-dev| grep liblzma-dev| grep ii dpkg -l unzip| grep unzip| grep ii dpkg -l pciutils| grep pciutils| grep ii dpkg -l net-tools| grep net-tools| grep ii dpkg -l libblas-dev| grep libblas-dev| grep ii dpkg -l gfortran| grep gfortran| grep ii dpkg -l libblas3| grep libblas3| grep ii dpkg -l liblapack-dev| grep liblapack-dev| grep ii dpkg -l openssh-server| grep openssh-server| grep ii dpkg -l xterm| grep xterm| grep ii dpkg -l firefox| grep firefox| grep ii dpkg -l xdg-utils| grep xdg-utils| grep ii dpkg -l libdbus-glib-1-dev | grep libdbus-glib-1-dev | grep ii dpkg -l gdb | grep gdb | grep ii # 如果返回如下,跳过下一步 gcc (Ubuntu 7.3.0-3ubuntu1~18.04) 7.3.0 g++ (Ubuntu 7.3.0-3ubuntu1~18.04) 7.3.0 GNU Make 4.1 cmake version 3.10.2 ii zlib1g-dev:arm64 1:1.2.11.dfsg-0ubuntu2 arm64 compression library - development ii libbz2-dev:arm64 1.0.6-8.1ubuntu0.2 arm64 high-quality block-sorting file compressor library - development ii libsqlite3-dev:arm64 3.22.0-1ubuntu0.3 arm64 SQLite 3 development files ii libssl-dev:arm64 1.1.1-1ubuntu2.1~18.04.6 arm64 Secure Sockets Layer toolkit - development files ii libffi-dev:arm64 3.2.1-8 arm64 Foreign Function Interface library (development files) ii liblzma-dev:amd64 5.2.2-1.3 amd64 XZ-format compression library - development files ii unzip 6.0-21ubuntu1 arm64 De-archiver for .zip files ii pciutils 1:3.5.2-1ubuntu1 arm64 Linux PCI Utilities ii net-tools 1.60+git20161116.90da8a0-1ubuntu1 arm64 NET-3 networking toolkit ii libblas-dev:arm64 3.7.1-4ubuntu1 arm64 Basic Linear Algebra Subroutines 3, static library ii gfortran 4:7.4.0-1ubuntu2.3 arm64 GNU Fortran 95 compiler ii libblas3:arm64 3.7.1-4ubuntu1 arm64 Basic Linear Algebra Reference implementations, shared library ii liblapack-dev:arm64 3.7.1-4ubuntu1 arm64 Library of linear algebra routines 3 - static version ii openssh-server 1:7.6p1-4ubuntu0.5 arm64 secure shell (SSH) server, for secure access from remote machines ii xterm 330-1ubuntu2 arm64 X terminal emulator ii firefox 83.0+build2-0ubuntu0.18.04.2 arm64 Safe and easy web browser from Mozilla ii xdg-utils 1.1.2-1ubuntu2.5 all desktop integration utilities from freedesktop.org ii libdbus-glib-1-dev 0.110-2 arm64 deprecated library for D-Bus IPC (development files) ii gdb 8.1.1-0ubuntu1 arm64 GNU Debugger # 否则,安装 建议使用root用户 sudo apt-get install -y gcc g++ make cmake zlib1g-dev libbz2-dev libsqlite3-dev libssl-dev libffi-dev unzip pciutils net-tools libblas-dev gfortran libblas3 liblapack-dev openssh-server xterm firefox xdg-utils libdbus-glib-1-dev gdb # 备注:libsqlite3-dev需要在Python安装之前安装,如已安装满足版本要求的Python,在此之后再安装libsqlite3-dev,需要重新编译Python环境。 # 使用wget下载Python3.7.5源码包,可以下载到安装环境的任意目录 wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz # 进入下载后的目录,解压源码包 tar -zxvf Python-3.7.5.tgz # 进入解压后的文件夹,执行配置、编译和安装命令 注:可能需要一定时间 cd Python-3.7.5 ./configure --prefix=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared make sudo make install # 其中“--prefix”参数用于指定Python安装路径,根据实际情况进行修改 # 修改环境变量 vi ~/.bashrc # 最后一行添加 #用于设置Python3.7.5库文件路径 export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH #如果用户环境存在多个Python3版本,则指定使用Python3.7.5版本 export PATH=/usr/local/python3.7.5/bin:$PATH #执行命令,直接生效 source ~/.bashrc # 检查版本号 python3 --version pip3 --version # 设置pip清华源 pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # 更新pip pip3 install --upgrade pip # 进入root用户,如果不是root用户,每个命令后加上 --user pip3 install numpy pip3 install decorator pip3 install sympy pip3 install cffi pip3 install pyyaml pip3 install pathlib2 pip3 install psutil pip3 install protobuf pip3 install scipy pip3 install requests pip3 install grpcio pip3 install pylint pip3 install absl-py
#进入官网下载.tar.gz
https://www.hiascend.com/software/mindstudio/download
#下载cann-toolkit .run
https://www.hiascend.com/software/cann/community-history
#选择下图下载
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bQIVX36y-1687582708696)(C:\Users\Jacky\AppData\Roaming\Typora\typora-user-images\image-20230503191106318.png)]
#安装toolkit
#进入软件包所在路径
#增加对软件包的可执行权限
chmod +x 软件包名.run
#安装
./软件包名.run --install
#等待
#进入虚拟机,解压.tar.gz文件
#进入软件包解压后的MindStudio/bin目录并启动MindStudio
cd MindStudio/bin
./MindStudio.sh
#随后会启动图形化界面,如果提醒warning缺少相关依赖,进入root用户并按照警告后面的安装命令进行安装
#安装完毕后,继续启动,并配置python3.7.5解释器
#创建新项目,写一个简单的helloworld
#安装完毕
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。