本教程详细记录了在华为昇腾服务器上,桌面化docker内配置 MindStudio 的方法,让你可以实现一机多用户同时使用 MindStudio 愉快的进行开发。
启动镜像命令:
docker run -it --privileged --net=bridge --cap-add LINUX_IMMUTABLE -p 8090:22 -p 5900:5900 --device=/dev/davinci0 --device=/dev/davinci1 --device=/dev/davinci2 --device=/dev/davinci3 --device=/dev/davinci_manager --device=/dev/devmm_svm --device=/dev/hisi_hdc -v /usr/local/dcmi:/usr/local/dcmi -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi -v /var/log/npu/slog/slogd:/var/log/npu/slog -v /path/to/your/host:/home/HwHiAiUser --name mindstudio_desktop jeremyj666/ubuntu-desktop /bin/bash
参考 《【经验分享】让你的docker桌面化》,使用 TightVNC 连接。
参考《【板卡AI】昇腾 atlas300 docker 开发环境搭建》。
vim /etc/apt/sources.list
# ubuntu18.04
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
apt install libx11-xcb1 libxcomposite1 libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 libnss3 libgbm1 libasound2 libxcb-dri3-0 gcc cmake gnome-keyring
# 安装 python3.7.5
# 1、下载 python3.7.5 的包
wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
# 2、解压
tar -zxvf Python-3.7.5.tgz
# 3、配置、编译、安装 python
cd Python-3.7.5
./configure --prefix=/usr/local/python3.7.5 --enable-shared
make -j16
make install
# 4、配置 python 系统库
cp /usr/local/python3.7.5/lib/libpython3.7m.so.1.0 /usr/lib
# 5、设置软连接
ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7.5
ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7
ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7.5
ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7
ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip
apt-get install -y xterm
# 检查是否安装成功
dpkg -l xterm| grep xterm| grep ii
若返回如下信息则安装成功:
apt-get install -y firefox xdg-utils
# 检查是否安装成功
dpkg -l xdg-utils| grep xdg-utils| grep ii
apt-get install -y fonts-droid-fallback fonts-wqy-zenhei fonts-wqy-microhei fonts-arphic-ukai fonts-arphic-uming
检查是否安装成功,分别输入如下命令:
dpkg -l fonts-droid-fallback| grep fonts-droid-fallback| grep ii
dpkg -l fonts-wqy-zenhei| grep fonts-wqy-zenhei| grep ii
dpkg -l fonts-wqy-microhei| grep fonts-wqy-microhei| grep ii
dpkg -l fonts-arphic-ukai| grep fonts-arphic-ukai| grep ii
dpkg -l fonts-arphic-uming| grep fonts-arphic-uming| grep ii
若分别返回如下信息则说明安装成功:
fonts-droid-fallback 1:6.0.1r16-1 all handheld device font with extensive style and language support (fallback)
fonts-wqy-zenhei 0.9.45-6ubuntu1 all "WenQuanYi Zen Hei" A Hei-Ti Style (sans-serif) Chinese font fonts-wqy-microhei 0.2.0-beta-2 all Sans-serif style CJK font derived from Droid
fonts-arphic-ukai 0.2.20080216.2-4ubuntu2 all "AR PL UKai" Chinese Unicode TrueType font collection Kaiti style
fonts-arphic-uming 0.2.20080216.2-7ubuntu2 all "AR PL UMing" Chinese Unicode TrueType font collection Mingti style
pip install attrs psutil decorator numpy protobuf==3.11.3 scipy sympy cffi --user
pip install gnureadline coverage pylint matplotlib grpcio grpcio-tools requests xlrd==1.2.0 --user
pip install absl-py pandas tensorflow==1.15.0 pytest --user
apt-get install -y openjdk-8-jdk
配置环境
vim ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
source ~/.bashrc
验证是否安装成功:
which java
which jconsole
软件包 | 说明 | 获取链接 |
---|---|---|
MindStudio_{version}_linux.tar.gz | MindStudio软件包,含有GUI的集成开发环境。 | 获取软件包 |
Ascend-cann-toolkit_{version}_linux-{arch}.run | Ascend-cann-toolkit开发套件包,包含开发辅助工具和相关开发接口的开发套件包。若环境上已安装,则无需再次获取。若环境上未安装,可以获取该软件包后与MindStudio同步安装。 | 获取软件包 |
tar -zxvf MindStudio_{version}_linux.tar.gz
cd MindStudio/bin
./MindStudio.sh
首次启动时,MindStudio会引导并检测安装所需第三方依赖文件,比如我的环境就有些问题:
很简单,按照他的提示配置就好了。
解决掉上诉依赖报错后,就可以愉快的进入设置界面了:
选择前面下载的 Ascend-cann-toolkit_{version}_linux-{arch}.run 路径:
接着一路 Next
等好了按 Finsh
大功告成。
至于 MindStudio 怎么用,后面再写教程吧~
扫描下方二维码即可关注我的微信公众号【极智视界】,获取更多AI经验分享,让我们用极致+极客的心态来迎接AI !