Jetson依赖说明
更新时间:2023-01-09
一、硬件准备
本文使用的设备是jetson nano,也可以使用Jetson Xavier TX2/NX/AGX等设备。
二、jetpack依赖
本实验使用的模型依赖于JetPack 4.4,在安装 JetPack 时务必安装对应的组件:
- 使用 SDK Manager 安装 JetPack 需要勾选 TensorRT、OpenCV、CUDA、cuDNN 等选项。
- 使用 SD Card Image 方式(仅对 Jetson Nano 和 Jetson Xavier NX 有效)则无需关心组件问题,默认会全部安装。
在已经安装好的Jetson设备上,可以使用apt-cache show nvidia-jetpack、jetsonUtilities和jtop来查看jetpack版本。
1.使用apt-cache show nvidia-jetpack
执行如下命令,查看jetson版本:
nvidia@miivii-tegra:~$ sudo apt-cache show nvidia-jetpack
[sudo] password for nvidia:
Package: nvidia-jetpack
Architecture: arm64
Version: 4.5-b129
Priority: standard
Section: metapackages
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-cuda (= 4.5-b129), nvidia-opencv (= 4.5-b129), nvidia-cudnn8 (= 4.5-b129), nvidia-tensorrt (= 4.5-b129), nvidia-visionworks (= 4.5-b129), nvidia-container (= 4.5-b129), nvidia-vpi (= 4.5-b129), nvidia-l4t-jetson-multimedia-api (>> 32.5-0), nvidia-l4t-jetson-multimedia-api (<< 32.6-0)
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_4.5-b129_arm64.deb
Size: 29360
MD5sum: 06962c42e462f643455d6194d1a2d641
SHA1: cb17547b902b2793e0df86d561809ecdbf7e401f
SHA256: 002646e6d81d13526ade23d7c45180014f3cd9e9f5fb0f8896b77dff85d6b9fe
SHA512: 99e95085ecd9ff4c33a0fc01da35a56447db2e6f372aa08c9e307a4dfd955c0ccd2d9c27e508d808f54e24827cba022338e0fc32a7bebce421c5381e16e1ac23
Homepage: http://developer.nvidia.com/jetson
Description: NVIDIA Jetpack Meta Package
Description-md5: ad1462289bdbc54909ae109d1d32c0a8
2.使用jetsonUtilities
下载jetsonUtilities到本地,然后执行如下python脚本:
nano@jetson-nano:~$ python jetsonInfo.py
NVIDIA Jetson AGX Xavier [16GB]
L4T 32.5.0 [ JetPack 4.5 ]
Ubuntu 18.04.5 LTS
Kernel Version: 4.9.201-tegra
CUDA 10.2.89
CUDA Architecture: 7.2
OpenCV version: 4.1.1
OpenCV Cuda: NO
CUDNN: 8.0.0.180
TensorRT: 7.1.3.0
Vision Works: 1.6.0.501
VPI: ii libnvvpi1 1.0.15 arm64 NVIDIA Vision Programming Interface library
Vulcan: 1.2.70
上述为jetpack 4.5版本的信息。
3.使用jtop
参考jetson_stats官网安装jtop程序,安装命令如下:
# 1. 更新系统包
sudo apt-get update
sudo apt-get upgrade
# 2. 安装pip
sudo apt-get install python-pip
# 3. 检查 pip 是否安装成功
pip -V
# 4.安装jtop
sudo -H pip install -U jetson-stats
# 5.查看系统服务状态
sudo systemctl status jetson_stats
# 6.卸载jtop
sudo pip uninstall jetson-stats
# 7. 查看pip软件清单
pip list
安装完毕以后,可以执行jtop
命令查看jetson信息,如下图所示:
三、nvidia-docker依赖
jetson设备默认安装了docker,建议使用docker 19.03及以上版本。可以在jetson设备上执行docker info
查看docker信息,执行结果如下:
$ docker info
Client:
Debug Mode: false
Server:
Containers: 38
Running: 21
Paused: 0
Stopped: 17
Images: 12
Server Version: 19.03.6
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: nvidia runc
Default Runtime: nvidia
Init Binary: docker-init
containerd version:
runc version:
init version:
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.140-tegra
Operating System: Ubuntu 18.04.5 LTS
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 3.871GiB
Name: jetson-nano
ID: O7GP:DDD5:5CIR:LEWJ:2BQ3:4WIW:VA4H:JDCP:5VGL:L2K3:PLZ7:KBHO
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
如果Default Runtime
不是nvidia
,而是runc
,则修改/etc/docker/daemon.json
文件,添加"default-runtime": "nvidia"
,修改完毕以后的/etc/docker/daemon.json
文件如下所示:
nano@jetson-nano:~$ cat /etc/docker/daemon.json
{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
}
}
修改完毕以后,重启docker,执行如下命令:
sudo systemctl daemon-reload
sudo systemctl restart docker
四、库文件依赖
EasyEdge Jetson 推理镜像依赖库文件,需下载对应版本库文件,并将其放置在 Jetson 设备 /etc/nvidia-container-runtime/host-files-for-container.d/
目录下,如下图所示:
库文件下载地址:
- jetpack 4.4:easyedge_runtime_j44.csv
- jetpack 4.5:easyedge_runtime_j45.csv
五、查看其他信息常用命令
1.查看nv_tegra_release版本
nano@jetson-nano:~$ head -n 1 /etc/nv_tegra_release
# R32 (release), REVISION: 4.3, GCID: 21589087, BOARD: t210ref, EABI: aarch64, DATE: Fri Jun 26 04:38:25 UTC 2020
2.查看cuda-driver版本
查看cuda驱动版本,可以使用一下命令:
nano@jetson-nano:~$ dpkg -l | grep cuda-driver
ii cuda-driver-dev-10-2 10.2.89-1 arm64 CUDA Driver native dev stub library
3.查看TensorRT版本
查看TensorRT版本,可以使用一下命令:
nano@jetson-nano:~$ dpkg -l | grep TensorRT
ii graphsurgeon-tf 7.1.3-1+cuda10.2 arm64 GraphSurgeon for TensorRT package
ii libnvinfer-bin 7.1.3-1+cuda10.2 arm64 TensorRT binaries
ii libnvinfer-dev 7.1.3-1+cuda10.2 arm64 TensorRT development libraries and headers
ii libnvinfer-doc 7.1.3-1+cuda10.2 all TensorRT documentation
ii libnvinfer-plugin-dev 7.1.3-1+cuda10.2 arm64 TensorRT plugin libraries
ii libnvinfer-plugin7 7.1.3-1+cuda10.2 arm64 TensorRT plugin libraries
ii libnvinfer-samples 7.1.3-1+cuda10.2 all TensorRT samples
ii libnvinfer7 7.1.3-1+cuda10.2 arm64 TensorRT runtime libraries
ii libnvonnxparsers-dev 7.1.3-1+cuda10.2 arm64 TensorRT ONNX libraries
ii libnvonnxparsers7 7.1.3-1+cuda10.2 arm64 TensorRT ONNX libraries
ii libnvparsers-dev 7.1.3-1+cuda10.2 arm64 TensorRT parsers libraries
ii libnvparsers7 7.1.3-1+cuda10.2 arm64 TensorRT parsers libraries
ii nvidia-container-csv-tensorrt 7.1.3.0-1+cuda10.2 arm64 Jetpack TensorRT CSV file
ii python-libnvinfer 7.1.3-1+cuda10.2 arm64 Python bindings for TensorRT
ii python-libnvinfer-dev 7.1.3-1+cuda10.2 arm64 Python development package for TensorRT
ii python3-libnvinfer 7.1.3-1+cuda10.2 arm64 Python 3 bindings for TensorRT
ii python3-libnvinfer-dev 7.1.3-1+cuda10.2 arm64 Python 3 development package for TensorRT
ii tensorrt 7.1.3.0-1+cuda10.2 arm64 Meta package of TensorRT
ii uff-converter-tf 7.1.3-1+cuda10.2 arm64 UFF converter for TensorRT package