jetson-nano -- 进行简单的测试

技术 · 2019-05-18 · 367 人浏览

Jetson-nano的系统已经将JetPack,cuda,cudnn,opencv等都已经安装好,不再需要额外的配置,这里简单测试一下。

系统里面自带了cudnn的测试程序,在/usr/src/cudnn_samples_v7/目录下,这里用mnistCUDNN程序进行测试。

cp -rvf /usr/src/cudnn_samples_v7/mnistCUDNN ~ # 将mnistCUDNN复制到home目录
cd ~/mnistCUDNN
make # 编译源代码
chmod a+x mnistCUDNN # 为可执行文件添加执行权限
./mnistCUDNN # 执行

上述步骤执行后,应该可以看到如下的输出:

cudnnGetVersion() : 7301 , CUDNN_VERSION from cudnn.h : 7301 (7.3.1)
Host compiler version : GCC 6.4.1
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.324636 time requiring 3464 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 0: 0.393541 time requiring 0 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.616615 time requiring 57600 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 4: 5.011875 time requiring 207360 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 5: 25.143282 time requiring 203008 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.137136 time requiring 0 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 1: 0.157031 time requiring 3464 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.293541 time requiring 28800 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 4: 1.024427 time requiring 207360 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 5: 5.061406 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有一个显卡,cudnn版本为7.3.1。

jetson-nano cudnn GPU
Theme Jasmine by Kent Liao