Jetson Nano & TX2 (二)检查已安装组件__JetPack 4.3

~这里是JetPack 4.3,其他就不废话了

Jetson系列 利用前面方式安装,自带 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/

这里就着重CUDA、cuDNN、OpenCV ,其他后续补上

(1) 检查CUDA

JetPack 4.3 中已经安装了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执行结果如下

yuki@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
yuki@Jetson:~$

(2)检查OpenCV

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

pkg-config opencv --modversion

如果OpenCv安装就绪,会显示版本号,默认版本是3.3.1(很气。。4.0版本后面会说)

(3)检查cuDNN

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

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

如果成功,如下所示

yuki@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!

基本组件检查完毕了,TensorRT、Multimedia API、VisionWorks 还有Deepstream 后面会补充,如何测试和使用

你可能感兴趣的:(Jetson系列)