不同的第三方载板有不同的烧录方案,使用的为米文动力的载板,安装的为jetpac4.6版本系统,按照官方文档进行烧录。
http://doc.miivii.com/6717496.html#LiteNanoMini%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C-%E9%99%842.FlashTools%EF%BC%88%E5%88%B7%E6%9C%BA%E5%B7%A5%E5%85%B7%EF%BC%89ReleaseNote
开发板自带的16GB的内存比较小,在安装SSD后可将系统迁移至SSD中,参考https://blog.csdn.net/m0_53408051/article/details/127655853
git clone https://github.com/jetsonhacks/rootOnNVMe.git
cd rootOnNVMe
进入目录,./copy-rootfs-ssd.sh
执行复制脚本./setup-service.sh
将rootfs设置为NVME,sudo reboot
重启重启之后,则可看到你的新的机子的空间变为SD卡或者SSD的空间大小,原有的空间变成了一个盘(不要删除它,否则会出事)
PS:git clone出现 fatal: unable to access解决方案
终端执行 git config --global http.proxy
以及 git config --global http.proxy
一些模块的安装可以帮助后续更好的使用,参考https://blog.csdn.net/IamYZD/article/details/119618950
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo gedit /etc/apt/sources.list
清华大学镜像源:
# 默认注释了源码镜像以提高 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
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse
中国科学技术大学镜像源:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb http://mirrors.ustc.edu.cn/ubuntu-ports bionic main restricted universe multiverse
# deb-src http://mirrors.ustc.edu.cn/ubuntu-ports bionic main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports bionic-updates main restricted universe multiverse
# deb-src http://mirrors.ustc.edu.cn/ubuntu-ports bionic-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports bionic-backports main restricted universe multiverse
# deb-src http://mirrors.ustc.edu.cn/ubuntu-ports bionic-backports main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports bionic-security main restricted universe multiverse
# deb-src http://mirrors.ustc.edu.cn/ubuntu-ports bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb http://mirrors.ustc.edu.cn/ubuntu-ports bionic-proposed main restricted universe multiverse
# deb-src http://mirrors.ustc.edu.cn/ubuntu-ports bionic-proposed main restricted universe multiverse
阿里巴巴镜像站:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/s bionic-backports main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse
sudo apt update
sudo apt upgrade -y
Ubuntu18.04自带python2和python3两个版本,但没有预安装pip,参考https://blog.csdn.net/wenwst/article/details/106982806
pip安装好后添加国内源,方便快速下载,参考https://blog.csdn.net/carrymingteng/article/details/120978053。
sudo apt install python-pip # 安装
pip --version # 输出版本号,安装成功
pip install --upgrade pip # 保证版本最新
sudo apt install python3-pip # 安装
pip3 --version # 输出版本号,安装成功
pip3 install --upgrade pip # 保证版本最新
打开终端输入:
mkdir ~/.pip
sudo gedit ~/.pip/pip.conf
在空白文件中输入如下内容保存并退出,以下国内源可以任选其一:
以下为豆瓣源:
[global]
timeout=6000
index-url=https://pypi.doubanio.com/simple
trusted-host=pypi.doubanio.com
以下为阿里源:
[global]
index-url=http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
以下为清华源:
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host=https://pypi.tuna.tsinghua.edu.cn
jetpack系统不能使用nvidia-smi来查看显卡使用情况,需要安装jtop来查看机器状态
sudo pip3 install jetson-stats # 安装jtop
sudo jtop # 运行jtop
# 可以查看cpu,gpu,内存,以及硬盘的使用情况,还能够调整jetson nano的运行模式
# 以及查看系统的cuda,cudnn,tensorRT的版本等情况
jetson 预装了cuda版本,想要使用gup算力需要安装pytorch等模块
# jetson nano内置好了cuda,但需要配置环境变量才能使用,打开命令行添加环境变量即可
gedit ~/.bashrc
# 在最后添加这些
export PATH=/usr/local/cuda-10.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_ROOT=/usr/local/cuda
source ~/.bashrc # 应用当前配置
nvcc -V # 查看是否配置成功
安装torch依赖
sudo apt-get install libopenblas-base libopenmpi-dev
官网下载torch1.7及torchvision0.8.0,外网速度慢,已上传https://download.csdn.net/download/qq_37527608/86991829,0积分下载,下载完成后解压。
安装torch和torchvision
pip3 install Cython
pip3 install numpy torch-1.7.0-cp36-cp36m-linux_aarch64.whl
pip3 install torchvision-0.8.0a0+291f7e2-cp36-cp36m-linux_aarch64.whl
# 在终端输入运行python3,进入python环境
import torch
torch.__version__
torch.cuda.is_available()
import torchvision
torchvision.__version__
# 输出如下图所示则安装成功
PS:torchvision报错:UserWarning: Failed to load image Python extension解决方案
如果torch版本与torchvision版本不对应,更换为对应版本,如果版本对应可卸载当前版本,更换更低版本的torch和torchvision。
PS:pip安装警告: which is not on PATH解决方案
# 配置路径
gedit ~/.bashrc
# 在文件最后添加路径,该路径来源于第一步中安装 pip 时发出的警告
export PATH=/home/xxxx/.local/bin:$PATH
source ~/.bashrc
之后的步骤可能需要使用U盘把文件拷入开发板,但是对于大容量设备可能会出现无法挂载,一条安装命令解决
sudo apt-get install exfat-utils
来自参考博客https://blog.csdn.net/IamYZD/article/details/119618950,不安装可能没问题,但还是安了,万一呢
# 配置需要用到的库
sudo apt-get install build-essential make cmake cmake-curses-gui -y
sudo apt-get install git g++ pkg-config curl -y
sudo apt-get install libatlas-base-dev gfortran libcanberra-gtk-module libcanberra-gtk3-module -y
sudo apt-get install libhdf5-serial-dev hdf5-tools -y
sudo apt-get install nano locate screen -y
# 安装所需要的依赖环境
sudo apt-get install libfreetype6-dev -y
sudo apt-get install protobuf-compiler libprotobuf-dev openssl -y
sudo apt-get install libssl-dev libcurl4-openssl-dev -y
sudo apt-get install cython3 -y
# 安装opencv的系统级依赖,一些编解码的库
sudo apt-get install build-essential -y
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -y
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff5-dev libdc1394-22-dev -y
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev liblapacke-dev -y
sudo apt-get install libxvidcore-dev libx264-dev -y
sudo apt-get install libatlas-base-dev gfortran -y
sudo apt-get install ffmpeg -y
# 更新cmake
wget http://www.cmake.org/files/v3.13/cmake-3.13.0.tar.gz
tar xpvf cmake-3.13.0.tar.gz cmake-3.13.0/ #解压
cd cmake-3.13.0/
./bootstrap --system-curl # 漫长的等待,做一套眼保健操...
make -j4 #编译 同样是漫长的等待...
echo 'export PATH=~/cmake-3.13.0/bin/:$PATH' >> ~/.bashrc
source ~/.bashrc #更新.bashrc
# torchvision 0.9.0版本需要的依赖
sudo apt-get install libopenmpi2
sudo apt-get install libopenblas-dev
sudo apt-get install libjpeg-dev zlib1g-dev
使用ssh能够在同一网络下的另一台设备上登录jetson终端,更方便的进行操作和文件传输
ifconfig -a
ssh nvidia@192.168.0.101 # 用户名@ip地址
# 输入登录密码,即可登录
# 从服务器上下载文件
scp nvidia@192.168.0.101:/xxx/test.txt ./test
# 上传本地文件到服务器
scp ./test.txt nvidia@192.168.0.101:/xxx/test/
# 从服务器下载整个目录
scp -r nvidia@192.168.0.101:/xxx/test ./test/
# 上传目录到服务器
scp -r ./test nvidia@192.168.0.101:/xxx/test/