Jetson Nano的环境配置

最近又刷了一遍Jetson Nano系统,下载Jetpack4.3,因为这个有最新的cuda10.2,烧录之后搞了环境配置。

1. 修改apt软件源

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bk

sudo vim /etc/apt/sources.list

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe

修改完软件源以后记得update:

sudo apt-get update

2. 因为程序比较耗内存,故而增加swap交换区

1)创建交换区并分配空间

sudo mkdir /swap

sudo swapon --show

sudo fallocate -l 8G /swap/swapfile 或者 sudo dd if=/dev/zero of=/swap/swapfile bs=2M count=4096

sudo chmod 600 /swap/swapfile

sudo mkswap /swap/swapfile

sudo swapon /swap/swapfile

sudo nano /etc/fstab

增加这一条在下面:

/swap/swapfile swap swap defaults 0 0

再用free -h 查看

2) 对于一般系统来说swappiness=60是ok的,但是对于服务器来说最好设置成一个较小的值

cat /proc/sys/vm/swappiness 输出

60

sudo nano /etc/sysctl.conf 加上: vm.swappiness=10

3) 解除swap交换空间

sudo swapoff -v /swap/swapfile

sudo rm /swap/swapfile

3. 安装Archiconda3

下载下来archiconda3安装包以后运行脚本正常安装,再创建环境以防环境混乱

conda create -n myEnv python=3.6

需要使用环境再: conda activate myEnv

不用退出时:conda deactivate

4. 安装Pytorch, Pillow等

因为Jetpack4.3是cuda10.2,故而只能安装最新的pytorch==1.5,下载下来以后安装步骤安装即可:

sudo apt-get install python3-pip libopenblas-base libopenmpi-dev

pip3 install Cython

pip3 install numpy torch-1.5.0-cp36-cp36m-linux_aarch64.whl

安装Pillow试过pip和conda都不行,最后用:

python3 -m pip install --upgrade Pillow

 

你可能感兴趣的:(Jetson Nano的环境配置)