https://developer.nvidia.com/embedded/downloads
##官方下载地址 可选择NX和nano
## https://developer.nvidia.com/zh-cn/embedded/downloads#?search=Jetson%20Xavier%20NX%20Developer%20Kit%20User%20Guide
单击“选择图像”,然后选择较早下载的压缩镜像文件(如果找不到就改一下后缀即可)。
插入您的microSD卡。如果没有连接其他外部驱动器,则Etcher将自动选择microSD卡作为目标设备。否则,请单击“更改”并选择正确的设备。
然后点击Flash开始烧录镜像!Wait 20mintus approximately
下面是烧录完成的图:
一开始风扇是不会自己转的,需要自己设置,255是最大转速,可以根据需要自己调整
sudo sh -c 'echo 255 > /sys/devices/pwm-fan/target_pwm'
创建/etc/rc.local(18.04没有rc.local),并添加如下内容:
#!/bin/bash
sleep 10
sudo /usr/bin/jetson_clocks
sudo sh -c 'echo 255 > /sys/devices/pwm-fan/target_pwm'
添加rc.local可执行权限
sudo chmod 755 /etc/rc.local
重启即可
sudo reboot
先找到system setting 点击language support 点击install/remove languages 选中 Chinese(simplified)安装,安装好了之后就可以执行下面操作
安装ibus框架,在Terminal中输入:
sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4
im-config -s ibus
sudo apt-get install ibus-pinyin
sudo ibus-setup
Finally!在弹出的对话框中添加Chinese-Pinyin输入法就OK啦~
#打开终端,在终端中输入命令:
export LANG=en_US
xdg-user-dirs-gtk-update
#在弹出的窗口中询问是否将目录转化为英文路径,同意并关闭.
#转回中文在终端中输入命令:
export LANG=zh_CN
https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
由于ubuntu默认的软件源是国外的源,下载速度非常慢,而且经常链接中断,非常不稳定。so,we have to change the source of software to install environment.please follow me.
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo gedit /etc/apt/sources.list
#Ubuntu 官方源
deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
#阿里云
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
#网易163
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
#中科大
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main restricted
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates multiverse
deb 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
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security multiverse
deb http://archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse
sudo apt-get update
sudo apt-get dist-upgrade # 涉及核心的升级,通常会对系统功能产生实际的影响,可能在需要的情况下卸载一些已经安装的软件也可能安装一些额外的软件,通常应该谨慎操作,特别是有未完成的工作,但是在允许的情况下应该尽力升级,应为可能涉及一些重大的核心升级,比如安全。
sudo apt-get upgrade # 不会对系统产生重大的影响,可以在任何时候运行。
sudo apt-get install libhdf5-serial-dev hdf5-tools zlib1g-dev zip libjpeg8-dev libhdf5-dev python3-pip
pip3 install -U numpy
pip3 install -U h5py
pip3 install -U grpcio absl-py py-cpuinfo psutil portpicker grpcio six mock requests gast astor termcolor
jetson nano默认已经安装了CUDA10.2,但是直接运行 nvcc -V是不会成功的,需要你把CUDA的路径写入环境变量中。
sudo gedit ~/.bashrc
在最后添加
export CUBA_HOME=/usr/local/cuda-10.2
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-10.2/bin:$PATH
然后保存退出
source ~/.bashrc
通过终端opencv_version
可查看jetson nano自带的4.1.1的版本
因此我们也不需要重新进行编译,直接使用就好了
通过python3/import cv2可查看
git clone git://github.com/NVIDIA-AI-IOT/torch2trt
cd torch2trt
sudo -s
python setup.py install
运行成功
1.如何是开机插上的摄像头就应该先关机重启之后才会显示
2.开机,输入ls /dev/video* 看看是不是有摄像头设备
3.输入nvgstcapture 一般来说就可以将摄像头直接打开,如果需要关闭直接关闭终端就好了
4.要是不显示就更新一下,sudo apt-get update sudo apt-get upgrade
如果要看如何调用摄像头就看下面这个文章
https://blog.csdn.net/m0_51004308/article/details/116541877
由于Jetson nano的内存只有4GB,且与显存共用,后期编译torchvision,生成TensorRT推理引擎文件不够用,这里提前增加swap内存。
方式1
sudo fallocate -l 4G /var/swapfile
sudo chmod 600 /var/swapfile
sudo mkswap /var/swapfile
sudo swapon /var/swapfile
sudo bash -c 'echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab'
方式2
sudo gedit /etc/systemd/nvzramconfig.sh
通过vim打开nvzramconfig.sh,按"i"进入"insert"模式,修改mem= ( ( ( " (((" ((("{totalmem}" / 2 / “ N R D E V I C E S " ) ∗ 1024 ) ) 为 m e m = {NRDEVICES}") * 1024))为mem= NRDEVICES")∗1024))为mem=(((” t o t a l m e m " ∗ 2 / " {totalmem}" * 2 / " totalmem"∗2/"{NRDEVICES}") * 1024)),按"ESC"退出"insert"模式,输入":wq"保存并退出,输入"reboot"重启开发板。