设备简介
Jetson Xavier NX是一款具有强大计算能力的AI处理器,它采用了NVIDIA的Turing架构和Volta GPU架构,可以实现高性能的深度学习和推理任务。具体性能如下:
-
CPU:6核心ARM Cortex-A57处理器,最高主频1.5GHz。
-
GPU:384个Volta GPU核心,最高主频1.33GHz。
-
神经网络加速器:2个NVIDIA Deep Learning Accelerator (NVDLA)引擎,可提供高效率的推理加速。
-
内存:6GB LPDDR4x RAM。
-
AI性能:11 TOPS(16位浮点数运算每秒)的深度学习性能,可提供高速、低功耗的AI推理功能。
-
连接性:具有多种接口,包括千兆以太网、HDMI、USB、PCIe和M.2 NVMe接口等。
Jetson Xavier NX在计算能力、图形处理能力和AI性能方面都表现出色,是一款适用于高要求AI场景下的处理器。同时,它的小体积和低功耗也使得它适用于嵌入式系统和边缘设备。
安装torch
Python 3.6
ref: https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048
wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.8.0-cp36-cp36m-linux_aarch64.whl
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev libomp-dev
pip3 install Cpython
pip3 install numpy torch-1.8.0-cp36-cp36m-linux_aarch64.whl
[BUG] 下载.whl文件过于缓慢
下载到本机,离线传到jetson设备。
安装torchvision
sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libopenblas-dev libavcodec-dev libavformat-dev libswscale-dev
git clone --branch <version> https://github.com/pytorch/vision torchvision # see below for version of torchvision to download
cd torchvision
export BUILD_VERSION=0.x.0 # where 0.x.0 is the torchvision version
python3 setup.py install --user
cd ../ # attempting to load torchvision from build dir will result in import error
pip install 'pillow<7' # always needed for Python 2.7, not needed torchvision v0.5.0+ with Python 3.6
<version> 替换为 v0.9.0
torchvision和PyTorch版本对应如下:
PyTorch v1.0 - torchvision v0.2.2
PyTorch v1.1 - torchvision v0.3.0
PyTorch v1.2 - torchvision v0.4.0
PyTorch v1.3 - torchvision v0.4.2
PyTorch v1.4 - torchvision v0.5.0
PyTorch v1.5 - torchvision v0.6.0
PyTorch v1.6 - torchvision v0.7.0
PyTorch v1.7 - torchvision v0.8.1
PyTorch v1.8 - torchvision v0.9.0
PyTorch v1.9 - torchvision v0.10.0
PyTorch v1.10 - torchvision v0.11.1
PyTorch v1.11 - torchvision v0.12.0
PyTorch v1.12 - torchvision v0.13.0
PyTorch v1.13 - torchvision v0.13.0
PyTorch v1.14 - torchvision v0.14.1
PyTorch v2.0.0 - torchvision v0.15.1
[BUG] Illegal instruction (core dumped)
运行python3 setup.py install --user报错
ref: https://blog.csdn.net/xiaosongshine/article/details/114168235
解决:将“export OPENBLAS_CORETYPE=ARMV8”加入到“~/.bashrc”中
验证
import torch
print(torch.__version__)
print('CUDA available: ' + str(torch.cuda.is_available()))
print('cuDNN version: ' + str(torch.backends.cudnn.version()))
a = torch.cuda.FloatTensor(2).zero_()
print('Tensor a = ' + str(a))
b = torch.randn(2).cuda()
print('Tensor b = ' + str(b))
c = a + b
print('Tensor c = ' + str(c))
import torchvision
print(torchvision.__version__)