Jetson Nano Basics

Jetson Nano Basics

Basic Install and fix Update problem

One of the problems with the new Jetson Nano 2GB board is that a lot of the tutorials and install guides are outdated and lead to problems. So here's my take based on Jetpack 4.4.1 Jan 2021.

Install - simply download the system image from the Nvidia site, use Balena Etcher to write an SD card on your main machine; boot the Nano and follow the normal Ubuntu install instructions.

Update with the normal

sudo apt-get update && sudo apt-get install

DO NOT REBOOT despite being told one is necessary

Clear the old files

sudo apt-get autoremove

The update process breaks the lightdm greeter screen and if you reboot you will be presented with a blank screen. No problems, you can simply SSH into the Nano and perform the following, but, of course, it is simpler to do this whilst still logged into the Nano, before rebooting.

Add Nano editor if you don't like Vim

sudo apt-get install nano

Get the lightdm gtk greeter

sudo apt-get install lightdm-gtk-greeter

and tell lightdm to use this greeter:

sudo nano /etc/lighdm/lightdm.conf.d/50-nvidia.conf

add the following line to the end

greeter-session=lightdm-gtk-greeter

You should now get a login screen on reboot and continue as normal

Install Microsoft VS Code

Follow this instructions here: https://www.jetsonhacks.com/2020/11/28/visual-studio-code/

Basically clone the git repository and run

./installVSCode.sh

from within it.

Fix OpenCV code completion and pylint errors in VS Code

Big thanks to Paul McWhorter at TopTechBoy who has an excellent  set of Jetson Nano, opencv and AI tutorials on Youtube. Beware, though, the earlier episodes were written for previous versions of Jetpack and are out of date - following the instructions on this website is better for Jetpack 4.4.1. BTW Paul, in turn, thanked David Westmorland for coming up with this fix

Firstly check the location of your python opencv install:

dpkg -L libopencv-python

It is probably at

/usr/lib/python3.6/dist-packages/cv2/python-3.6

Start VS Code and go to preferences with

ctrl-shift-p

Search for

Preferences: Open Settings (JSON)

If you haven't configured VS Code then this file is probably empty (save a couple of braces), add the following two lines

"python.linting.pylintArgs": ["--generate-members", "--extension-pkg-whitelist=cv2"],

"python.autoComplete.extraPaths": ["/usr/lib/python3.6/dist-packages/cv2/python-3.6"]

Note: The path in the second expression must be the same as the path as shown by that previous dpgk -L command.

Save that preferences file and exit VS Code. On restart opencv pylint errors should have gone and code completion/prompting should work for opencv

Install matplotlib

I wanted to play with matplotlib so simply installed via

sudo apt-get install python3-matplotlib