Atlas500小站史诗级教程使用Docker部署安装cann-nnrt社区版和MindX SDK>mxManufacture社区版

梁嗖嗖这两天拿到了新玩具

本文的设备情况:

本文默认读者已经根据500小站用户指南,完成设备上电等前置操作:https://support.huawei.com/enterprise/zh/doc/EDOC1100133176/c6355e39

小站是华为欧拉linux系统(aarch64架构),Ascend310芯片,本文的500完全隔绝外网 (正常的500可以连接外网),也没有apt-get install等方式安装软件,但是小站系统自带docker软件,仅用于模型边缘部署。

uname -a 查看系统架构信息:

由于a500的网络原因,我们用身边的一Jetson nano2gb进行docker 镜像部署,好处在于都是aarch64 架构,感觉构建镜像时会更顺利。用其他linux设备是一样的。

DockerFile基于ubuntu18.04进行构建,包括安装atlas500部署所用的Ascend-cann-nnrt_5.0.4.alpha002_linux-aarch64.run、以及后台AI引擎所需的python依赖、redis、linux所需的必要软件。

在此解释一下CANN分为cann-toolkit 和 cann-nnrt ;区别大致是toolkit包更完整,包含开发,推理训练都可以;nnrt是离线推理引擎包,较为轻量,包含开发、推理应用。像模型转换操作就只能用cann-toolkit包。因为我们只在500部署,所以选用nnrt包。

- Dockerfile文件作为参考

基于sample样例进行开发时,要看清楚软件版本,比如python版本

其中的MindX SDK安装是可选操作,后续的文章没有用到。

其中,以root用户登录小站,执行id HwHiAiUser命令查询并记录宿主机上HwHiAiUser用户的UID和GID。
 

为在容器内创建HwHiAiUser用户。gid、uid为宿主机上HwHiAiUser用户的UID和GID,容器内的HwHiAiUser用户的UID和GID需要和宿主机保持一致。

id HwHiAiUser

由于内网部署网络的限制,同时为软件环境修改方便,本文借助其他外网设备,通过DockerFile方式构建docker镜像,再把打包好的镜像文件上传至500小站使用。由于小站是aarch64架构,所用的apt源和开发软件的架构也要是aarch64架构,我们镜像构建和后续的模型转换在另一台可连接外网的atlas200 DK(arrch64)设备上操作。

由于设备不在身边,完全内网环境,通过公网ip远程登录。我们在构建docker时,需要了解后续的开发方式,准备所需软件环境。

经过研究文档发现,在昇腾设备上开发主要有两种方式:

使用MindX SDK推理,MindX SDK是一种插件化编程方式,我理解是一个简化的推理SDK,少量代码开发,拼接几个预定义好的插件就可以实现应用开发,尝试过但遇到一些程序崩溃问题,同时觉得过于模板化,自主性不强,没有使用。
基于ACL架构进行开发,这种算是采用ascend的API进行自主开发编译运行,并不需要从0开发,昇腾的样例仓中有很多参考项目,可以基于昇腾的sample开发:https://gitee.com/ascend/samples,同时参考Ascend的开发工具包 CANN推理的API文档,

镜像构建前置操作

拿到atlas500,可以ssh远程登录后,进入的初始系统是类似启动项,还不是Euler系统

登录Euler系统之前,我们要在IES界面做一些操作:

ssh远程登录a500后,在IES:/ -> 界面,首先输入 sftp enable,终端返回 set enable success,即可开放atlas500的 /tmp 目录,进行远程文件传输。

但/tmp目录仅有2G空间。并且是临时目录,固件升级等操作会将该目录清空,可仅用于文件传输目录,不可长时间存放文件。博主曾经将代码放到该目录下用Xftp打开文件编辑代码,这样很危险,/tmp被清空没有备份就凉凉了。

重置会话超时时间,否则超时后,ssh会话会自动关闭,远程终端中断。

在IES界面输入timeout 0 ,终端返回set success;然后输入develop (开发者模式),进入欧拉系统。再输入TMOUT=0:

Euler:~ # TMOUT=0

其中,我的driver固件版本为21.0.4,CANN版本必须和固件版本配套,否则会遇到很多不可预料的问题。关于版本不匹配导致的问题见issues:https://gitee.com/ascend/samples/issues/I532OI?from=project-issue

下载固件时,会有版本的对应关系:https://www.hiascend.com/hardware/firmware-drivers?tag=community

比如下图:CANN的5.0.4版本,必须对应21.0.4的固件版本。但我在使用时发现,社区版的固件更新是滞后的。导致一直在使用低版本的固件,出现很多玄学问题,最后版本匹配后就解决了。

固件升级,选择智能边缘管理系统升级最方便,参考文档:(https://support.huawei.com/enterprise/zh/doc/EDOC1100133173/dede8113)

在构建docker 镜像前我们要确定CANN的版本,本文选用 昇腾CANN社区版(5.0.4.alpha002),后续的操作应严格按照CANN对应的文档来,CANN文档分为训练和推理,请移步: 昇腾CANN社区版(5.0.4.alpha002)(训练)、 昇腾CANN社区版(5.0.4.alpha002)(推理)
 

mxManufacture 社区版历史版本-昇腾社区 (hiascend.com)

CANN社区版历史版本-昇腾社区 (hiascend.com)

固件与驱动-昇腾社区 (hiascend.com)

Atlas500小站史诗级教程使用Docker部署安装cann-nnrt社区版和MindX SDK>mxManufacture社区版_第1张图片

Atlas500小站史诗级教程使用Docker部署安装cann-nnrt社区版和MindX SDK>mxManufacture社区版_第2张图片

Atlas500小站史诗级教程使用Docker部署安装cann-nnrt社区版和MindX SDK>mxManufacture社区版_第3张图片

failed to activate service 'org.freedesktop.systemd1' timed out

重启设备最直接 

docker 镜像构建过程,也可以参考官方文档https://support.huawei.com/enterprise/zh/doc/EDOC1100133176/63895f14

 在jetson nano2gb和虚拟机或其他linux设备均可构建镜像:

本章节用了目前最新的 CANN版本20220429的

5.1.RC2.alpha0022022/04/29

sudo docker build -t atlas500_last:v5 --build-arg NNRT_PKG=Ascend-cann-nnrt_5.1.RC2.alpha002_linux-aarch64.run --build-arg SDK_PKG=Ascend-mindxsdk-mxmanufacture_2.0.1_linux-aarch64.run .
Step 28/31 : ARG SDK_PKG
 ---> Running in 5ca9aa4350b1
Removing intermediate container 5ca9aa4350b1
 ---> a30dcf41e28d
Step 29/31 : WORKDIR /root
 ---> Running in 3e56bbd34c65
Removing intermediate container 3e56bbd34c65
 ---> 8aa4908d80f3
Step 30/31 : COPY $SDK_PKG .
 ---> 61ff505f00f6
Step 31/31 : RUN chmod +x ${SDK_PKG} &&	./${SDK_PKG} --quiet --install &&	rm ${SDK_PKG} &&	/bin/bash -c "source ~/.bashrc"
 ---> Running in b62cdc09673c
MS_check_platform ./Ascend-mindxsdk-mxmanufacture_2.0.1_linux-aarch64.run aarch64 ./Ascend-mindxsdk-mxmanufacture_2.0.1_linux-aarch64.run
Installing the compiler version of devtoolset-7 ...
valid acl path(/usr/local/Ascend/nnrt/latest/acllib/lib64), continue the installation...
Removing intermediate container b62cdc09673c
 ---> 80bc0532963b
Successfully built 80bc0532963b
Successfully tagged atlas500_last:v5

其中,-t指明镜像名和版本号;–build-arg NNRT_PKG=“输入cann-nnrt包的路径” ;–build-arg SDK_PKG= “输入MindX SDK的路径” (可选)

构建镜像结束:

docker images # 查看镜像

sudo docker images
REPOSITORY                               TAG                 IMAGE ID       CREATED         SIZE
atlas500_last                            v5                  80bc0532963b   46 hours ago    2.11GB
                                                 46c328d1107d   2 days ago      963MB
                                                 a1109cfd5ace   2 days ago      963MB
                                                 4dab7f42cd46   2 days ago      963MB
                                                 d56976a41944   2 days ago      858MB
                                                 1e1c5837f43d   2 days ago      858MB
                                                 69d42aefafe5   2 days ago      852MB
                                                 a65f64a1d1f8   2 days ago      852MB
ubuntu                                   18.04               cc6f13ca5102   3 weeks ago     56.7MB
mynode                                   latest              a95f5c09255a   5 weeks ago     941MB
                                                 c9c4ded471bc   5 weeks ago     941MB
komavideo/mynode                         v01                 84d0ad3355e9   5 weeks ago     843MB
node                                     latest              6c8ffad9dee1   5 weeks ago     941MB
liang                                    v1.0                57d122d6ddd6   6 weeks ago     22.8MB
nginx                                    1.21.6-alpine       674e6760e55a   6 weeks ago     22MB
dreamacro/clash                          latest              9141f5511311   2 months ago    22.8MB
nvcr.io/nvidia/dli/dli-nano-deepstream   v2.0.0-DS6.0.1zh    546f93b57c99   2 months ago    2.22GB
nvcr.io/nvidia/dli/dli-nano-deepstream   v2.0.0-DS6.0.1      eb0e1e157f1d   2 months ago    2.22GB
nvcr.io/nvidia/dli/dli-nano-ai           v2.0.1-r32.6.1zh    1b81ef235451   9 months ago    3.38GB
nvcr.io/nvidia/dli/dli-nano-ai           v2.0.1-r32.6.1      a4e89dcd35e9   9 months ago    3.38GB
nvcr.io/nvidia/l4t-ml                    r32.6.1-py3         4818848f7fee   9 months ago    5GB
nvcr.io/nvidia/l4t-base                  r32.6.1             1735192d3d51   10 months ago   636MB
python                                   3.8.10-alpine3.12   55a886bec186   11 months ago   42.8MB
nvcr.io/nvidia/dli/dli-nano-ai           v2.0.1-r32.5.0      bc9051ff252d   17 months ago   3.73GB
node                                     8.16.1              6ff56af4db98   2 years ago     843MB
jitteam/devicequery                      latest              eba22039865c   2 years ago     1.57GB

将镜像文件导出,通过/tmp目录上传至atlas500
可以看到我的镜像已经很大了,我们在dockerfile中构建时,可以将不用的软件包删除,比如MindX sdk
我这里是用的前面我的文章上传的,我的镜像是有mxManufacture的是1.9g,刚好不够上传,上传文章看这个
将这个镜像保存下来打包。
docker save 80bc0532963b > atlas500_last.tar		

nfs开发上传文件

(38条消息) Atlas500小站和Jetson nano使用nfs开发_无证驾驶梁嗖嗖的博客-CSDN博客

  • atlas500运行镜像生成容器

  • sudo docker run --privileged --network=host --device=/dev/davinci0 --device=/dev/davinci_manager --device=/dev/hisi_hdc --device /dev/devmm_svm -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi -v /home/data/miniD/driver/lib64:/home/data/miniD/driver/lib64 -v /run/board_cfg.ini:/run/board_cfg.ini -it atlas500_last:v5 /bin/bash
    

    其中,–privileged开启特权模式,容器才能调用宿主机的npu芯片,即device。

    –network=host 开启宿主机的网络映射,容器才能和宿主机一样访问网络。

    -it atlas500_last:v5,指明容器的名称: 版本号

Authorized users only. All activities may be monitored and reported.
Last login: Thu May 19 21:19:02 2022 from 192.168.2.134
IES:/->develop
input root passwd
Password:
Last login: Thu May 19 21:21:39 UTC 2022 on pts/0
-bash: /usr/local/Ascend/nnrt/set_env.sh: No such file or directory
Euler:~ # cd /opt/middleware/MindXOM/bin/
Euler:/opt/middleware/MindXOM/bin # LS
-bash: LS: command not found
Euler:/opt/middleware/MindXOM/bin # ls
ibma_edge_log_check.sh  ief_log_tar_save.sh  import_cert  inotifywait  inotifywatch  log_file_rotate.sh  log_tar_save.sh  mount_white_path  prepare_nginx
Euler:/opt/middleware/MindXOM/bin # timed out waiting for input: auto-logout
IES:/->./mount_white_path display
        COMMAND NOT SUPPORTED
IES:/->develop
input root passwd
Password:
Last login: Thu May 19 22:08:44 UTC 2022 on pts/0
-bash: /usr/local/Ascend/nnrt/set_env.sh: No such file or directory
Euler:~ # cd /opt/middleware/MindXOM
MindXOM/        MindXOMPackage/
Euler:~ # cd /opt/middleware/MindXOM/bin/
Euler:/opt/middleware/MindXOM/bin # ls
ibma_edge_log_check.sh  ief_log_tar_save.sh  import_cert  inotifywait  inotifywatch  log_file_rotate.sh  log_tar_save.sh  mount_white_path  prepare_nginx
Euler:/opt/middleware/MindXOM/bin # ./mount_white_path display
/opt/mount/
Euler:/opt/middleware/MindXOM/bin # du -sh /opt/
ascend/         containerd/     edged/          edge-installer/ edge-register/  FD/             IEF/            local/          lost+found/     middleware/     p7.log
Euler:/opt/middleware/MindXOM/bin # du -sh /opt/
ascend/         containerd/     edged/          edge-installer/ edge-register/  FD/             IEF/            local/          lost+found/     middleware/     p7.log
Euler:/opt/middleware/MindXOM/bin # du -sh /opt/mount/
du: cannot access '/opt/mount/': No such file or directory
Euler:/opt/middleware/MindXOM/bin # ./mount_white_path add /home/test/
/home/test/ added successfully
Euler:/opt/middleware/MindXOM/bin # ./mount_white_path check /home/test/
/home/test/ exists in the list
Euler:/opt/middleware/MindXOM/bin # ./mount_white_path add /var/lib/docker
/var/lib/docker/ added successfully
Euler:/opt/middleware/MindXOM/bin #
  • 简单docker操作

docker ps 查看容器:

如果没有刚生成的容器,可能是挂起了, docker ps --all查看所有容器。

docker start containerID 即可启动容器

docker exec -it 0665 /bin/bash 进入容器

进入容器后,检查输入npu-smi info 出现芯片信息,检查相关软件环境,即安装成功。

进行推理之前,需要到容器中CANN的安装目录下,激活环境

我的路径在:

cd /usr/local/Ascend/nnrt/	
source set_env.sh

下面截图是操作流程,每个人操作肯定都会出现一点差别,有错误就百度就好了谢谢,我这里算是搭建完成了

Euler:/var/lib/docker # sudo docker load --input atlas500_last.tar
cf1e6f9bc415: Loading layer [==================================================>]  58.92MB/58.92MB
83c55ccfd1dd: Loading layer [==================================================>]  5.632kB/5.632kB
c81cba95da2c: Loading layer [==================================================>]  624.6MB/624.6MB
a6de161bc9b1: Loading layer [==================================================>]  503.3kB/503.3kB
ea2516965b6a: Loading layer [==================================================>]  2.048kB/2.048kB
05cdfe7f27a2: Loading layer [==================================================>]  39.43MB/39.43MB
7b960d531595: Loading layer [==================================================>]  114.9MB/114.9MB
af8b880b1034: Loading layer [==================================================>]   35.7MB/35.7MB
4e54d9e901b7: Loading layer [==================================================>]     64kB/64kB
eb58e9af3469: Loading layer [==================================================>]  106.3MB/106.3MB
c96a6a42ec28: Loading layer [==================================================>]   2.56kB/2.56kB
d2ae4882554d: Loading layer [==================================================>]  54.14MB/54.14MB
642ee8462f24: Loading layer [==================================================>]  186.1MB/186.1MB
a74fd2a3cb37: Loading layer [==================================================>]  202.2MB/202.2MB
222a419a3b12: Loading layer [==================================================>]  367.9MB/367.9MB
fb8b229ff52c: Loading layer [==================================================>]  66.66MB/66.66MB
82b75569fe7c: Loading layer [==================================================>]  289.2MB/289.2MB
Loaded image ID: sha256:80bc0532963b2dcafc90838e64f421eccf2688fd6b9eabfdea55d69c189af9b9
Euler:/var/lib/docker # ls
123318e6f14a9bac417b58a582770a9a13d2d03cb29d46c4caab1fb1558a3767       buildkit                                                          lost+found
1fd354bca2188d778b92086dd131cdbf3b046dbbfa51fd2f2adbac0e0c017224       c35541413eda38b07261fcc12a3cf6eb30ae4f0e5c25361df2907850bf9aaad0  manifest.json
2c7a0cee8a30ec04ed7728c27a1543212178b75cdc734dcbf1c80abefdc2533b       c429f88e9e0c371dce0434a7d0acca44cabba39257e3b8234d0ef5b72b9f1e2e  modelfile
38a11c69bd4eec6e4c4167ae24d760c4295987b30d55cc869fc4329b3de1ce42       c9253a3158e099948f4fd2ce7658a0b65cf107a6915fdd54822a0fafdced5d24  model_file_download
6b2e4891ee2a9ae65412b1909384ed1f7af59fe3c750ff1c63df6eebfd0f177a       containerd                                                        network
80bc0532963b2dcafc90838e64f421eccf2688fd6b9eabfdea55d69c189af9b9.json  containers                                                        overlay2
86c724ac37aa88d2493541c702f431b9a0c0250266c2a289baae352240290347       d45c5b1343e28c35a1720ba99add48ea6aac63928039e9f0a9206bb79e17ae33  p8.log
8d2be0e13c1d1c06e0d04a1193022e3ce66331e5e016c0f619af74eab1dc8235       d51a0020677fc6b5bc1ea82d00fa274c506cee52de41cbe91bd55da6d26cac7e  plugins
92135f2ca611ce11eed8007194af9429891d2ad56e1e04b41a59794e6508f4a6       e08b7dc0536c0cd7611a4e0eb29fab49b151b97265674963dca596345991848c  runtimes
Ascend-cann-nnrt_5.1.RC2.alpha002_linux-aarch64.run                    e80c4ede417a3a31b02f7b88dff3e2c260f3cdd547975d056d6835437e77e87d  samples-master
Ascend-cann-toolkit_5.1.RC2.alpha002_linux-aarch64.run                 e82d00408b2ec30c56845a3b96b55e79c6578449878943664c3b7708e10f20d6  swarm
atlas500_last.tar                                                      f5ec45b50337ab3772a62ce12b30fa8e92b2caecdbe86333944a94956c9ab174  tmp
attach_file_download                                                   hooks                                                             trust
builder                                                                image                                                             volumes
Euler:/var/lib/docker # sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
                            80bc0532963b        27 hours ago        2.11GB
                            20908a61c3bf        21 months ago       1.95MB
k8s.gcr.io/pause    latest              6b8dc5dab442        21 months ago       1.59MB
Euler:/var/lib/docker # docker run --privileged --network=host --device=/dev/davinci0 --device=/dev/davinci_manager --device=/dev/hisi_hdc --device /dev/devmm_svm -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi -v /home/data/miniD/driver/lib64:/home/data/miniD/driver/lib64 -v /run/board_cfg.ini:/run/board_cfg.ini -it atlas500_last:v5 /bin/bash
Unable to find image 'atlas500_last:v5' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:37650->[::1]:53: read: connection refused.
See 'docker run --help'.
Euler:/var/lib/docker #
Euler:/var/lib/docker # ————————————————
-bash: ————————————————: command not found
Euler:/var/lib/docker # 
shine: command not found
Euler:/var/lib/docker # docker run --privileged --network=host --device=/dev/davinci0 --device=/dev/davinci_manager --device=/dev/hisi_hdc --device /dev/devmm_svm -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi -v /home/data/miniD/driver/lib64:/home/data/miniD/driver/lib64 -v /run/board_cfg.ini:/run/board_cfg.ini -it 80bc0532963b /bin/bash
root@Euler:~# ls
mxManufacture  mxManufacture-2.0.1  redis
root@Euler:~# cd mxManufacture
root@Euler:~/mxManufacture# ls
bin  config  filelist.txt  include  lib  opensource  python  samples  toolkit  version.info
root@Euler:~/mxManufacture# cd ..
root@Euler:~# cd
.bashrc              .cache/              .local/              .profile             mxManufacture/       mxManufacture-2.0.1/ redis/
root@Euler:~# ls
mxManufacture  mxManufacture-2.0.1  redis
root@Euler:~# cd redis/
root@Euler:~/redis# ls
redis-5.0.5  redis-5.0.5.tar.gz
root@Euler:~/redis# cd redis-5.0.5
root@Euler:~/redis/redis-5.0.5# ls
00-RELEASENOTES  CONTRIBUTING  INSTALL    Makefile   deps        runtest          runtest-moduleapi  sentinel.conf  tests
BUGS             COPYING       MANIFESTO  README.md  redis.conf  runtest-cluster  runtest-sentinel   src            utils
root@Euler:~/redis/redis-5.0.5# uname -a
Linux Euler 4.19.90-vhulk2111.1.0.h963.eulerosv2r10.aarch64 #1 SMP Sat Dec 25 05:09:23 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
root@Euler:~/redis/redis-5.0.5# cd ..
root@Euler:~/redis# ls
redis-5.0.5  redis-5.0.5.tar.gz
root@Euler:~/redis# cd ..
root@Euler:~# ls
mxManufacture  mxManufacture-2.0.1  redis
root@Euler:~# ./mxManufacture
bash: ./mxManufacture: Is a directory
root@Euler:~# cd /etc/
root@Euler:/etc# ls
Ascend                  cron.daily      dpkg           gshadow      issue          login.defs     mtab           passwd-    rc1.d        rpc            skel         systemd
X11                     cron.hourly     emacs          gshadow-     issue.net      logrotate.d    network        perl       rc2.d        securetty      ssl          terminfo
adduser.conf            cron.monthly    environment    gss          kernel         lsb-release    networks       pm         rc3.d        security       subgid       ucf.conf
alternatives            cron.weekly     ffserver.conf  host.conf    ld.so.cache    machine-id     nsswitch.conf  profile    rc4.d        selinux        subgid-      update-motd.d
apt                     crontab         fonts          hostname     ld.so.conf     magic          openal         profile.d  rc5.d        sensors.d      subuid       vdpau_wrapper.cfg
bash.bashrc             dbus-1          fstab          hosts        ld.so.conf.d   magic.mime     opt            protocols  rc6.d        sensors3.conf  subuid-      vim
bindresvport.blacklist  debconf.conf    gai.conf       hosts.allow  ldap           mailcap        os-release     pulse      rcS.d        services       sudoers      wgetrc
ca-certificates         debian_version  glvnd          hosts.deny   legal          mailcap.order  pam.conf       python3    redis.conf   shadow         sudoers.d    xdg
ca-certificates.conf    default         group          init.d       libaudit.conf  mime.types     pam.d          python3.6  resolv.conf  shadow-        sysctl.conf
cron.d                  deluser.conf    group-         inputrc      logcheck       mke2fs.conf    passwd         rc0.d      rmt          shells         sysctl.d
root@Euler:/etc# cd Ascend/
root@Euler:/etc/Ascend# ls
ascend_cann_install.info
root@Euler:/etc/Ascend# cd ..
root@Euler:/etc# cd ..
root@Euler:/# ls
bin  boot  dev  etc  home  lib  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@Euler:/# cd home/
root@Euler:/home# ls
HwHiAiUser  data  ljx
root@Euler:/home# cd ljx/
root@Euler:/home/ljx# ls
test
root@Euler:/home/ljx# cd test/
root@Euler:/home/ljx/test# ls
packages
root@Euler:/home/ljx/test# cd packages/
root@Euler:/home/ljx/test/packages# ls
requests-offline
root@Euler:/home/ljx/test/packages# cd requests-offline/
root@Euler:/home/ljx/test/packages/requests-offline# ls
 certifi-2019.9.11-py2.py3-none-any.whl   idna-2.8-py2.py3-none-any.whl  'python3.7.4 requests2.22.0.zip'   requests-2.22.0-py2.py3-none-any.whl
 chardet-3.0.4-py2.py3-none-any.whl       python-3.7.4-amd64.exe          requests-2.22.0                   urllib3-1.25.6-py2.py3-none-any.whl
root@Euler:/home/ljx/test/packages/requests-offline# cd ..
root@Euler:/home/ljx/test/packages# ls
requests-offline
root@Euler:/home/ljx/test/packages# ifc
bash: ifc: command not found
root@Euler:/home/ljx/test/packages# sudo apt-get update
Err:1 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:4 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-backports/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-security/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@Euler:/home/ljx/test/packages# cd ..
root@Euler:/home/ljx/test# cd ..
root@Euler:/home/ljx# cd ..
root@Euler:/home# cd /etc/apt/sources.list
bash: cd: /etc/apt/sources.list: Not a directory
root@Euler:/home# sudo vi /etc/apt/sources.list
root@Euler:/home# python3
Python 3.6.9 (default, Mar 15 2022, 13:55:28)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctl
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'ctl'
>>> import acl
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'acl'
>>> ls
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'ls' is not defined
>>>
KeyboardInterrupt
>>>
root@Euler:/home#
root@Euler:/home# cd /usr/local/Ascend/nnrt/
root@Euler:/usr/local/Ascend/nnrt# ls
5.1  5.1.RC2.alpha002  latest  set_env.sh
root@Euler:/usr/local/Ascend/nnrt# ./set_env.sh
root@Euler:/usr/local/Ascend/nnrt# ls
5.1  5.1.RC2.alpha002  latest  set_env.sh
root@Euler:/usr/local/Ascend/nnrt# python3
Python 3.6.9 (default, Mar 15 2022, 13:55:28)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import acl
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'acl'
>>>
root@Euler:/usr/local/Ascend/nnrt# source set_env.sh
root@Euler:/usr/local/Ascend/nnrt# python3
Python 3.6.9 (default, Mar 15 2022, 13:55:28)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import acl
>>> acl.init()
0
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>

你可能感兴趣的:(docker,linux,运维)