An instraction for coding and other shit on Jetson nano
This repo is archived. For more information please visit my homepage.
Go to Nvidia for the system image.
Using balenaEtcher to flash the image to your sd card or ssd drive.
Note: Jetson Nano B01 has a m.2 port but not does not support a hard drive. Using an ssd can only boot via usb.
Ref: Zhihu-Nvidia Jetson Nano USB SSD Boot Configuration
After flash the drive, mount the APP sector on a linux computer. Edit file /boot/extlinux/extlinux.conf
.
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0
Change /dev/mmcblk0p1
into /dev/sda1
.
Anaconda is useful.
Anaconda.org used to only support some x86 version. Recently they updated a ARM64 version. I haven't try it yet, just note here.
I'm using Archiconda.
One can download the script and run it easily.
Nvidia has a compiled-for-jetson version of PyTorch.
They offered an instruction as well. Check it on their website.
To install torchvision, check this instruction from Qengineering.
Verification
import torch
print(torch.__version__)
print(torch.cuda.is_available())
import torchvision
print(torchvision.__version__)
Might have some problems.
Python 3.6.13 | packaged by conda-forge | (default, Feb 19 2021, 05:46:38)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Illegal instruction (core dumped)
This is a numpy 1.19.5 issue, run pip install numpy==1.19.4
to fix this.
If you used the wheel from Nvidia, you will get all the c++ libs aka libtorch.
Use command python -c 'import torch;print(torch.utils.cmake_prefix_path)'
to find the directory.
Note:
Must run the command in the conda enviorment which already installed pytorch.
Then set the cmake argument CMAKE_PREFIX_PATH
to it.
A demo is given in this repo.
For python, install via conda.
For c++, follow the instructions given by Qengineering.
A demo for libtorch & OpenCV is given in this repo.
Note: Using OpenCV from conda-forge may not be able to use a gstreamer camera(CSI camera like rpi camera). See issue#1 for more details.
todo