安装pytorch

现在nvidia官方已经提供了简单的安装命令。

https://docs.nvidia.com/deeplearning/frameworks/install-pytorch-jetson-platform/index.html

是nvidia为jetson系列专门定制的pytorch。但是其他的包还是需要自己编译安装,比如torchvision

移动tmp目录

Jetson Nano没有内置存储,所以我通过usb挂载了一个ssd。之前也尝试过直接不用tf卡,但是需要稍微折腾一下。

Jetson Orin 只有64GB的内置存储,插了一块2T的nvme ssd,挂载了/home到这块硬盘。

挂载硬盘的过程比较简单,所以这里不再赘述,现在将/tmp映射到/home/tmp下。直接修改/etc/fstab的内容:

/home/tmp   /tmp    none    bind    0 0 

等同于以下命令:

sudo mount --bind /home/tmp /tmp 

意思是以后访问/tmp目录时,实际上访问的是/home/tmp

也可以加入crontab

@reboot mount --bind /home/tmp /tmp

注意/home/tmp的权限是777。

快速创建一个大文件

fallocate -l 2G large ; sync

可以通过上述命令,在/tmp下创建一个大文件,然后通过df -h来查看这个文件是累计在了/还是/home的硬盘,以此来验证是否mount成功。

关闭X

我不需要桌面服务,所以直接卸载了ubuntu自带的很多软件。也可以直接设置默认登录的时候,不进入桌面环境。

# disable X mode by default
sudo systemctl set-default multi-user.target
# enable X mode by default
sudo systemctl set-default graphical.target

安装jtop

https://github.com/rbonghi/jetson_stats

sudo apt install -y python3-pip
sudo -H pip3 install -U jetson-stats

wifi连接

# 查看可用的热点
nmcli dev wifi list
# 输入密码连接wifi
nmcli dev wifi connect wifiname password xxxxxx
# 主动连接某配置的wifi
nmcli connection up wifiname # 开启
nmcli connection down  # 关闭

jetson nano 安装conda

普通的miniconda或者anaconda无法直接安装成功,找到了一个奇怪的办法。

wget --quiet -O archiconda.sh https://github.com/Archiconda/build-tools/releases/download/0.2.3/Archiconda3-0.2.3-Linux-aarch64.sh && \
    sh archiconda.sh -b -p $HOME/archiconda3

export PATH=$HOME/archiconda3/bin:$PATH
conda config --add channels gaiar && \
conda config --add channels conda-forge && \
conda config --add channels c4aarch64 && \
conda update -n base --all && \
conda install -y python=3.7 libiconv && \
conda install -y conda-build && \
conda install -y anaconda-client

pytorch

https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-11-now-available/72048

Reference

https://askubuntu.com/questions/371619/move-tmp-folder-from-partition-to-mounted-partition-mnt https://www.cyberciti.biz/faq/switch-boot-target-to-text-gui-in-systemd-linux/ https://github.com/rbonghi/jetson_stats https://cyb.tw/docs/Tech/2020/9/18_Install-anaconda-on-Jetson-Nano.html#update-the-conda

https://serverfault.com/questions/613179/how-do-i-do-mount-bind-in-etc-fstab

https://stackoverflow.com/questions/257844/quickly-create-a-large-file-on-a-linux-system

https://blog.kelu.org/tech/2022/01/04/wifi-conn-with-nmcli.html


文章版权归 FindHao 所有丨本站默认采用CC-BY-NC-SA 4.0协议进行授权|
转载必须包含本声明,并以超链接形式注明作者 FindHao 和本文原始地址:
https://findhao.net/easycoding/2599.html

Comments