玩转Jetson Nano(二)检查已安装组件

系统成功登录后,我们来继续调试软件部分

1. 连接Xshell,XFTP

安装上系统以后,打开Xshell,输入IP地址,端口号22,无需任何设置,马上就能连上

Xshell 6 (Build 0121)
Copyright (c) 2002 NetSarang Computer, Inc. All rights reserved.

Type `help' to learn how to use Xshell prompt.
[C:\~]$ 

Connecting to 10.168.1.120:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.9.140-tegra aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.

0 packages can be updated.
0 updates are security updates.

Last login: Tue Apr  9 09:30:26 2019 from 172.16.12.223
beckhans@Jetson:~$ 

同理,打开XFTP,设置好IP地址和端口22,XFTP也能连接到Jetson Nano

这里有一个坑,我的系统中桌面共享一点就Ubuntu异常,不知其他人有没有这个问题。害的我想了其它办法解决共享桌面的问题

2. 关于更新源

一般来说,安装完系统后应当更新源,但是由于Jetson Nano采用的是aarch64架构的Ubuntu 18.04.2 LTS系统,与AMD架构的Ubuntu系统不同,而我没有找到完美的国内源,所以不推荐大家换源。我自己尝试了中科大的源,里面有很多软件都没有。这里还是把中科大的源贴在下面,大家谨慎使用。

deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-proposed main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-proposed main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe

 增加了清华大学源(2019-09-23),读者任选其一就行

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse

 

我这里并没有换源,还是使用Jetson  Nano的默认源进行更新。更新过程很漫长,大家可以执行完命令,改干啥就干啥吧

sudo apt-get update
sudo apt-get full-upgrade

 3. 检查已经安装的系统组件

Jetson-nano的OS镜像已经自带了JetPack,cuda,cudnn,opencv等都已经安装好,并有例子,这些例子安装路径如下所示

TensorRT /usr/src/tensorrt/samples/
CUDA /usr/local/cuda-/samples/
cuDNN /usr/src/cudnn_samples_v7/
Multimedia API /usr/src/tegra_multimedia_api/
VisionWorks /usr/share/visionworks/sources/samples/ /usr/share/visionworks-tracking/sources/samples/ /usr/share/visionworks-sfm/sources/samples/
OpenCV /usr/share/OpenCV/samples/

(1) 检查CUDA

Jetson-nano中已经安装了CUDA10.0版本,但是此时你如果运行 nvcc -V是不会成功的,需要你把CUDA的路径写入环境变量中。OS中自带Vim工具 ,所以运行下面的命令编辑环境变量

sudo vim  ~/.bashrc

在最后添加

export CUDA_HOME=/usr/local/cuda-10.0
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-10.0/bin:$PATH

 然后保存退出

 

对了最后别忘了source一下这个文件。

source ~/.bashrc

 source后,此时再执行nvcc -V执行结果如下

beckhans@Jetson:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sun_Sep_30_21:09:22_CDT_2018
Cuda compilation tools, release 10.0, V10.0.166
beckhans@Jetson:~$

 (2)检查OpenCV

Jetson-nano中已经安装了OpenCV3.3版本,可以使用命令检查OpenCV是否安装就绪

pkg-config opencv --modversion

如果OpenCv安装就绪,会显示版本号,我的版本是3.3.1

(3)检查cuDNN

Jetson-nano中已经安装好了cuDNN,并有例子可供运行,我们运行一下例子,也正好验证上面的CUDA

cd /usr/src/cudnn_samples_v7/mnistCUDNN   #进入例子目录
sudo make     #编译一下例子
sudo chmod a+x mnistCUDNN # 为可执行文件添加执行权限
./mnistCUDNN # 执行

如果成功,如下所示

beckhans@Jetson:/usr/src/cudnn_samples_v7/mnistCUDNN$ ./mnistCUDNN
cudnnGetVersion() : 7301 , CUDNN_VERSION from cudnn.h : 7301 (7.3.1)
Host compiler version : GCC 7.3.0
There are 1 CUDA capable devices on your machine :
device 0 : sms  1  Capabilities 5.3, SmClock 921.6 Mhz, MemSize (Mb) 3964, MemClock 12.8 Mhz, Ecc=0, boardGroupID=0
Using device 0

Testing single precision
Loading image data/one_28x28.pgm
Performing forward propagation ...
Testing cudnnGetConvolutionForwardAlgorithm ...
Fastest algorithm is Algo 1
Testing cudnnFindConvolutionForwardAlgorithm ...
^^^^ CUDNN_STATUS_SUCCESS for Algo 1: 0.325104 time requiring 3464 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 0: 0.387500 time requiring 0 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.540729 time requiring 57600 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 4: 4.965156 time requiring 207360 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 7: 5.201146 time requiring 2057744 memory
Resulting weights from Softmax:
0.0000000 0.9999399 0.0000000 0.0000000 0.0000561 0.0000000 0.0000012 0.0000017 0.0000010 0.0000000 
Loading image data/three_28x28.pgm
Performing forward propagation ...
Resulting weights from Softmax:
0.0000000 0.0000000 0.0000000 0.9999288 0.0000000 0.0000711 0.0000000 0.0000000 0.0000000 0.0000000 
Loading image data/five_28x28.pgm
Performing forward propagation ...
Resulting weights from Softmax:
0.0000000 0.0000008 0.0000000 0.0000002 0.0000000 0.9999820 0.0000154 0.0000000 0.0000012 0.0000006 

Result of classification: 1 3 5

Test passed!

Testing half precision (math in single precision)
Loading image data/one_28x28.pgm
Performing forward propagation ...
Testing cudnnGetConvolutionForwardAlgorithm ...
Fastest algorithm is Algo 1
Testing cudnnFindConvolutionForwardAlgorithm ...
^^^^ CUDNN_STATUS_SUCCESS for Algo 0: 0.113750 time requiring 0 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 1: 0.119792 time requiring 3464 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.236198 time requiring 28800 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 4: 1.031719 time requiring 207360 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 5: 5.049948 time requiring 203008 memory
Resulting weights from Softmax:
0.0000001 1.0000000 0.0000001 0.0000000 0.0000563 0.0000001 0.0000012 0.0000017 0.0000010 0.0000001 
Loading image data/three_28x28.pgm
Performing forward propagation ...
Resulting weights from Softmax:
0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000714 0.0000000 0.0000000 0.0000000 0.0000000 
Loading image data/five_28x28.pgm
Performing forward propagation ...
Resulting weights from Softmax:
0.0000000 0.0000008 0.0000000 0.0000002 0.0000000 1.0000000 0.0000154 0.0000000 0.0000012 0.0000006 

Result of classification: 1 3 5

Test passed!

好了,基本组件检查完毕,下一次安装一些机器学习一定会用到的包 

 

你可能感兴趣的:(机器学习,Jetson,Nano)